DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Today, we are delighted 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 release DeepSeek AI's first-generation frontier model, DeepSeek-R1, together with the distilled variations ranging from 1.5 to 70 billion specifications to build, experiment, and responsibly scale your generative AI concepts on AWS.
In this post, we show how to get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to release the distilled versions of the designs also.
Overview of DeepSeek-R1
DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that utilizes support discovering to enhance reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial differentiating function is its reinforcement knowing (RL) action, which was utilized to refine the design's responses beyond the basic pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adapt more successfully to user feedback and objectives, ultimately enhancing both relevance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, meaning it's equipped to break down complicated inquiries and reason through them in a detailed manner. This directed reasoning procedure permits the model to produce more precise, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT abilities, aiming to generate structured responses while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has caught the market's attention as a flexible text-generation model that can be integrated into various workflows such as agents, logical thinking and information analysis jobs.
DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, enabling effective inference by routing queries to the most appropriate expert "clusters." This approach enables the model to focus on different problem domains while maintaining total effectiveness. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge instance to release the model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.
DeepSeek-R1 distilled designs bring the thinking capabilities 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 refers to a process of training smaller, more efficient models to mimic the habits and thinking patterns of the bigger DeepSeek-R1 model, utilizing it as a teacher design.
You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise deploying this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, prevent harmful content, and examine designs against crucial security requirements. At the time of writing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop several guardrails tailored to various usage cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing security controls throughout your generative AI applications.
Prerequisites
To deploy the DeepSeek-R1 model, you need access to an ml.p5e instance. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and confirm 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 limit boost, produce a limitation boost demand and connect to your account team.
Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the proper AWS Identity and Gain Access To Management (IAM) permissions to utilize Amazon Bedrock Guardrails. For directions, see Establish authorizations to utilize guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to present safeguards, avoid hazardous content, and examine designs against key safety requirements. You can execute safety measures for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to assess user inputs and model actions 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 develop the guardrail, see the GitHub repo.
The general flow involves 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 reasoning. After receiving the model'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 suggesting the nature of the intervention and whether it happened at the input or output stage. The examples showcased in the following areas show reasoning utilizing this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following actions:
1. On the Amazon Bedrock console, select Model brochure under Foundation designs in the navigation pane.
At the time of writing this post, you can use the InvokeModel API to invoke the design. It doesn't support Converse APIs and other Amazon Bedrock tooling.
2. Filter for DeepSeek as a service provider and select the DeepSeek-R1 design.
The model detail page provides essential details about the model's capabilities, pricing structure, and application standards. You can discover detailed usage guidelines, including sample API calls and code snippets for integration. The model supports numerous text generation tasks, including content creation, code generation, and question answering, using its support finding out optimization and CoT reasoning abilities.
The page also consists of release choices and licensing details to help you get going with DeepSeek-R1 in your applications.
3. To begin using DeepSeek-R1, pick Deploy.
You will be prompted to set up the implementation details for DeepSeek-R1. The design ID will be pre-populated.
4. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters).
5. For Number of circumstances, enter a number of circumstances (between 1-100).
6. For example type, pick your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested.
Optionally, you can set up advanced security and facilities settings, including virtual private cloud (VPC) networking, service function authorizations, and encryption settings. For a lot of use cases, the default settings will work well. However, for production deployments, you might wish to evaluate these settings to line up with your company's security and compliance requirements.
7. Choose Deploy to begin using the design.
When the deployment is complete, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock play area.
8. Choose Open in playground to access an interactive interface where you can try out various prompts and adjust model specifications like temperature level and maximum length.
When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimal results. For instance, content for reasoning.
This is an outstanding method to check out the model's thinking and text generation abilities before incorporating it into your applications. The play ground provides instant feedback, helping you understand how the model reacts to various inputs and letting you fine-tune your triggers for ideal outcomes.
You can quickly check the design in the play area through the UI. However, to invoke the released model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.
Run reasoning using guardrails with the deployed DeepSeek-R1 endpoint
The following code example demonstrates how to perform inference utilizing a released DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. 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. After you have actually developed the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, configures inference specifications, and sends out a request to produce text based upon 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 deploy with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and deploy them into production using either the UI or SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 convenient approaches: utilizing the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both approaches to help you select the approach that best fits your requirements.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following steps to deploy DeepSeek-R1 using SageMaker JumpStart:
1. On the SageMaker console, select Studio in the navigation pane.
2. First-time users will be prompted to produce a domain.
3. On the SageMaker Studio console, pick JumpStart in the navigation pane.
The design web browser shows available models, with details like the provider name and model abilities.
4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card.
Each model card reveals essential details, consisting of:
- Model name
- Provider name
- Task classification (for example, Text Generation).
Bedrock Ready badge (if relevant), suggesting that this model can be registered with Amazon Bedrock, allowing you to utilize Amazon Bedrock APIs to invoke the design
5. Choose the design card to see the model details page.
The model details page includes the following details:
- The model name and company details. Deploy button to deploy the model. 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 advised to evaluate the design details and license terms to confirm compatibility with your use case.
6. Choose Deploy to continue with release.
7. For Endpoint name, utilize the immediately generated name or develop a custom-made one.
- For Instance type ¸ choose an instance type (default: ml.p5e.48 xlarge).
- For Initial circumstances count, go into the number of circumstances (default: 1). Selecting proper instance types and counts is important for expense and efficiency optimization. Monitor your implementation to change these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is enhanced for sustained traffic and low latency.
- Review all setups for precision. For this design, we strongly advise sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
- Choose Deploy to deploy the design.
The deployment procedure can take a number of minutes to finish.
When deployment is complete, your endpoint status will alter to InService. At this point, the design is prepared to accept inference demands through the endpoint. You can monitor setiathome.berkeley.edu the deployment progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the release is total, you can conjure up the design using a SageMaker runtime customer and integrate it with your applications.
Deploy DeepSeek-R1 utilizing the SageMaker Python SDK
To get begun with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the essential AWS approvals 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 deploying the design is provided in the Github here. You can clone the note pad and run from SageMaker Studio.
You can run additional demands against the predictor:
Implement guardrails and run inference with your SageMaker JumpStart predictor
Similar to Amazon Bedrock, you can likewise use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail using the Amazon Bedrock console or the API, and execute it as displayed in the following code:
Tidy up
To avoid undesirable charges, finish the actions in this area to tidy up your resources.
Delete the Amazon Bedrock Marketplace release
If you released the design utilizing Amazon Bedrock Marketplace, complete the following steps:
1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace implementations. - In the Managed deployments area, locate 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 erasing the right implementation: 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 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 release the DeepSeek-R1 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, refer to Use Amazon Bedrock tooling with JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting going with Amazon SageMaker JumpStart.
About the Authors
Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI business build innovative services using AWS services and sped up calculate. Currently, he is focused on establishing methods for fine-tuning and optimizing the reasoning efficiency of large language designs. In his downtime, Vivek enjoys hiking, seeing motion pictures, and attempting various cuisines.
Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group at AWS. His area 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 dealing with generative AI with the Third-Party Model Science team at AWS.
Banu Nagasundaram leads product, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about building options that help customers accelerate their AI journey and unlock business worth.