DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
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 varying from 1.5 to 70 billion specifications to construct, experiment, and responsibly scale your generative AI ideas on AWS.
In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable steps to release the distilled versions of the models as well.
Overview of DeepSeek-R1
DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that uses support finding out to boost thinking abilities through a multi-stage training process from a DeepSeek-V3-Base structure. An essential identifying feature is its support knowing (RL) step, which was used to refine the model's responses beyond the standard pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adjust more efficiently to user feedback and goals, eventually boosting both significance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, meaning it's equipped to break down intricate inquiries and reason through them in a detailed manner. This directed reasoning process permits the model to produce more accurate, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT capabilities, aiming to generate structured actions while focusing on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has actually recorded the industry's attention as a versatile text-generation design that can be incorporated into different workflows such as agents, rational reasoning and information interpretation jobs.
DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion parameters, allowing effective inference by routing questions to the most relevant professional "clusters." This approach allows the design to specialize in different problem domains while maintaining overall effectiveness. 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 deploy 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 upon popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a procedure of training smaller, more efficient designs to mimic the behavior and thinking patterns of the bigger DeepSeek-R1 design, using it as a teacher design.
You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest deploying this model with guardrails in place. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, prevent hazardous content, and evaluate designs against key safety requirements. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce multiple guardrails tailored to different use cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing security controls across 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, select Amazon SageMaker, and validate 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 releasing. To request a limitation boost, create a limitation boost request and reach out to your account team.
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) consents to use Amazon Bedrock Guardrails. For instructions, see Set up permissions to use guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails permits you to present safeguards, avoid damaging material, and examine designs against crucial security criteria. You can implement precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to evaluate user inputs and model reactions 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 produce the guardrail, see the GitHub repo.
The general circulation involves the following actions: First, the system receives an input for the design. This input is then processed through the . 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 used. If the output passes this final check, it's returned as the outcome. 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 happened at the input or output stage. The examples showcased in the following sections show reasoning using 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 steps:
1. On the Amazon Bedrock console, choose Model brochure under Foundation designs in the navigation pane.
At the time of composing this post, you can utilize the InvokeModel API to invoke the design. It doesn't support Converse APIs and other Amazon Bedrock tooling.
2. Filter for DeepSeek as a company and pick the DeepSeek-R1 model.
The design detail page provides necessary details about the design's capabilities, pricing structure, and implementation standards. You can discover detailed use guidelines, including sample API calls and code snippets for combination. The model supports numerous text generation jobs, including material production, code generation, and question answering, utilizing its support learning optimization and CoT thinking abilities.
The page also consists of implementation alternatives and licensing details to assist you get begun with DeepSeek-R1 in your applications.
3. To start utilizing DeepSeek-R1, pick 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, go into an endpoint name (between 1-50 alphanumeric characters).
5. For Number of circumstances, get in a number of instances (in 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 configure advanced security and facilities settings, including virtual personal cloud (VPC) networking, service function consents, and file encryption settings. For a lot of utilize cases, the default settings will work well. However, for production implementations, you might wish to evaluate these settings to line up with your company's security and compliance requirements.
7. Choose Deploy to begin utilizing the design.
When the deployment is complete, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock play ground.
8. Choose Open in playground to access an interactive interface where you can experiment with various triggers and adjust design specifications like temperature and maximum length.
When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimum results. For example, material for inference.
This is an excellent method to explore the model's thinking and text generation capabilities before integrating it into your applications. The play area provides immediate feedback, assisting you comprehend how the design responds to different inputs and letting you fine-tune your triggers for optimum results.
You can rapidly check the model in the play ground through the UI. However, to invoke the deployed model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.
Run inference utilizing guardrails with the released DeepSeek-R1 endpoint
The following code example shows how to perform reasoning utilizing a released 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 develop the guardrail, see the GitHub repo. After you have created the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime customer, configures inference criteria, and sends out a request to create text based on a user timely.
Deploy DeepSeek-R1 with SageMaker JumpStart
SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML services that you can deploy with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your data, and deploy them into production utilizing either the UI or SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart provides two practical techniques: utilizing the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's check out both methods to help you select the technique that finest fits your requirements.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following steps to release DeepSeek-R1 using SageMaker JumpStart:
1. On the SageMaker console, select Studio in the navigation pane.
2. First-time users will be triggered to develop a domain.
3. On the SageMaker Studio console, select JumpStart in the navigation pane.
The design internet browser shows available designs, with details like the company name and design capabilities.
4. Look for DeepSeek-R1 to see the DeepSeek-R1 design card.
Each design card reveals essential details, including:
- Model name
- Provider name
- Task category (for instance, Text Generation).
Bedrock Ready badge (if relevant), showing that this design can be registered with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to invoke the model
5. Choose the model card to view the design details page.
The design details page includes the following details:
- The design name and supplier details. Deploy button to deploy the design. About and Notebooks tabs with detailed details
The About tab includes crucial details, such as:
- Model description. - License details.
- Technical specifications.
- Usage standards
Before you deploy the model, it's recommended to examine the model details and license terms to confirm compatibility with your use case.
6. Choose Deploy to proceed with implementation.
7. For Endpoint name, utilize the automatically created name or create a custom one.
- For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
- For Initial circumstances count, go into the variety of circumstances (default: 1). Selecting proper circumstances types and counts is crucial for expense and efficiency optimization. Monitor your deployment to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is enhanced for sustained traffic and low latency.
- Review all setups for accuracy. For this model, we highly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
- Choose Deploy to deploy the design.
The deployment process can take numerous minutes to complete.
When deployment is complete, your endpoint status will change to InService. At this point, the design is prepared to accept inference 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 implementation is total, you can invoke the design utilizing a SageMaker runtime customer 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 need 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 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 extra requests 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 using the Amazon Bedrock console or the API, and implement it as revealed in the following code:
Tidy up
To avoid unwanted charges, complete the steps in this area to clean up your resources.
Delete the Amazon Bedrock Marketplace implementation
If you deployed the design utilizing Amazon Bedrock Marketplace, total the following steps:
1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace deployments. - In the Managed releases area, locate the endpoint you desire to erase.
- Select the endpoint, and on the Actions menu, choose Delete.
- Verify the endpoint details to make certain you're erasing the proper deployment: 1. Endpoint name.
- Model name.
- Endpoint status
Delete the SageMaker JumpStart predictor
The SageMaker JumpStart model you deployed will sustain costs if you leave it running. Use the following code to erase 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 get begun. 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 Beginning 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 construct innovative options using AWS services and sped up compute. Currently, he is focused on establishing strategies for pipewiki.org fine-tuning and optimizing the reasoning performance of big language designs. In his complimentary time, Vivek enjoys hiking, viewing motion pictures, and trying various foods.
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 Science and Bioinformatics.
Jonathan Evans is a Professional 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 enthusiastic about developing options that assist clients accelerate their AI journey and unlock service value.