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, along with the distilled variations ranging from 1.5 to 70 billion criteria to construct, experiment, and responsibly scale your generative AI concepts on AWS.
In this post, we show how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled variations of the models too.
Overview of DeepSeek-R1
DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes reinforcement discovering to improve thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base structure. A key identifying feature is its support learning (RL) action, which was utilized to refine the model's actions beyond the basic pre-training and fine-tuning procedure. By integrating RL, DeepSeek-R1 can adjust more efficiently to user feedback and goals, eventually boosting both importance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, implying it's geared up to break down intricate inquiries and factor through them in a detailed manner. This directed thinking procedure permits the design to produce more precise, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured reactions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has captured the industry's attention as a flexible text-generation design that can be integrated into different workflows such as representatives, sensible reasoning and information interpretation tasks.
DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion parameters, allowing effective reasoning by routing questions to the most appropriate expert "clusters." This approach allows the model to focus on different issue domains while maintaining general performance. 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 circumstances to deploy the model. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.
DeepSeek-R1 distilled designs bring the reasoning abilities of the main R1 model to more effective architectures based upon popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller sized, more effective designs to mimic the habits and thinking patterns of the larger DeepSeek-R1 design, using 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 advise deploying this design with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous content, and assess designs against essential safety criteria. 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 numerous guardrails tailored to various usage cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls throughout your generative AI applications.
Prerequisites
To deploy the DeepSeek-R1 design, you require access to an ml.p5e instance. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and confirm you're using 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 ask for a limitation boost, create 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 proper AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For guidelines, see Set up consents to use guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to present safeguards, prevent hazardous material, and assess models against essential security requirements. You can carry out precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to examine user inputs and design actions deployed 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 basic flow involves the following steps: First, the system receives an input for the design. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent out to the design for inference. After receiving the model's output, another guardrail check is applied. If the output passes this final check, it's returned as the outcome. However, if either the input or output is intervened by the guardrail, a message is returned indicating the nature of the intervention and whether it occurred at the input or output stage. The examples showcased in the following sections show inference utilizing this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized structure models (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 composing 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 supplier and pick the DeepSeek-R1 design.
The model detail page supplies necessary details about the model's abilities, pricing structure, and application guidelines. You can discover detailed use directions, including sample API calls and code snippets for combination. The model supports numerous tasks, consisting of content production, code generation, and concern answering, using its reinforcement finding out optimization and CoT thinking capabilities.
The page likewise includes implementation choices and licensing details to help you begin with DeepSeek-R1 in your applications.
3. To start using DeepSeek-R1, pick Deploy.
You will be prompted to set up the deployment details for DeepSeek-R1. The design ID will be pre-populated.
4. For Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters).
5. For Number of instances, go into a variety of circumstances (in between 1-100).
6. For Instance type, pick your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised.
Optionally, you can configure advanced security and facilities settings, including virtual private cloud (VPC) networking, service function approvals, and encryption settings. For a lot of use cases, the default settings will work well. However, for production implementations, you might want to review these settings to align with your company's security and compliance requirements.
7. Choose Deploy to begin using the model.
When the implementation is complete, you can check DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground.
8. Choose Open in playground to access an interactive user interface where you can explore different prompts and change design specifications like temperature level and optimum length.
When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimal results. For instance, content for inference.
This is an outstanding way to explore the model's reasoning and text generation abilities before incorporating it into your applications. The play ground offers instant feedback, assisting you understand how the model reacts to various inputs and letting you tweak your triggers for optimum outcomes.
You can rapidly check the model in the playground through the UI. However, to invoke the released model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.
Run reasoning utilizing guardrails with the deployed DeepSeek-R1 endpoint
The following code example demonstrates how to carry out reasoning using 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 produce the guardrail, see the GitHub repo. After you have developed the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up inference parameters, and sends out a demand to produce text based upon a user prompt.
Deploy DeepSeek-R1 with SageMaker JumpStart
SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in algorithms, and prebuilt ML options that you can deploy with just 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 oeclub.org SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart provides 2 hassle-free techniques: using the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both techniques to help you pick the method that finest fits your requirements.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following actions to release DeepSeek-R1 utilizing SageMaker JumpStart:
1. On the SageMaker console, choose Studio in the navigation pane.
2. First-time users will be prompted to create a domain.
3. On the SageMaker Studio console, select JumpStart in the navigation pane.
The model browser shows available models, with details like the company name and model abilities.
4. Look for DeepSeek-R1 to see the DeepSeek-R1 design card.
Each design card reveals crucial details, including:
- Model name
- Provider name
- Task classification (for instance, Text Generation).
Bedrock Ready badge (if appropriate), showing that this design can be registered with Amazon Bedrock, permitting you to utilize Amazon Bedrock APIs to invoke the model
5. Choose the design card to view the model details page.
The model details page includes the following details:
- The design name and supplier details. Deploy button to release the design. About and Notebooks tabs with detailed details
The About tab includes essential details, such as:
- Model description. - License details.
- Technical specs.
- Usage standards
Before you release the design, it's advised to review the model details and license terms to validate compatibility with your use case.
6. Choose Deploy to continue with deployment.
7. For Endpoint name, utilize the automatically created name or produce a customized one.
- For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
- For Initial instance count, enter the variety of instances (default: 1). Selecting suitable instance types and counts is vital for expense and performance optimization. Monitor your release to change these settings as needed.Under Inference type, Real-time inference is chosen by default. This is enhanced for sustained traffic and low latency.
- Review all configurations for accuracy. For this model, we strongly advise sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
- Choose Deploy to release the model.
The release procedure can take several minutes to complete.
When deployment is total, your endpoint status will alter to InService. At this moment, the design is prepared to accept reasoning requests through the endpoint. You can keep an eye on the deployment progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the release is total, you can invoke the model utilizing a SageMaker runtime customer and incorporate it with your applications.
Deploy DeepSeek-R1 using the SageMaker Python SDK
To start with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the required AWS approvals 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 design is supplied in the Github here. You can clone the note pad and run 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 also 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:
Clean up
To prevent undesirable charges, complete the steps in this section to clean up your resources.
Delete the Amazon Bedrock Marketplace release
If you released the model utilizing Amazon Bedrock Marketplace, complete the following steps:
1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace releases. - In the Managed releases area, find the endpoint you want to erase.
- Select the endpoint, and on the Actions menu, select 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 design you deployed will sustain costs 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 checked out how you can access and deploy 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, refer to 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 companies construct innovative services using AWS services and sped up compute. Currently, he is concentrated on establishing strategies for fine-tuning and optimizing the inference performance of large language designs. In his leisure time, Vivek delights in treking, viewing films, and trying different 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 technology and Bioinformatics.
Jonathan Evans is a Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.
Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about constructing services that assist consumers accelerate their AI journey and unlock company worth.