DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Today, we are thrilled 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, together with the distilled versions ranging from 1.5 to 70 billion specifications to construct, experiment, and properly scale your generative AI ideas on AWS.
In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to release the distilled variations of the designs also.
Overview of DeepSeek-R1
DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that uses support finding out to boost reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential identifying function is its support knowing (RL) action, which was used to fine-tune the model's reactions beyond the basic pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adapt more successfully to user feedback and goals, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, implying it's geared up to break down complex inquiries and reason through them in a detailed way. This guided reasoning procedure allows the design to produce more accurate, transparent, and detailed answers. This model 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 actually captured the market's attention as a flexible text-generation model that can be integrated into different workflows such as agents, rational thinking and data analysis tasks.
DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion specifications, making it possible for effective reasoning by routing queries to the most pertinent expert "clusters." This technique permits the design to concentrate on various issue 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 utilize an ml.p5e.48 xlarge instance to deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.
DeepSeek-R1 distilled models bring the thinking abilities of the main R1 model to more efficient architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a procedure of training smaller sized, more effective models to imitate the habits and thinking patterns of the bigger DeepSeek-R1 design, using it as an instructor design.
You can deploy DeepSeek-R1 model 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 utilize Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous material, and examine designs against essential security requirements. 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 create several guardrails tailored to different use cases and apply them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls throughout your generative AI applications.
Prerequisites
To deploy the DeepSeek-R1 model, you require access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and verify you're using ml.p5e.48 xlarge for endpoint usage. 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 limit increase request and reach out to your account team.
Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For instructions, see Set up permissions to use guardrails for content .
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails enables you to present safeguards, avoid harmful content, and evaluate models against crucial safety requirements. You can carry out security steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to assess user inputs and design reactions 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 create the guardrail, see the GitHub repo.
The basic flow involves the following actions: First, the system gets an input for the model. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent to the model for reasoning. 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 suggesting the nature of the intervention and whether it happened 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, complete the following actions:
1. On the Amazon Bedrock console, choose Model brochure under Foundation designs in the navigation pane.
At the time of writing this post, you can utilize the InvokeModel API to invoke the model. It does not support Converse APIs and other Amazon Bedrock tooling.
2. Filter for DeepSeek as a provider and select the DeepSeek-R1 design.
The design detail page supplies vital details about the model's capabilities, pricing structure, and application guidelines. You can find detailed usage instructions, including sample API calls and code bits for combination. The design supports different text generation jobs, consisting of material development, code generation, and question answering, utilizing its support learning optimization and CoT thinking capabilities.
The page also includes release alternatives and licensing details to assist you get going with DeepSeek-R1 in your applications.
3. To start using DeepSeek-R1, select 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, go into an endpoint name (between 1-50 alphanumeric characters).
5. For Variety of circumstances, get in a number of instances (in between 1-100).
6. For example type, select your instance type. For optimal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested.
Optionally, you can set up advanced security and infrastructure settings, including virtual personal cloud (VPC) networking, service role permissions, and file encryption settings. For many utilize cases, the default settings will work well. However, for production deployments, you might wish to review these settings to align with your company's security and compliance requirements.
7. Choose Deploy to start using the model.
When the implementation is complete, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock play ground.
8. Choose Open in play ground to access an interactive interface where you can explore different triggers and adjust model parameters like temperature level and maximum length.
When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for ideal results. For example, material for inference.
This is an exceptional method to explore the design's thinking and text generation abilities before integrating it into your applications. The playground offers immediate feedback, assisting you understand how the model reacts to various inputs and letting you fine-tune your triggers for optimal results.
You can rapidly check the model in the playground through the UI. However, to conjure up the deployed design 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 carry out inference utilizing a released DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can create a guardrail utilizing 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, use the following code to execute guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, and sends out a request to produce text based on a user prompt.
Deploy DeepSeek-R1 with SageMaker JumpStart
SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, built-in algorithms, and prebuilt ML options that you can release with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your data, and deploy them into production using either the UI or SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart provides 2 practical approaches: utilizing the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both methods to assist you pick the technique that finest suits 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, pick Studio in the navigation pane.
2. First-time users will be prompted to create a domain.
3. On the SageMaker Studio console, choose JumpStart in the navigation pane.
The model browser displays available designs, with details like the service provider name and design abilities.
4. Look for DeepSeek-R1 to see the DeepSeek-R1 model card.
Each design card reveals crucial details, including:
- Model name
- Provider name
- Task category (for instance, Text Generation).
Bedrock Ready badge (if relevant), showing that this model can be signed up with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to invoke the design
5. Choose the model card to view the model details page.
The model details page consists of the following details:
- The model name and supplier details. Deploy button to release the model. About and Notebooks tabs with detailed details
The About tab consists of crucial details, such as:
- Model description. - License details.
- Technical specs.
- Usage guidelines
Before you deploy the model, it's suggested to evaluate the model details and license terms to verify compatibility with your usage case.
6. Choose Deploy to proceed with implementation.
7. For Endpoint name, utilize the automatically created name or create a custom-made one.
- For example type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
- For Initial instance count, go into the number of circumstances (default: 1). Selecting proper circumstances types and counts is important for expense and efficiency optimization. Monitor your release to change 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 design, we strongly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
- Choose Deploy to release the design.
The release procedure can take several minutes to finish.
When implementation is complete, your endpoint status will alter to InService. At this moment, the model is ready to accept reasoning requests through the endpoint. You can keep track of the release 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 model utilizing a SageMaker runtime client and incorporate it with your applications.
Deploy DeepSeek-R1 utilizing the SageMaker Python SDK
To get started with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the essential AWS authorizations and environment setup. The following is a detailed code example that demonstrates how to release and use DeepSeek-R1 for inference programmatically. The code for releasing the design is offered in the Github here. You can clone the notebook 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 develop a guardrail utilizing the Amazon Bedrock console or the API, and implement it as displayed in the following code:
Clean up
To avoid undesirable charges, complete the actions in this area to tidy up your resources.
Delete the Amazon Bedrock Marketplace implementation
If you released the design utilizing Amazon Bedrock Marketplace, complete the following actions:
1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace releases. - In the Managed releases area, locate the endpoint you want to delete.
- Select the endpoint, and on the Actions menu, pick Delete.
- Verify the endpoint details to make certain you're erasing the proper release: 1. Endpoint name.
- Model name.
- Endpoint status
Delete the SageMaker JumpStart predictor
The SageMaker JumpStart model you deployed will sustain costs if you leave it running. Use the following code to delete 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 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get started. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, 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 assists emerging generative AI companies build innovative options using AWS services and sped up compute. Currently, he is focused on establishing strategies for fine-tuning and trademarketclassifieds.com optimizing the inference efficiency of large language models. In his downtime, Vivek enjoys treking, watching motion pictures, and attempting different cuisines.
Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team 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 an Expert 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 generative AI center. She is enthusiastic about constructing options that assist consumers accelerate their AI journey and unlock company value.