1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
jodyhinson2010 edited this page 2025-02-21 22:38:26 +00:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.


Today, we are delighted to reveal that DeepSeek R1 distilled Llama and Qwen models are available through Amazon Bedrock Marketplace and Amazon SageMaker JumpStart. With this launch, you can now release DeepSeek AI's first-generation frontier design, DeepSeek-R1, in addition to the distilled versions ranging from 1.5 to 70 billion specifications to construct, experiment, and properly scale your generative AI concepts on AWS.

In this post, we demonstrate how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to release the distilled variations of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that uses support learning to enhance reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A key identifying feature is its support learning (RL) action, which was used to improve the design's responses beyond the basic pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adapt more effectively to user feedback and objectives, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, meaning it's geared up to break down intricate queries and reason through them in a detailed manner. This directed thinking process enables the design to produce more accurate, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT abilities, aiming to produce structured reactions while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually captured the market's attention as a flexible text-generation design that can be integrated into numerous workflows such as representatives, sensible thinking and information interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture allows activation of 37 billion specifications, making it possible for efficient reasoning by routing questions to the most pertinent professional "clusters." This method enables the design to specialize in various issue domains while maintaining total performance. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge circumstances to release the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking capabilities of the main R1 design to more efficient architectures based on popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller, more effective designs to mimic the habits and thinking patterns of the larger DeepSeek-R1 design, using it as a teacher model.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise releasing this design with guardrails in location. In this blog, we will utilize Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous material, and assess designs against crucial security criteria. At the time of writing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce numerous guardrails tailored to various usage cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, you need access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, select Amazon SageMaker, and validate you're utilizing ml.p5e.48 xlarge for endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are releasing. To ask for a limit increase, produce a limit boost request and reach out to your account group.

Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) approvals to use Amazon Bedrock Guardrails. For guidelines, see Establish consents to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, prevent harmful material, and assess models against essential security requirements. You can carry out security steps for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to assess user inputs and model reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo.

The general circulation involves the following actions: First, the system gets an input for the model. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent out to the design for reasoning. After getting the design's output, another guardrail check is applied. If the output passes this last check, it's returned as the last outcome. However, if either the input or output is intervened by the guardrail, a message is returned suggesting the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following sections show reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized structure models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:

1. On the Amazon Bedrock console, select Model catalog under Foundation models in the navigation pane. At the time of composing this post, you can use the InvokeModel API to conjure up the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and select the DeepSeek-R1 design.

The model detail page offers necessary details about the model's capabilities, pricing structure, and implementation guidelines. You can discover detailed usage directions, including sample API calls and code bits for integration. The design supports numerous text generation jobs, including material production, code generation, and concern answering, utilizing its reinforcement discovering optimization and CoT reasoning capabilities. The page likewise consists of implementation alternatives and licensing details to assist you begin with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, choose Deploy.

You will be prompted to set up the release details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters). 5. For Number of circumstances, get in a variety of instances (in between 1-100). 6. For Instance type, select your circumstances type. For optimal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can configure advanced security and facilities settings, consisting of virtual private cloud (VPC) networking, service function consents, and encryption settings. For many utilize cases, the default settings will work well. However, for production deployments, you might want to evaluate these settings to align with your company's security and compliance requirements. 7. Choose Deploy to start using the model.

When the deployment is total, you can check DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground. 8. Choose Open in play area to access an interactive user interface where you can experiment with different prompts and adjust design parameters like temperature level and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimal outcomes. For instance, material for reasoning.

This is an excellent way to explore the model's thinking and text generation capabilities before incorporating it into your applications. The playground supplies immediate feedback, assisting you comprehend how the model responds to numerous inputs and letting you fine-tune your prompts for ideal outcomes.

You can quickly evaluate the design in the play ground through the UI. However, to conjure up the released model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run inference using guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to carry out inference using a released DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can create a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo. After you have produced the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures reasoning parameters, and sends out a demand to generate text based upon a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, integrated algorithms, and prebuilt ML options that you can release with just a couple of clicks. With SageMaker JumpStart, wiki.asexuality.org you can tailor pre-trained models to your use case, with your data, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart uses two convenient techniques: utilizing the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you pick the method that finest suits your .

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions to deploy DeepSeek-R1 utilizing SageMaker JumpStart:

1. On the SageMaker console, pick Studio in the navigation pane. 2. First-time users will be prompted to produce a domain. 3. On the SageMaker Studio console, select JumpStart in the navigation pane.

The design browser displays available designs, with details like the supplier name and design capabilities.

4. Look for DeepSeek-R1 to see the DeepSeek-R1 design card. Each design card shows essential details, including:

- Model name

  • Provider name
  • Task category (for instance, Text Generation). Bedrock Ready badge (if applicable), showing that this design can be registered with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to conjure up the model

    5. Choose the design card to see the design details page.

    The model details page consists of the following details:

    - The design name and provider details. Deploy button to deploy the design. About and Notebooks tabs with detailed details

    The About tab consists of important details, such as:

    - Model description.
  • License details.
  • Technical specifications.
  • Usage guidelines

    Before you release the design, it's suggested to evaluate the model details and license terms to confirm compatibility with your usage case.

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, utilize the immediately generated name or garagesale.es create a custom one.
  1. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the variety of instances (default: 1). Selecting appropriate circumstances types and pipewiki.org counts is essential for cost and efficiency optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time inference is chosen by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this design, we strongly suggest sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to release the model.

    The implementation process can take a number of minutes to finish.

    When implementation is total, your endpoint status will change to InService. At this moment, the model is ready to accept reasoning requests through the endpoint. You can keep an eye on the release progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the implementation is complete, you can invoke the model utilizing a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get begun with DeepSeek-R1 using the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the essential AWS permissions and environment setup. The following is a detailed code example that shows how to release and use DeepSeek-R1 for reasoning programmatically. The code for releasing the model is supplied in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run extra requests against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail utilizing the Amazon Bedrock console or setiathome.berkeley.edu the API, and execute it as revealed in the following code:

    Clean up

    To avoid undesirable charges, complete the steps in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you deployed the model utilizing Amazon Bedrock Marketplace, oeclub.org complete the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace releases.
  5. In the Managed deployments area, locate the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, choose Delete.
  7. Verify the endpoint details to make certain you're erasing the correct implementation: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed will sustain costs if you leave it running. Use the following code to delete the endpoint if you wish to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we checked out how you can access and release the DeepSeek-R1 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, pediascape.science Amazon Bedrock Marketplace, and Getting begun with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI business develop ingenious services using AWS services and sped up calculate. Currently, he is concentrated on developing techniques for fine-tuning and optimizing the inference efficiency of big language designs. In his leisure time, Vivek enjoys hiking, viewing films, and attempting different cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group at AWS. His location of focus is AWS AI accelerators (AWS Neuron). He holds a Bachelor's degree in Computer Science and Bioinformatics.

    Jonathan Evans is a Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads item, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about building options that help customers accelerate their AI journey and unlock service worth.