DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
anibalgeake855이(가) 1 개월 전에 이 페이지를 수정함


Today, we are excited 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, in addition to the distilled variations ranging from 1.5 to 70 billion criteria to build, experiment, and responsibly scale your generative AI ideas on AWS.

In this post, we demonstrate how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to deploy the distilled versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) established by DeepSeek AI that uses reinforcement discovering to boost thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial differentiating function is its reinforcement learning (RL) step, which was used to refine the model’s actions beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adapt better to user feedback and goals, eventually enhancing both significance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, suggesting it’s equipped to break down intricate inquiries and reason through them in a detailed manner. This assisted reasoning 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 actions while focusing on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has actually captured the market’s attention as a flexible text-generation model that can be incorporated into various workflows such as agents, logical thinking and data analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion parameters, making it possible for effective inference by routing questions to the most relevant “clusters.” This approach permits the design to specialize in different problem domains while maintaining overall efficiency. 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 instance to release the model. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning abilities of the main R1 design to more effective architectures based on 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 efficient models to mimic the habits and thinking patterns of the larger DeepSeek-R1 design, using it as an instructor design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise deploying this design with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid damaging material, and evaluate designs against essential security requirements. At the time of writing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create multiple 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 deploy the DeepSeek-R1 design, you require access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and confirm you’re utilizing ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are deploying. To request a limit boost, produce a limit boost demand and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, prevent hazardous material, and assess designs against key security requirements. You can execute safety measures for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to evaluate user inputs and design actions deployed 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 create the guardrail, see the GitHub repo.

The basic circulation includes the following actions: 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 model for inference. After receiving the design’s output, another guardrail check is used. If the output passes this final check, it’s returned as the final result. 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 took place 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 offers you access to over 100 popular, emerging, and specialized foundation models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:

1. On the Amazon Bedrock console, choose Model catalog under Foundation designs 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.

  1. Filter for DeepSeek as a company and choose the DeepSeek-R1 model.

    The model detail page offers vital details about the design’s capabilities, rates structure, and application guidelines. You can find detailed usage instructions, consisting of sample API calls and code snippets for combination. The design supports numerous text generation jobs, consisting of content development, code generation, and concern answering, utilizing its support learning optimization and CoT thinking abilities. The page likewise includes deployment alternatives and licensing details to assist you begin with DeepSeek-R1 in your applications.
  2. To begin using DeepSeek-R1, pick Deploy.

    You will be triggered to set up the release details for DeepSeek-R1. The model ID will be pre-populated.
  3. For Endpoint name, go into an endpoint name (between 1-50 alphanumeric characters).
  4. For Variety of circumstances, enter a number of instances (in between 1-100).
  5. For Instance type, choose your circumstances type. For optimum performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, you can configure sophisticated security and facilities settings, including virtual personal cloud (VPC) networking, service role consents, and file encryption settings. For a lot of use cases, the default settings will work well. However, for production releases, you might desire to review these settings to align with your organization’s security and compliance requirements.
  6. Choose Deploy to begin using the model.

    When the deployment is total, you can check DeepSeek-R1’s abilities straight in the Amazon Bedrock play area.
  7. Choose Open in playground to access an interactive user interface where you can explore different triggers and change design specifications like temperature level and maximum length. When using R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat template for optimal results. For example, material for reasoning.

    This is an exceptional method to check out the design’s thinking and text generation abilities before integrating it into your applications. The play area provides immediate feedback, helping you understand how the model responds to various inputs and letting you fine-tune your triggers for optimal results.

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

    Run reasoning utilizing guardrails with the released DeepSeek-R1 endpoint

    The following code example shows how to perform inference utilizing a deployed DeepSeek-R1 model 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 develop the guardrail, see the GitHub repo. After you have actually created the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime customer, configures reasoning specifications, 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) center with FMs, built-in algorithms, and prebuilt ML services that you can deploy with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your data, and deploy them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 design through SageMaker JumpStart uses two hassle-free approaches: utilizing the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let’s check out both approaches to assist you pick the technique that best suits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

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

    4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card. Each design card shows crucial details, consisting of:

    - Model name
  10. Provider name
  11. Task category (for example, Text Generation). Bedrock Ready badge (if suitable), indicating that this model can be signed up with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to conjure up the design

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

    The model details page consists of the following details:

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

    The About tab includes important details, such as:

    - Model description.
  12. License details.
  13. Technical specs.
  14. Usage guidelines

    Before you release the design, it’s recommended to examine the model details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, utilize the immediately created name or develop a customized one.
  15. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  16. For Initial circumstances count, enter the variety of instances (default: 1). Selecting proper circumstances types and counts is vital for cost and efficiency optimization. Monitor your deployment to adjust these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is enhanced for sustained traffic and low latency.
  17. Review all setups for precision. For this model, we highly advise sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  18. Choose Deploy to release the model.

    The implementation procedure can take numerous minutes to finish.

    When implementation is complete, your endpoint status will alter to InService. At this point, the model is all set to accept inference requests through the endpoint. You can keep track of the implementation development on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the release is total, you can conjure up the design utilizing a SageMaker runtime customer and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the necessary AWS consents and environment setup. The following is a detailed code example that shows how to deploy and utilize DeepSeek-R1 for inference programmatically. The code for releasing the model is supplied in the Github here. You can clone the note pad and run from SageMaker Studio.

    You can run additional requests against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

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

    Clean up

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

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace implementations.
  19. In the Managed implementations section, locate the endpoint you wish to erase.
  20. Select the endpoint, and on the Actions menu, pick Delete.
  21. Verify the endpoint details to make certain you’re deleting the correct deployment: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed 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 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Beginning 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 build ingenious options using AWS services and sped up calculate. Currently, he is focused on establishing methods for fine-tuning and enhancing the inference efficiency of big language designs. In his free time, Vivek enjoys treking, seeing motion pictures, and attempting various cuisines.

    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 technology and Bioinformatics.

    Jonathan Evans is a Specialist Solutions Architect working on 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 solutions that help consumers accelerate their AI journey and unlock organization value.