1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Adan Tice edited this page 2025-05-28 16:17:39 +08: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 excited 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 deploy DeepSeek AI's first-generation frontier model, DeepSeek-R1, in addition to the distilled versions ranging from 1.5 to 70 billion parameters to develop, experiment, and properly scale your generative AI ideas on AWS.

In this post, we demonstrate how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable steps to release the distilled versions of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that utilizes reinforcement discovering to improve thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial differentiating function is its reinforcement knowing (RL) step, which was used to improve the design's actions beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adapt more effectively to user feedback and goals, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, implying it's geared up to break down complicated questions and reason through them in a detailed way. This guided thinking process allows the model to produce more accurate, transparent, and detailed responses. This design combines RL-based fine-tuning with CoT abilities, aiming to create structured responses while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually caught the market's attention as a versatile text-generation model that can be integrated into various workflows such as agents, sensible reasoning and data interpretation jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion criteria, making it possible for effective reasoning by routing inquiries to the most pertinent professional "clusters." This method permits the model to specialize in various issue domains while maintaining general performance. DeepSeek-R1 needs 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 design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

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

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest releasing this design with guardrails in place. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous content, and evaluate models against key safety requirements. At the time of writing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce numerous guardrails tailored to different usage cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, you require access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and verify you're utilizing 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 request a limit increase, produce a limitation boost demand and reach out to your account group.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) authorizations to utilize Amazon Bedrock Guardrails. For instructions, see Set up consents to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock you to introduce safeguards, prevent harmful content, and assess designs against key safety requirements. You can execute safety procedures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to evaluate user inputs and design actions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo.

The basic flow includes the following steps: First, the system receives 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 receiving the model's output, another guardrail check is used. If the output passes this last check, it's returned as the last outcome. However, wiki.lafabriquedelalogistique.fr if either the input or output is stepped in by the guardrail, a message is returned indicating the nature of the intervention and whether it occurred at the input or output stage. The examples showcased in the following areas show reasoning using 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 steps:

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

The model detail page offers essential details about the design's capabilities, pricing structure, and implementation guidelines. You can discover detailed use instructions, consisting of sample API calls and code bits for integration. The design supports numerous text generation tasks, including material creation, code generation, and concern answering, utilizing its support learning optimization and CoT thinking capabilities. The page also consists of implementation alternatives and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, choose Deploy.

You will be prompted to set up the implementation details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of circumstances, get in a variety of instances (between 1-100). 6. For Instance type, pick your instance type. For optimal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role authorizations, and file encryption settings. For the majority of use cases, the default settings will work well. However, for production implementations, you might desire to evaluate these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start utilizing the design.

When the deployment is complete, you can test DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in playground to access an interactive interface where you can try out various triggers and adjust design specifications like temperature and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimum results. For example, material for reasoning.

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

You can rapidly test the design in the playground through the UI. However, to invoke the deployed model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run reasoning using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to perform inference using a deployed DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. 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. After you have actually produced the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime customer, configures inference criteria, and sends a request to generate text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, built-in algorithms, and prebuilt ML services that you can deploy with just a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart uses 2 practical techniques: utilizing the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both techniques to assist you choose the technique that finest suits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The model web browser shows available designs, with details like the supplier name and model abilities.

4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card. Each design card shows essential details, consisting of:

- Model name

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

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

    The design details page consists of the following details:

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

    The About tab consists of essential details, such as:

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

    Before you release the model, it's advised to review the model details and license terms to confirm compatibility with your use case.

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, use the automatically produced name or develop a custom-made one.
  1. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the number of circumstances (default: 1). Selecting suitable instance types and 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 setups for precision. For this design, we highly recommend sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to release the model.

    The release procedure can take a number of minutes to finish.

    When release is complete, your endpoint status will change to InService. At this moment, the design is prepared to accept reasoning demands through the endpoint. You can monitor the implementation development on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the release is complete, you can conjure up the design utilizing a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get started with DeepSeek-R1 using the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the necessary AWS permissions and environment setup. The following is a detailed code example that shows how to release and utilize DeepSeek-R1 for inference programmatically. The code for releasing the model is offered in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run additional demands against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail utilizing the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Tidy up

    To prevent undesirable charges, finish the steps in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you deployed the model using Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace deployments.
  5. In the Managed implementations area, find 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 deleting the appropriate implementation: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed will sustain expenses if you leave it running. Use the following code to erase 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 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get begun. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, yewiki.org Amazon Bedrock Marketplace, and Starting with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI business construct ingenious services utilizing AWS services and sped up calculate. Currently, he is concentrated on developing methods for fine-tuning and optimizing the inference efficiency of large language designs. In his spare time, Vivek takes pleasure in hiking, viewing motion pictures, and trying various cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team 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 product, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about building options that help customers accelerate their AI journey and unlock service worth.