1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
melainecallina edited this page 2025-04-11 09:34:30 -04: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 thrilled to reveal that DeepSeek R1 distilled Llama and Qwen designs are available through Amazon Bedrock Marketplace and Amazon SageMaker JumpStart. With this launch, you can now deploy DeepSeek AI's first-generation frontier design, DeepSeek-R1, along with the distilled variations ranging from 1.5 to 70 billion criteria to develop, experiment, and responsibly scale your generative AI ideas on AWS.

In this post, we show how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to deploy the distilled variations of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that utilizes support learning to improve thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential identifying feature is its support learning (RL) step, which was utilized to improve the model's reactions beyond the basic pre-training and fine-tuning procedure. By integrating RL, DeepSeek-R1 can adjust better to user feedback and objectives, ultimately boosting both relevance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, suggesting it's geared up to break down complex questions and reason through them in a detailed manner. This guided reasoning procedure allows the design to produce more accurate, transparent, and detailed answers. This model integrates RL-based fine-tuning with CoT abilities, aiming to generate structured responses while focusing on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has actually captured the industry's attention as a flexible text-generation model that can be incorporated into numerous workflows such as agents, sensible reasoning and data analysis jobs.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture allows activation of 37 billion parameters, allowing effective inference by routing inquiries to the most appropriate specialist "clusters." This method allows the design to concentrate on various problem domains while maintaining general performance. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances to release the design. ml.p5e.48 xlarge features 8 Nvidia H200 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking capabilities of the main R1 model to more efficient architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a process of training smaller, more efficient models to imitate the behavior and reasoning patterns of the larger DeepSeek-R1 design, utilizing it as an instructor model.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we recommend releasing this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent damaging material, and assess models against essential safety requirements. At the time of composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop several guardrails tailored to different use cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, you need access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and verify you're using ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are releasing. To ask for a limit increase, develop a limit increase demand and reach out to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, avoid hazardous content, and assess models against key safety requirements. You can implement precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to evaluate user inputs and model responses released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.

The general flow includes the following steps: First, the system receives an input for the design. 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 receiving the model's output, another guardrail check is applied. If the output passes this last check, it's returned as the outcome. However, if either the input or output is intervened by the guardrail, a message is returned indicating the nature of the intervention and whether it happened at the input or output stage. The examples showcased in the following sections demonstrate reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides you access to over 100 popular, emerging, and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following actions:

1. On the Amazon Bedrock console, pick Model brochure under Foundation designs in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to conjure up the model. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and select the DeepSeek-R1 model.

The design detail page provides essential details about the design's capabilities, prices structure, and execution guidelines. You can find detailed use instructions, consisting of sample API calls and code bits for combination. The model supports numerous text generation tasks, consisting of content development, code generation, and concern answering, using its reinforcement finding out optimization and CoT thinking capabilities. The page also consists of deployment choices and licensing details to assist you begin with DeepSeek-R1 in your applications. 3. To start using DeepSeek-R1, choose Deploy.

You will be triggered to set up the implementation details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of circumstances, get in a number of instances (between 1-100). 6. For Instance type, pick your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can configure advanced security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role consents, and encryption settings. For a lot of utilize cases, the default settings will work well. However, for production deployments, you may wish to examine these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start using the design.

When the implementation is complete, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in play area to access an interactive user interface where you can try out different triggers and adjust design specifications like temperature and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimal results. For example, material for inference.

This is an excellent way to check out the model's thinking and text generation capabilities before integrating it into your applications. The play area supplies immediate feedback, assisting you understand how the design reacts to various inputs and letting you tweak your triggers for optimal outcomes.

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

Run reasoning using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to carry out reasoning using a deployed DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo. After you have actually created the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures inference specifications, and sends out a demand to generate text based on 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 deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your information, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart offers two hassle-free techniques: utilizing the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's check out both approaches to assist you select the approach that finest matches your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The design browser shows available designs, with details like the company name and model capabilities.

4. Search for DeepSeek-R1 to see the DeepSeek-R1 model card. Each model card reveals key details, consisting of:

- Model name

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

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

    The design details page consists of the following details:

    - The model name and company details. Deploy button to release the model. About and Notebooks tabs with detailed details

    The About tab consists of important details, such as:

    - Model description.
  • License details.
  • Technical requirements.
  • Usage standards

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

    6. Choose Deploy to continue with release.

    7. For Endpoint name, use the instantly created name or produce a customized one.
  1. For Instance type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the number of circumstances (default: 1). Selecting proper instance types and counts is important for expense and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for accuracy. For this design, we highly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to release the design.

    The release procedure can take numerous minutes to finish.

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

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To start with DeepSeek-R1 using the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the required AWS permissions and environment setup. The following is a detailed code example that demonstrates how to release and utilize DeepSeek-R1 for reasoning programmatically. The code for deploying the model is offered in the Github here. You can clone the note pad and run 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 use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail using the Amazon Bedrock console or the API, and execute it as shown in the following code:

    Tidy up

    To prevent unwanted charges, complete the actions in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you deployed the design utilizing Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace implementations.
  5. In the Managed implementations section, find the endpoint you wish to erase.
  6. Select the endpoint, and on the Actions menu, pick Delete.
  7. Verify the endpoint details to make certain you're deleting the proper deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you released will sustain expenses 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 explored how you can access and release the DeepSeek-R1 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting going with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI companies construct innovative solutions utilizing AWS services and sped up compute. Currently, he is concentrated on establishing methods for fine-tuning and optimizing the reasoning efficiency of big language models. In his leisure time, Vivek takes pleasure in hiking, viewing motion pictures, and attempting various foods.

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

    Jonathan Evans is a Professional Solutions Architect working on generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and wavedream.wiki strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about constructing services that help consumers accelerate their AI journey and unlock service value.