DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
dewittphilips9 於 5 月之前 修改了此頁面


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 deploy DeepSeek AI’s first-generation frontier model, DeepSeek-R1, together with the distilled variations varying from 1.5 to 70 billion criteria to construct, experiment, and responsibly scale your generative AI ideas on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that utilizes support learning to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial identifying function is its reinforcement knowing (RL) step, which was used to improve the design’s responses beyond the standard pre-training and fine-tuning process. By integrating RL, DeepSeek-R1 can adjust more successfully to user feedback and goals, ultimately improving both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, indicating it’s geared up to break down complicated questions and factor through them in a detailed manner. This directed reasoning procedure allows the design to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to produce structured reactions while focusing on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has caught the industry’s attention as a versatile text-generation model that can be integrated into numerous workflows such as agents, rational reasoning and information analysis jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture allows activation of 37 billion parameters, allowing efficient inference by routing inquiries to the most appropriate professional “clusters.” This approach enables the model to focus 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 use an ml.p5e.48 xlarge instance to release the model. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled designs 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 process of training smaller sized, more effective designs to simulate the behavior and thinking patterns of the larger DeepSeek-R1 model, utilizing it as a teacher 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, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid damaging content, wiki.dulovic.tech and examine models against essential security criteria. At the time of writing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop numerous guardrails tailored to various usage cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls across 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 confirm you’re using 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 increase, develop a limit boost demand and reach out to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent hazardous content, and assess designs against key safety criteria. You can implement precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and design actions deployed 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 develop the guardrail, see the GitHub repo.

The general circulation involves the following steps: 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 model for inference. After getting 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 suggesting the nature of the intervention and whether it took place at the input or output phase. The examples showcased in the following sections demonstrate inference utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

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

1. On the Amazon Bedrock console, choose Model brochure under Foundation models in the navigation pane. At the time of composing this post, you can use the InvokeModel API to invoke the model. It does not support Converse APIs and other Amazon Bedrock tooling.

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

    The design detail page provides necessary details about the model’s abilities, prices structure, and execution guidelines. You can discover detailed use guidelines, consisting of sample API calls and code snippets for integration. The design supports numerous text generation tasks, consisting of material production, code generation, and concern answering, utilizing its reinforcement discovering optimization and CoT reasoning abilities. The page likewise includes implementation alternatives and licensing details to help you get going with DeepSeek-R1 in your applications.
  2. To begin using DeepSeek-R1, select Deploy.

    You will be triggered to set up the deployment details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters).
  4. For Variety of instances, enter a number of instances (between 1-100).
  5. For Instance type, choose your instance type. For optimal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, you can set up advanced security and infrastructure settings, including virtual private cloud (VPC) networking, service function consents, and file encryption settings. For the majority of use cases, the default settings will work well. However, for production implementations, you may want to evaluate these settings to line up with your organization’s security and compliance requirements.
  6. Choose Deploy to begin using the model.

    When the implementation is complete, you can test DeepSeek-R1’s capabilities straight in the Amazon Bedrock play ground.
  7. Choose Open in playground to access an interactive user interface where you can explore 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 optimum outcomes. For example, material for reasoning.

    This is an outstanding way to check out the design’s thinking and text generation abilities before integrating it into your applications. The playground supplies immediate feedback, helping you understand how the design reacts to different inputs and letting you fine-tune your prompts for optimal outcomes.

    You can rapidly check 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 utilizing guardrails with the deployed DeepSeek-R1 endpoint

    The following code example demonstrates how to perform reasoning using a deployed DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can produce a guardrail using 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 implement guardrails. The script initializes the bedrock_runtime client, sets up reasoning parameters, and sends out a demand to produce 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 simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your data, and deploy them into production using either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 convenient methods: using the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let’s explore both methods to help you choose the method that finest fits your needs.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

    The model web browser displays available models, 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 key details, consisting of:

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

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

    The design details page includes 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 crucial details, such as:

    - Model description.
  12. License .
  13. Technical specifications.
  14. Usage guidelines

    Before you deploy the design, it’s suggested to evaluate the design details and license terms to validate compatibility with your usage case.

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, utilize the instantly produced name or produce a custom one.
  15. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, go into the variety of instances (default: 1). Selecting proper circumstances types and counts is crucial for expense and performance optimization. Monitor your release to change these settings as needed.Under Inference type, Real-time inference is selected by default. This is optimized for sustained traffic and low latency.
  17. Review all setups for accuracy. For this model, we highly recommend sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  18. Choose Deploy to deploy the model.

    The deployment process can take several minutes to finish.

    When deployment is complete, your endpoint status will change to InService. At this point, the model is all set to accept reasoning demands through the endpoint. You can keep track of the release progress on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the deployment is complete, you can invoke the model 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 utilizing 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 demonstrates how to release and use DeepSeek-R1 for inference programmatically. The code for deploying the model is supplied in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run extra demands 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 develop a guardrail using the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Clean up

    To avoid undesirable charges, complete the actions in this area to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the design utilizing Amazon Bedrock Marketplace, total the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, higgledy-piggledy.xyz choose Marketplace releases.
  19. In the Managed releases area, locate the endpoint you want to delete.
  20. Select the endpoint, archmageriseswiki.com and on the Actions menu, choose Delete.
  21. Verify the endpoint details to make certain you’re deleting the appropriate release: 1. Endpoint name.
  22. Model name.
  23. 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 desire to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we checked out how you can access and deploy the DeepSeek-R1 model utilizing 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 models, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, 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 companies build ingenious services using AWS services and accelerated calculate. Currently, he is concentrated on developing methods for fine-tuning and enhancing the reasoning performance of large language models. In his spare time, Vivek enjoys treking, seeing movies, and trying 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 technology and Bioinformatics.

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

    Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI center. She is passionate about developing solutions that help consumers accelerate their AI journey and unlock service worth.