Today, we are delighted 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 release DeepSeek AI’s first-generation frontier design, DeepSeek-R1, in addition to the distilled variations ranging from 1.5 to 70 billion criteria to develop, experiment, and properly scale your generative AI concepts on AWS.
In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to release the distilled versions of the designs as well.
Overview of DeepSeek-R1
DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that uses support finding out to boost thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial identifying function is its support learning (RL) step, which was utilized to improve the model’s reactions beyond the standard pre-training and tweak procedure. By incorporating RL, DeepSeek-R1 can adjust more successfully to user feedback and goals, eventually boosting both relevance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, indicating it’s geared up to break down complex questions and factor through them in a detailed manner. This guided thinking process enables the design to produce more precise, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT abilities, aiming to create structured reactions while focusing on interpretability and user interaction. With its DeepSeek-R1 has actually caught the market’s attention as a flexible text-generation model that can be integrated into different workflows such as representatives, sensible reasoning and data analysis tasks.
DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, making it possible for effective reasoning by routing questions to the most pertinent specialist “clusters.” This method enables the model to concentrate on different problem domains while maintaining total efficiency. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for reasoning. 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 designs bring the reasoning capabilities of the main R1 model to more efficient architectures based upon 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, more efficient models to mimic the habits and thinking patterns of the bigger DeepSeek-R1 design, using it as a teacher model.
You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest deploying this model with guardrails in place. In this blog, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent damaging material, and assess designs against crucial safety requirements. At the time of writing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop multiple guardrails tailored to various usage cases and apply 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 need 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 verify you’re utilizing ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are releasing. To request a limitation increase, surgiteams.com develop a limitation increase request and connect to your account group.
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) consents to utilize Amazon Bedrock Guardrails. For instructions, see Set up authorizations to use guardrails for content filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to present safeguards, avoid hazardous content, and evaluate models against essential safety requirements. You can carry out safety steps for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine 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 produce the guardrail, see the GitHub repo.
The general flow includes 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 to the design for inference. After getting the model’s output, another guardrail check is used. If the output passes this last check, it’s returned as the final result. However, if either the input or output is intervened by the guardrail, a message is returned showing the nature of the intervention and whether it took place at the input or output stage. The examples showcased in the following sections demonstrate 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, pick Model brochure under Foundation designs in the navigation pane.
At the time of writing this post, you can utilize 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 select the DeepSeek-R1 model.
The design detail page supplies essential details about the design’s abilities, prices structure, and implementation standards. You can find detailed usage directions, including sample API calls and code snippets for integration. The model supports various text generation jobs, including material creation, yewiki.org code generation, and question answering, using its support learning optimization and CoT thinking capabilities.
The page also includes release choices and licensing details to assist you get started with DeepSeek-R1 in your applications.
- To start utilizing DeepSeek-R1, select Deploy.
You will be triggered 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 number of instances (in between 1-100).
- For Instance type, select your circumstances type. For optimum performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested.
Optionally, you can set up innovative security and facilities settings, including virtual personal cloud (VPC) networking, service role approvals, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production releases, you may desire to review these settings to line up with your company’s security and compliance requirements.
- Choose Deploy to begin utilizing the design.
When the deployment is total, you can evaluate DeepSeek-R1’s capabilities straight in the Amazon Bedrock playground.
- Choose Open in playground to access an interactive interface where you can explore various triggers and change model parameters like temperature and optimum length.
When using R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat design template for optimum results. For example, material for reasoning.
This is an excellent way to check out the design’s thinking and text generation abilities before incorporating it into your applications. The play ground offers instant feedback, helping you comprehend how the design reacts to different inputs and letting you fine-tune your triggers for ideal outcomes.
You can rapidly check the model in the play area through the UI. However, to conjure up the deployed model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.
Run reasoning using guardrails with the deployed DeepSeek-R1 endpoint
The following code example demonstrates how to carry out inference using a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can produce a guardrail utilizing 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 execute guardrails. The script initializes the bedrock_runtime customer, sets up inference specifications, and sends a request to produce 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 solutions that you can release with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, and deploy them into production utilizing either the UI or SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 hassle-free methods: using the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s check out both techniques to help you pick the technique that best fits your needs.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following steps to release DeepSeek-R1 using SageMaker JumpStart:
1. On the SageMaker console, choose Studio in the navigation pane.
- First-time users will be prompted to create a domain.
- On the SageMaker Studio console, select JumpStart in the navigation pane.
The model browser displays available designs, with details like the provider name and design capabilities.
4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card.
Each design card reveals crucial details, consisting of:
- Model name
- Provider name
- Task category (for instance, Text Generation).
Bedrock Ready badge (if appropriate), indicating that this model can be registered with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to invoke the design
5. Choose the model card to see the design details page.
The design details page includes the following details:
- The model name and supplier details.
Deploy button to release the design.
About and Notebooks tabs with detailed details
The About tab includes crucial details, such as:
- Model description.
- License details.
- Technical requirements.
- Usage guidelines
Before you deploy the design, it’s suggested to examine the model details and license terms to verify compatibility with your use case.
6. Choose Deploy to continue with implementation.
7. For Endpoint name, use the instantly produced name or create a custom-made one.
- For example type ¸ pick an instance type (default: ml.p5e.48 xlarge).
- For Initial instance count, get in the variety of instances (default: 1).
Selecting proper circumstances types and counts is essential for cost and performance optimization. Monitor your deployment to adjust these settings as needed.Under Inference type, Real-time inference is picked by default. This is optimized for sustained traffic and low latency.
- Review all setups for precision. For this design, we highly advise adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
- Choose Deploy to deploy the design.
The release procedure can take numerous minutes to complete.
When implementation is total, your endpoint status will alter to InService. At this point, the design is prepared to accept inference demands through the endpoint. You can keep track of the implementation progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the release is complete, you can conjure up the design using a SageMaker runtime client and integrate it with your applications.
Deploy DeepSeek-R1 using the SageMaker Python SDK
To begin 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 approvals and environment setup. The following is a detailed code example that shows how to deploy and utilize DeepSeek-R1 for reasoning programmatically. The code for releasing the model is supplied in the Github here. You can clone the note pad and range from SageMaker Studio.
You can run additional requests against the predictor:
Implement guardrails and run reasoning with your SageMaker JumpStart predictor
Similar to Amazon Bedrock, you can likewise use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail utilizing the Amazon Bedrock console or the API, and implement it as revealed in the following code:
Tidy up
To avoid undesirable charges, complete the actions in this section to clean up your resources.
Delete the Amazon Bedrock Marketplace release
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, pick Marketplace implementations.
- In the Managed deployments section, find the endpoint you want to erase.
- Select the endpoint, and on the Actions menu, choose Delete.
- Verify the endpoint details to make certain you’re deleting the proper release: 1. Endpoint name.
- Model name.
- Endpoint status
Delete the SageMaker JumpStart predictor
The SageMaker JumpStart model you released 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 design using 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 designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting begun 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 solutions utilizing AWS services and accelerated compute. Currently, he is concentrated on developing strategies for fine-tuning and enhancing the reasoning performance of large language models. In his complimentary time, Vivek delights in treking, seeing motion pictures, and trying 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 Specialist Solutions Architect working on generative AI with the Third-Party Model Science group at AWS.
Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is passionate about developing services that assist customers accelerate their AI journey and unlock service worth.