Today, we are thrilled to announce 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 varying from 1.5 to 70 billion criteria to develop, experiment, and responsibly 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 deploy the distilled versions of the models also.
Overview of DeepSeek-R1
DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that utilizes reinforcement discovering to boost thinking abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. An essential differentiating feature is its reinforcement knowing (RL) step, which was utilized to fine-tune the model's responses beyond the basic pre-training and tweak process. By including RL, DeepSeek-R1 can adjust more successfully to user feedback and objectives, eventually enhancing both relevance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, suggesting it's geared up to break down complex queries and factor through them in a detailed way. This guided thinking process allows the design to produce more accurate, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to generate structured responses while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has captured the market's attention as a flexible text-generation design that can be integrated into different workflows such as agents, logical reasoning and data analysis tasks.
DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture allows activation of 37 billion criteria, making it possible for effective inference by routing queries to the most relevant professional "clusters." This approach enables the design to focus on different issue domains while maintaining overall effectiveness. DeepSeek-R1 requires a minimum of 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 design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.
DeepSeek-R1 distilled designs bring the reasoning capabilities of the main R1 model to more effective architectures based on popular open models like Qwen (1.5 B, 7B, pediascape.science 14B, and forum.pinoo.com.tr 32B) and Llama (8B and 70B). Distillation describes a process of training smaller sized, more effective models to mimic the behavior and reasoning patterns of the larger DeepSeek-R1 model, utilizing it as an instructor design.
You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we recommend releasing this design with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous material, and examine designs against key safety requirements. At the time of writing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop several guardrails tailored to various use cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls across your generative AI applications.
Prerequisites
To release the DeepSeek-R1 design, you need access to an ml.p5e instance. To inspect if you have quotas for P5e, open the Service Quotas and under AWS Services, pick Amazon SageMaker, and verify 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 ask for a limit 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 right AWS Identity and Gain Access To Management (IAM) permissions to utilize Amazon Bedrock Guardrails. For guidelines, see Set up approvals to utilize guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to introduce safeguards, avoid hazardous content, and examine designs against essential safety requirements. You can execute security measures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to examine user inputs and model actions 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 develop the guardrail, see the GitHub repo.
The general circulation includes the following steps: First, the system gets an input for the design. 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 design'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 stepped in by the guardrail, a message is returned indicating the nature of the intervention and whether it took place at the input or output stage. The examples showcased in the following sections show reasoning utilizing this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace provides 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 catalog under Foundation designs in the navigation pane.
At the time of writing this post, you can use the InvokeModel API to invoke the model. It does not support Converse APIs and other Amazon Bedrock tooling.
2. Filter for DeepSeek as a company and choose the DeepSeek-R1 design.
The design detail page provides necessary details about the model's capabilities, rates structure, and application standards. You can discover detailed use directions, including sample API calls and code snippets for combination. The model supports different text generation jobs, including content creation, code generation, and question answering, using its support discovering optimization and CoT reasoning abilities.
The page also consists of deployment alternatives and licensing details to help you get going with DeepSeek-R1 in your applications.
3. To start using DeepSeek-R1, pick Deploy.
You will be prompted to set up the release details for DeepSeek-R1. The design ID will be pre-populated.
4. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters).
5. For Number of circumstances, go into a variety of circumstances (between 1-100).
6. For Instance type, pick your instance type. For ideal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised.
Optionally, you can set up advanced security and facilities settings, including virtual personal cloud (VPC) networking, service role permissions, and file encryption settings. For most use cases, the default settings will work well. However, for production releases, you may desire to examine these settings to line up with your organization's security and compliance requirements.
7. Choose Deploy to start utilizing the model.
When the deployment is total, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock playground.
8. Choose Open in playground to access an interactive interface where you can explore various triggers and adjust design specifications like temperature and maximum length.
When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimal outcomes. For example, content for reasoning.
This is an outstanding method to check out the model's thinking and text generation capabilities before integrating it into your applications. The play ground offers instant feedback, assisting you comprehend how the design reacts to various inputs and letting you tweak your prompts for ideal results.
You can quickly check the design in the play ground through the UI. However, to invoke the released design 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 shows how to perform reasoning using a deployed DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can produce 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 actually produced the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up inference specifications, 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) center with FMs, built-in algorithms, and prebuilt ML services that you can deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your data, and release them into production utilizing either the UI or SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart provides two hassle-free methods: using the instinctive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both methods to assist you choose the approach that finest 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.
2. First-time users will be triggered to produce a domain.
3. 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 model abilities.
4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card.
Each design card shows key details, including:
- Model name
- Provider name
- Task classification (for instance, Text Generation).
Bedrock Ready badge (if applicable), indicating that this design can be registered with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to invoke the model
5. Choose the design card to view the model details page.
The design details page consists of the following details:
- The model name and supplier details. Deploy button to deploy the design. About and Notebooks tabs with detailed details
The About tab includes important details, such as:
- Model description. - License details. - Technical specifications.
- Usage standards
Before you deploy the model, it's suggested to evaluate the model details and license terms to validate compatibility with your use case.
6. Choose Deploy to continue with implementation.
7. For Endpoint name, use the automatically generated name or develop a custom-made one.
- For example type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
- For Initial circumstances count, get in the number of circumstances (default: 1). Selecting suitable circumstances types and counts is essential for expense and performance optimization. Monitor your release 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 precision. For this design, we highly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
- Choose Deploy to release the design.
The deployment process can take several minutes to complete.
When release is complete, your endpoint status will change to InService. At this moment, the model is all set to accept reasoning demands through the endpoint. You can keep track of the implementation development on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the implementation is total, you can invoke the design using a SageMaker runtime client and integrate it with your applications.
Deploy DeepSeek-R1 utilizing the SageMaker Python SDK
To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the necessary AWS permissions and environment setup. The following is a detailed code example that shows how to deploy and use DeepSeek-R1 for inference programmatically. The code for releasing the design is provided in the Github here. You can clone the note pad 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 also use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail utilizing the Amazon Bedrock console or the API, and execute it as displayed in the following code:
Clean up
To prevent undesirable charges, complete the actions in this area to tidy up your resources.
Delete the Amazon Bedrock Marketplace implementation
If you released the model utilizing Amazon Bedrock Marketplace, total the following actions:
1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace deployments. - In the Managed releases area, locate the endpoint you wish to erase.
- Select the endpoint, and on the Actions menu, select Delete.
- Verify the endpoint details to make certain you're deleting the appropriate deployment: 1. Endpoint name.
- Model name.
- Endpoint status
Delete the SageMaker JumpStart predictor
The SageMaker JumpStart design you released will sustain costs if you leave it running. Use the following code to delete 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 using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. For more details, refer to 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 helps emerging generative AI companies develop ingenious solutions using AWS services and sped up calculate. Currently, he is concentrated on establishing strategies for fine-tuning and optimizing the reasoning efficiency of large language models. In his spare time, Vivek enjoys hiking, watching movies, and trying various 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 Science and Bioinformatics.
Jonathan Evans is a Specialist Solutions Architect working on generative AI with the Third-Party Model Science team at AWS.
Banu Nagasundaram leads product, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and wavedream.wiki generative AI center. She is passionate about building solutions that help customers accelerate their AI journey and unlock business value.