DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Today, we are thrilled to announce that DeepSeek R1 distilled Llama and Qwen designs 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, together with the distilled versions ranging from 1.5 to 70 billion specifications to construct, experiment, and responsibly scale your generative AI concepts on AWS.
In this post, we demonstrate how to get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to deploy the distilled variations of the designs as well.
Overview of DeepSeek-R1
DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that utilizes reinforcement finding out to boost thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base structure. A key identifying function is its support learning (RL) step, which was used to improve the model's responses beyond the standard pre-training and tweak procedure. By incorporating RL, DeepSeek-R1 can adapt more efficiently to user feedback and goals, eventually enhancing both significance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, meaning it's geared up to break down complicated questions and factor through them in a detailed way. This guided reasoning procedure allows the model to produce more precise, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT abilities, aiming to create structured actions while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has captured the industry's attention as a versatile text-generation model that can be incorporated into various workflows such as agents, rational reasoning and information analysis jobs.
DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion criteria, making it possible for efficient inference by routing inquiries to the most relevant specialist "clusters." This method allows the design to focus on various issue domains while maintaining total performance. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for inference. In this post, we will use an ml.p5e.48 xlarge circumstances to deploy the model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.
DeepSeek-R1 distilled designs bring the reasoning abilities of the main R1 design to more efficient architectures based on popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller sized, more efficient models to simulate the behavior and thinking patterns of the bigger DeepSeek-R1 model, utilizing it as a teacher model.
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 material, and assess models against key safety criteria. At the time of writing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce numerous guardrails tailored to various usage cases and apply them to the DeepSeek-R1 model, 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 circumstances. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and verify you're utilizing ml.p5e.48 xlarge for endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are deploying. To request a limit boost, develop a limit boost demand and reach out to your account group.
Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For directions, see Set up permissions to use guardrails for content filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to introduce safeguards, prevent hazardous content, and evaluate designs against key safety requirements. You can execute safety measures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and model 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 create the guardrail, see the GitHub repo.
The general flow involves the following actions: First, the system receives an input for the model. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent out to the model for inference. After receiving the model's output, another guardrail check is used. If the output passes this final check, it's returned as the last 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 areas show inference using 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 catalog under Foundation designs in the navigation pane.
At the time of writing this post, you can utilize the InvokeModel API to invoke the design. It does not 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 offers essential details about the model's capabilities, pricing structure, and implementation standards. You can discover detailed use directions, including sample API calls and code snippets for integration. The design supports various text generation tasks, including content creation, code generation, and concern answering, using its support learning optimization and CoT reasoning abilities.
The page also includes release choices and licensing details to assist you get begun with DeepSeek-R1 in your applications.
3. To start using DeepSeek-R1, choose Deploy.
You will be triggered to configure the implementation 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 circumstances, enter a variety of instances (in between 1-100).
6. For Instance type, choose your instance type. For optimum performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended.
Optionally, you can set up sophisticated security and facilities settings, including virtual private cloud (VPC) networking, service role approvals, and encryption settings. For most use cases, the default settings will work well. However, for production implementations, you may desire to review these settings to align with your company's security and compliance requirements.
7. Choose Deploy to start utilizing the model.
When the release is total, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock playground.
8. Choose Open in play ground to access an interactive interface where you can try out various prompts and change model specifications like temperature level and optimum length.
When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimal results. For instance, content for reasoning.
This is an outstanding way to check out the design's thinking and text generation capabilities before incorporating it into your applications. The playground supplies instant feedback, assisting you comprehend how the design reacts to different inputs and letting you tweak your prompts for optimal outcomes.
You can quickly evaluate the model in the play area through the UI. However, to invoke the deployed design programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.
Run reasoning using guardrails with the released DeepSeek-R1 endpoint
The following code example demonstrates how to carry out inference utilizing a released DeepSeek-R1 design through Amazon Bedrock utilizing 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 created the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures reasoning parameters, and sends out a request to create text based on a user prompt.
Deploy DeepSeek-R1 with SageMaker JumpStart
SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML options that you can deploy with just a few 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 design through SageMaker JumpStart provides 2 practical techniques: using the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both methods to help you choose the approach that best fits your needs.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following actions to release DeepSeek-R1 using SageMaker JumpStart:
1. On the SageMaker console, pick Studio in the navigation pane.
2. First-time users will be triggered to produce a domain.
3. On the SageMaker Studio console, choose JumpStart in the navigation pane.
The model internet browser displays available models, with details like the company name and model capabilities.
4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card.
Each model card reveals crucial details, including:
- Model name
- Provider name
- Task classification (for instance, Text Generation).
Bedrock Ready badge (if applicable), suggesting that this model can be signed up with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to invoke the model
5. Choose the design card to see the design details page.
The design details page includes 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 crucial details, such as:
- Model description. - License details.
- Technical specifications.
- Usage guidelines
Before you deploy the model, it's recommended to examine the design details and license terms to validate compatibility with your use case.
6. Choose Deploy to continue with deployment.
7. For Endpoint name, utilize the instantly created name or produce a customized one.
- For example type ¸ choose an instance type (default: ml.p5e.48 xlarge).
- For Initial instance count, go into the variety of circumstances (default: 1). Selecting suitable circumstances types and counts is essential for expense and performance optimization. Monitor your implementation to change 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 sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
- Choose Deploy to release the model.
The deployment process can take numerous minutes to complete.
When implementation is complete, your endpoint status will change to InService. At this moment, engel-und-waisen.de the design is prepared to accept inference through the endpoint. You can keep track of the implementation progress on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the deployment is complete, you can conjure up the design using a SageMaker runtime client and incorporate it with your applications.
Deploy DeepSeek-R1 using the SageMaker Python SDK
To get begun 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 permissions 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 deploying the model is supplied 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 reasoning with your SageMaker JumpStart predictor
Similar to Amazon Bedrock, you can also 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 prevent undesirable charges, finish the actions in this section to tidy up your resources.
Delete the Amazon Bedrock Marketplace implementation
If you deployed the model utilizing Amazon Bedrock Marketplace, complete the following steps:
1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace deployments. - In the Managed implementations area, locate the endpoint you wish to erase.
- Select the endpoint, and on the Actions menu, pick Delete.
- Verify the endpoint details to make certain you're deleting the proper deployment: 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 delete 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 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 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 construct ingenious services using AWS services and accelerated compute. Currently, he is concentrated on establishing methods for fine-tuning and optimizing the reasoning efficiency of big language models. In his leisure time, Vivek delights in hiking, watching motion pictures, and trying different foods.
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 Professional Solutions Architect working on generative AI with the Third-Party Model Science team at AWS.
Banu Nagasundaram leads product, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about building solutions that assist consumers accelerate their AI journey and unlock organization worth.