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 release DeepSeek AI's first-generation frontier design, DeepSeek-R1, along with the distilled variations ranging 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 comparable steps 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 thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A key differentiating feature is its support knowing (RL) step, which was used to refine the model's responses beyond the standard pre-training and fine-tuning process. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and goals, ultimately improving both significance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, suggesting it's geared up to break down complicated queries and factor through them in a detailed manner. This assisted thinking procedure enables the model to produce more accurate, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT capabilities, aiming to produce structured responses while concentrating on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has actually captured the industry's attention as a versatile text-generation model that can be incorporated into different workflows such as agents, sensible reasoning and data analysis jobs.
DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion parameters, enabling efficient inference by routing queries to the most relevant professional "clusters." This approach allows the model to specialize in various issue domains while maintaining total performance. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize 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 capabilities of the main R1 design to more effective architectures based on popular open models 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 mimic the habits and reasoning patterns of the bigger 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 suggest releasing this design with guardrails in place. In this blog, we will utilize Amazon Bedrock Guardrails to introduce safeguards, avoid harmful content, and evaluate designs against essential safety requirements. At the time of composing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop several guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls across your generative AI applications.
Prerequisites
To deploy the DeepSeek-R1 design, 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, choose Amazon SageMaker, and verify you're using 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 request a limitation increase, produce a limitation boost demand and reach out to your account team.
Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) consents to use Amazon Bedrock Guardrails. For guidelines, see Set up approvals to utilize guardrails for content filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails enables you to introduce safeguards, avoid damaging content, and examine designs against crucial security requirements. You can implement safety steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to evaluate user inputs and design reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.
The general flow 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 model's output, another guardrail check is used. If the output passes this final check, it's returned as the result. However, if either the input or output is stepped in by the guardrail, a message is returned showing the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following sections show inference using 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 actions:
1. On the Amazon Bedrock console, pick Model brochure under Foundation models in the navigation pane.
At the time of writing 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 company and choose the DeepSeek-R1 model.
The design detail page offers vital details about the design's abilities, rates structure, and implementation standards. You can find detailed use directions, including sample API calls and code snippets for combination. The design supports various text generation jobs, consisting of content development, code generation, and concern answering, utilizing its support discovering optimization and CoT thinking abilities.
The page also consists of release options and licensing details to help you get started with DeepSeek-R1 in your applications.
3. To begin utilizing DeepSeek-R1, pick Deploy.
You will be prompted to configure the deployment 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 Variety of instances, go into a number of circumstances (in between 1-100).
6. For Instance type, select your instance type. For optimal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended.
Optionally, you can set up innovative security and infrastructure settings, including virtual personal cloud (VPC) networking, service role consents, and encryption settings. For many use cases, the default settings will work well. However, for production implementations, you might desire to review these settings to align with your company's security and compliance requirements.
7. Choose Deploy to start utilizing the model.
When the release is total, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock playground.
8. Choose Open in play ground to access an interactive user interface where you can experiment with various triggers and adjust design criteria like temperature and maximum length.
When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimal results. For instance, material for inference.
This is an outstanding way to check out the design's thinking and text generation capabilities before integrating it into your applications. The play area supplies immediate feedback, assisting you comprehend how the model responds to various inputs and letting you tweak your triggers for optimum results.
You can quickly check the model in the play area through the UI. However, to invoke the released model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.
Run reasoning utilizing guardrails with the deployed DeepSeek-R1 endpoint
The following code example demonstrates how to perform reasoning utilizing a deployed DeepSeek-R1 model through Amazon Bedrock utilizing 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 developed the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, and sends a request to create text based upon a user timely.
Deploy DeepSeek-R1 with SageMaker JumpStart
SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, integrated algorithms, and [forum.batman.gainedge.org](https://forum.batman.gainedge.org/index.php?action=profile
1
DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
catheriner8297 edited this page 2 weeks ago