Today, we are excited to announce 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, together with the distilled variations varying from 1.5 to 70 billion specifications to construct, experiment, and properly 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 steps to deploy the distilled variations of the models too.
Overview of DeepSeek-R1
DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that uses support learning to enhance thinking abilities through a multi-stage training process from a DeepSeek-V3-Base structure. A crucial distinguishing function is its support learning (RL) action, which was used to refine the model’s actions beyond the basic pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adjust better to user feedback and goals, ultimately enhancing both significance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, implying it’s geared up to break down complicated questions and reason through them in a detailed manner. This assisted thinking procedure enables the design to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT abilities, aiming to generate structured actions while concentrating on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has recorded the market’s attention as a flexible text-generation model that can be integrated into various workflows such as agents, logical reasoning and information analysis jobs.
DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture enables activation of 37 billion parameters, making it possible for effective reasoning by routing queries to the most pertinent specialist “clusters.” This technique permits the design to concentrate on various problem domains while maintaining general performance. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge circumstances to deploy the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.
DeepSeek-R1 distilled designs bring the thinking abilities of the main R1 design to more effective architectures based upon popular open models like Qwen (1.5 B, 7B, bytes-the-dust.com 14B, and 32B) and Llama (8B and 70B). Distillation describes a procedure of training smaller sized, more efficient designs to simulate the habits and reasoning patterns of the bigger DeepSeek-R1 model, using it as an instructor model.
You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise releasing this model with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent damaging content, and assess models against crucial safety criteria. At the time of composing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create several guardrails tailored to different usage cases and use them to the DeepSeek-R1 model, trademarketclassifieds.com improving user experiences and standardizing safety controls throughout your generative AI applications.
Prerequisites
To release 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, pick Amazon SageMaker, and validate 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 deploying. To a limitation increase, develop a limitation increase demand and reach out to your account team.
Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) authorizations to use Amazon Bedrock Guardrails. For directions, see Establish permissions to use guardrails for content filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to present safeguards, avoid harmful content, and assess designs against essential safety requirements. You can execute precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to evaluate user inputs and model responses released 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 produce the guardrail, see the GitHub repo.
The basic circulation 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 model for inference. After getting the design’s output, another guardrail check is used. 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 occurred at the input or output stage. The examples showcased in the following areas demonstrate reasoning using this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace provides you access to over 100 popular, emerging, and specialized foundation designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:
1. On the Amazon Bedrock console, select Model catalog under Foundation models in the navigation pane.
At the time of writing this post, you can use the InvokeModel API to invoke the model. It doesn’t support Converse APIs and other Amazon Bedrock tooling.
- Filter for DeepSeek as a company and pick the DeepSeek-R1 design.
The design detail page provides necessary details about the model’s abilities, prices structure, and execution standards. You can find detailed use directions, consisting of sample API calls and code bits for combination. The model supports various text generation jobs, consisting of content development, code generation, and concern answering, using its support finding out optimization and CoT reasoning capabilities.
The page likewise includes implementation options and licensing details to assist you get begun with DeepSeek-R1 in your applications.
- To begin utilizing DeepSeek-R1, pick Deploy.
You will be prompted to set up the release details for DeepSeek-R1. The model ID will be pre-populated.
- For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters).
- For Variety of circumstances, enter a variety of instances (in between 1-100).
- For example type, pick your instance type. For optimum 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 function consents, and file encryption settings. For many utilize cases, the default settings will work well. However, for production implementations, you may want to examine these settings to align with your organization’s security and compliance requirements.
- Choose Deploy to begin using the design.
When the deployment is total, you can evaluate DeepSeek-R1’s capabilities straight in the Amazon Bedrock play area.
- Choose Open in play area to access an interactive interface where you can explore various prompts and change model criteria like temperature level and optimum length.
When using R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat design template for ideal outcomes. For instance, content for reasoning.
This is an outstanding method to explore 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 reacts to numerous inputs and letting you tweak your prompts for optimum results.
You can rapidly test the model in the playground through the UI. However, to invoke the deployed model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.
Run inference using guardrails with the released DeepSeek-R1 endpoint
The following code example shows how to carry out inference using a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. 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. After you have developed the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime client, sets up inference parameters, and sends out a demand to create text based on a user timely.
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 release 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 utilizing either the UI or SDK.
Deploying DeepSeek-R1 design through SageMaker JumpStart offers two practical approaches: using the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let’s check out both approaches to assist you choose the method that finest matches your requirements.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following actions to release DeepSeek-R1 using SageMaker JumpStart:
1. On the SageMaker console, select Studio in the navigation pane.
- First-time users will be prompted to produce a domain.
- On the SageMaker Studio console, pick JumpStart in the navigation pane.
The model internet browser shows available designs, with details like the company name and design abilities.
4. Search for DeepSeek-R1 to view the DeepSeek-R1 design card.
Each model card shows key details, including:
- Model name
- Provider name
- Task category (for example, Text Generation).
Bedrock Ready badge (if applicable), suggesting that this design can be signed up with Amazon Bedrock, allowing you to utilize Amazon Bedrock APIs to conjure up the model
5. Choose the model card to view the model details page.
The model details page includes the following details:
- The design name and company details.
Deploy button to release the model.
About and Notebooks tabs with detailed details
The About tab includes crucial details, such as:
- Model description.
- License details.
- Technical specs.
- Usage guidelines
Before you release the design, it’s advised to review the model details and license terms to verify compatibility with your use case.
6. Choose Deploy to proceed with deployment.
7. For Endpoint name, use the immediately produced name or create a customized one.
- For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
- For Initial circumstances count, get in the variety of instances (default: 1).
Selecting proper circumstances types and counts is essential for expense and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time inference is chosen by default. This is optimized for sustained traffic and low latency.
- Review all configurations for accuracy. For this design, we strongly advise adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
- Choose Deploy to release the model.
The deployment process can take a number of minutes to finish.
When implementation is complete, your endpoint status will change to InService. At this moment, the design is prepared to accept reasoning requests through the endpoint. You can keep track of the release development on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the implementation is complete, you can invoke the design utilizing a SageMaker runtime client and integrate it with your applications.
Deploy DeepSeek-R1 using the SageMaker Python SDK
To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the needed AWS consents and environment setup. The following is a detailed code example that demonstrates how to deploy and use DeepSeek-R1 for inference programmatically. The code for deploying the model is provided in the Github here. You can clone the notebook 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 produce a guardrail utilizing the Amazon Bedrock console or the API, and implement it as displayed in the following code:
Clean up
To prevent undesirable charges, complete the actions in this section to tidy up your resources.
Delete the Amazon Bedrock Marketplace implementation
If you deployed the design using Amazon Bedrock Marketplace, complete the following actions:
1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace implementations.
- In the Managed implementations area, find the endpoint you want to delete.
- Select the endpoint, and on the Actions menu, pick Delete.
- Verify the endpoint details to make certain you’re deleting the correct deployment: 1. Endpoint name.
- Model name.
- 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 erase the endpoint if you want 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 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 business build ingenious options utilizing AWS services and sped up compute. Currently, he is concentrated on establishing strategies for fine-tuning and optimizing the reasoning performance of big language designs. In his leisure time, Vivek enjoys hiking, enjoying films, and attempting different 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 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 partnerships for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI center. She is enthusiastic about constructing options that assist clients accelerate their AI journey and unlock business worth.