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, in addition to the distilled variations ranging from 1.5 to 70 billion specifications to construct, 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 deploy the distilled versions of the designs also.
Overview of DeepSeek-R1
DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes reinforcement finding out to enhance thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. An essential distinguishing function is its reinforcement knowing (RL) action, which was used to fine-tune the model's responses beyond the basic pre-training and fine-tuning process. By incorporating RL, DeepSeek-R1 can adapt better to user feedback and objectives, ultimately enhancing both significance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, suggesting it's geared up to break down complex questions and reason through them in a detailed manner. This guided thinking procedure allows the model to produce more accurate, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to create structured actions while focusing on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has actually caught the industry's attention as a flexible text-generation model that can be incorporated into different workflows such as agents, rational reasoning and data interpretation 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 specifications, enabling efficient reasoning by routing inquiries to the most appropriate professional "clusters." This approach enables the design to focus on different problem domains while maintaining general efficiency. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge instance to deploy the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.
DeepSeek-R1 distilled designs bring the thinking abilities of the main R1 model to more efficient architectures based upon popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a process of training smaller sized, more effective models to mimic the behavior and thinking patterns of the bigger DeepSeek-R1 design, using it as a teacher design.
You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest releasing this model with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, avoid harmful material, and assess designs against essential safety criteria. At the time of composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce 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 release the DeepSeek-R1 model, you need access to an ml.p5e instance. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, select Amazon SageMaker, and validate you're utilizing 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 deploying. To ask for a limit increase, produce a limit increase request and connect to your account team.
Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the proper AWS Identity and Gain Access To Management (IAM) approvals to utilize Amazon Bedrock Guardrails. For directions, see Establish approvals to use guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to present safeguards, prevent damaging material, and evaluate models against essential safety criteria. You can execute precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to assess user inputs and design responses released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create 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 actions: 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 getting 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 stepped in by the guardrail, a message is returned showing the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following areas demonstrate inference using this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized structure models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following steps:
1. On the Amazon Bedrock console, pick Model brochure under Foundation designs in the navigation pane.
At the time of composing this post, you can utilize the InvokeModel API to conjure up 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 model.
The design detail page supplies vital details about the model's abilities, rates structure, and implementation guidelines. You can find detailed use instructions, including sample API calls and code snippets for combination. The design supports various text generation jobs, including content production, code generation, and question answering, utilizing its reinforcement finding out optimization and CoT thinking abilities.
The page likewise consists of implementation options and licensing details to assist you get going with DeepSeek-R1 in your applications.
3. To begin utilizing DeepSeek-R1, choose Deploy.
You will be prompted to set up the release details for DeepSeek-R1. The model ID will be pre-populated.
4. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters).
5. For Number of circumstances, get in a variety of instances (in between 1-100).
6. For example type, select your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised.
Optionally, you can configure innovative security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role consents, and encryption settings. For a lot of utilize cases, the default settings will work well. However, for production releases, you may desire to evaluate these settings to line up with your organization's security and compliance requirements.
7. Choose Deploy to start utilizing the design.
When the implementation is total, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock play area.
8. Choose Open in play ground to access an interactive user interface where you can explore various prompts and adjust model parameters like temperature and optimum length.
When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for ideal outcomes. For instance, content for reasoning.
This is an outstanding method to check out the design's thinking and text generation capabilities before integrating it into your applications. The playground supplies instant feedback, helping you comprehend how the design reacts to numerous inputs and letting you tweak your triggers for ideal results.
You can rapidly check the model in the play area through the UI. However, to conjure up the deployed design 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 carry out inference using a deployed DeepSeek-R1 model 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 produced the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime customer, sets up reasoning criteria, and sends out a request to generate text based upon 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 solutions that you can deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your data, and deploy them into production using either the UI or SDK.
Deploying DeepSeek-R1 design through uses 2 convenient methods: utilizing the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both methods to assist you select the approach that best matches 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, pick Studio in the navigation pane.
2. First-time users will be prompted to develop a domain.
3. On the SageMaker Studio console, pick JumpStart in the navigation pane.
The model internet browser displays available designs, with details like the company name and model capabilities.
4. Search for DeepSeek-R1 to see the DeepSeek-R1 model card.
Each model card shows key details, consisting of:
- Model name
- Provider name
- Task classification (for example, Text Generation).
Bedrock Ready badge (if applicable), indicating that this model can be signed up with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to invoke the design
5. Choose the model card to view the model details page.
The model details page includes the following details:
- The model name and service provider details. Deploy button to deploy the model. About and Notebooks tabs with detailed details
The About tab consists of crucial details, such as:
- Model description. - License details.
- Technical specifications.
- Usage guidelines
Before you deploy the design, it's advised to evaluate the model details and license terms to confirm compatibility with your use case.
6. Choose Deploy to continue with implementation.
7. For Endpoint name, use the instantly created name or produce a custom one.
- For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
- For Initial circumstances count, enter the variety of instances (default: 1). Selecting suitable circumstances types and counts is vital for cost and performance optimization. Monitor your release 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 model, we highly suggest adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
- Choose Deploy to deploy the model.
The implementation procedure can take several minutes to finish.
When release is total, your endpoint status will change to InService. At this moment, the model is ready to accept inference requests through the endpoint. You can keep an eye on the implementation development on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the release is total, you can conjure up the design utilizing a SageMaker runtime customer and integrate it with your applications.
Deploy DeepSeek-R1 utilizing the SageMaker Python SDK
To begin with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the needed AWS consents and environment setup. The following is a detailed code example that demonstrates how to release and utilize DeepSeek-R1 for inference programmatically. The code for releasing the design is supplied in the Github here. You can clone the note pad and range 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 also utilize 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 displayed in the following code:
Clean up
To prevent unwanted charges, finish 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, total the following steps:
1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace implementations. - In the Managed releases area, locate the endpoint you desire to delete.
- Select the endpoint, and on the Actions menu, choose 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 expenses if you leave it running. Use the following code to erase the endpoint if you wish 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 model 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 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 forum.altaycoins.com Inference at AWS. He assists emerging generative AI companies develop innovative solutions using AWS services and accelerated compute. Currently, he is concentrated on establishing strategies for fine-tuning and optimizing the inference efficiency of large language models. In his free time, Vivek enjoys treking, viewing 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 technology and Bioinformatics.
Jonathan Evans is a Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.
Banu Nagasundaram leads product, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about developing options that help customers accelerate their AI journey and unlock service worth.