![](https://i.ytimg.com/vi/iP_UmDs_i5s/hq720.jpg?sqp\u003d-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD\u0026rs\u003dAOn4CLDxS0FveZZHaEZSvK0gk9HNRkBxLg)
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 release DeepSeek AI's first-generation frontier design, DeepSeek-R1, together with the distilled versions ranging from 1.5 to 70 billion specifications to build, experiment, and properly scale your generative AI concepts on AWS.
![](https://eu-images.contentstack.com/v3/assets/blt69509c9116440be8/bltdab34f69f74c72fe/65380fc40ef0e002921fc072/AI-thinking-Kittipong_Jirasukhanont-alamy.jpg)
In this post, we show how to get started with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled versions of the designs as well.
Overview of DeepSeek-R1
DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that utilizes support discovering to boost reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key distinguishing function is its reinforcement knowing (RL) step, which was utilized to refine the design's responses beyond the standard pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adapt more effectively to user feedback and goals, ultimately enhancing both significance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, indicating it's equipped to break down complicated queries and factor through them in a detailed way. This directed reasoning procedure permits the model to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to create structured actions while concentrating on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has actually caught the industry's attention as a flexible text-generation model that can be integrated into numerous workflows such as representatives, logical reasoning and data interpretation jobs.
DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion parameters, enabling efficient reasoning by routing inquiries to the most relevant expert "clusters." This method allows the design to specialize in different problem domains while maintaining overall efficiency. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will use 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 design to more efficient 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 behavior and reasoning patterns of the larger DeepSeek-R1 model, utilizing it as an instructor model.
You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we recommend releasing this design with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, avoid hazardous content, and assess models against essential safety requirements. At the time of writing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop several guardrails tailored to various use cases and apply them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls throughout 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 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 ask for a limitation boost, develop a limit boost demand and connect to your account team.
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) consents to utilize Amazon Bedrock Guardrails. For directions, see Establish consents to utilize guardrails for content filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to present safeguards, avoid hazardous material, and evaluate designs against crucial security requirements. You can carry out precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to examine user inputs and design actions released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.
The general circulation includes the following steps: 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 out to the model for reasoning. After getting the design's output, another guardrail check is applied. If the output passes this last check, it's returned as the result. However, if either the input or output is intervened by the guardrail, a message is returned showing the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following sections show reasoning using this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace provides you access to over 100 popular, emerging, and specialized foundation designs (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 models in the navigation pane.
At the time of composing this post, you can use 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 company and choose the DeepSeek-R1 design.
The model detail page provides important details about the model's abilities, pricing structure, and execution guidelines. You can discover detailed usage directions, including sample API calls and code bits for integration. The design supports different text generation tasks, consisting of material creation, code generation, and concern answering, using its reinforcement discovering optimization and CoT reasoning abilities.
The page likewise includes deployment options and licensing details to help you get going with DeepSeek-R1 in your applications.
3. To begin utilizing DeepSeek-R1, select Deploy.
You will be triggered 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 instances, go into a variety of instances (in between 1-100).
6. For example type, choose your instance type. For optimal efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended.
Optionally, you can configure sophisticated security and facilities settings, including virtual private cloud (VPC) networking, service function consents, and file encryption settings. For a lot of use cases, the default settings will work well. However, for production implementations, you may want to evaluate these settings to align with your organization's security and compliance requirements.
7. Choose Deploy to start using the design.
When the deployment is total, you can test DeepSeek-R1's abilities straight in the Amazon Bedrock play ground.
8. Choose Open in playground to access an interactive user interface where you can explore various triggers and adjust model specifications like temperature level and optimum length.
When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimum results. For instance, <|begin▁of▁sentence|><|User|>material for inference<|Assistant|>.
This is an exceptional method to check out the model's reasoning and text generation capabilities before incorporating it into your applications. The play area supplies immediate feedback, helping you comprehend how the model reacts to numerous inputs and letting you tweak your triggers for ideal outcomes.
You can rapidly check the design in the playground through the UI. However, to conjure up the released model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.
Run reasoning utilizing guardrails with the released DeepSeek-R1 endpoint
The following code example demonstrates how to perform reasoning utilizing a deployed DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop 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 developed the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime customer, configures reasoning parameters, and sends out a demand to generate 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 services that you can deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your data, and release them into production utilizing either the UI or SDK.
Deploying DeepSeek-R1 design through SageMaker JumpStart provides 2 convenient methods: utilizing the instinctive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both techniques to assist you pick the approach that best suits 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 produce a domain.
3. On the SageMaker Studio console, trademarketclassifieds.com choose JumpStart in the navigation pane.
The design browser shows available designs, with details like the service provider name and model abilities.
4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card.
Each model card reveals key details, consisting of:
- Model name
- Provider name
- Task category (for instance, Text Generation).
Bedrock Ready badge (if relevant), suggesting that this design can be signed up with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to conjure up the design
5. Choose the model card to see the model details page.
The design details page consists of 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 specs.
- Usage guidelines
Before you deploy the design, it's advised to evaluate the design details and license terms to verify compatibility with your use case.
6. Choose Deploy to continue with release.
7. For Endpoint name, use the automatically produced name or develop a custom-made one.
8. For example type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
9. For Initial circumstances count, gratisafhalen.be go into the number of circumstances (default: 1).
Selecting suitable instance types and counts is important for cost and efficiency optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is enhanced for sustained traffic and low latency.
10. Review all setups for precision. For this design, we strongly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
11. Choose Deploy to deploy the design.
The release procedure can take a number of minutes to complete.
When implementation is total, your endpoint status will alter to InService. At this point, the model is prepared to accept reasoning requests through the endpoint. You can keep track of the release development on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the implementation is complete, you can conjure up the model utilizing a SageMaker runtime customer and integrate it with your applications.
Deploy DeepSeek-R1 utilizing the SageMaker Python SDK
To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the necessary AWS permissions and environment setup. The following is a detailed code example that shows how to release and use DeepSeek-R1 for inference programmatically. The code for releasing the model is offered 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 reasoning with your SageMaker JumpStart predictor
Similar to Amazon Bedrock, you can also utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail utilizing the Amazon Bedrock console or the API, and implement it as shown in the following code:
Tidy up
To avoid undesirable charges, complete the steps in this section to tidy up your resources.
Delete the Amazon Bedrock Marketplace deployment
If you deployed the model utilizing Amazon Bedrock Marketplace, complete the following actions:
1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace deployments.
2. In the Managed releases section, find the endpoint you desire to delete.
3. Select the endpoint, and on the Actions menu, pick Delete.
4. Verify the endpoint details to make certain you're erasing the correct deployment: 1. Endpoint name.
2. Model name.
3. 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 delete the endpoint if you wish 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 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get begun. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Beginning with Amazon SageMaker JumpStart.
About the Authors
Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI companies build ingenious options utilizing AWS services and accelerated calculate. Currently, he is focused on developing methods for fine-tuning and optimizing the inference performance of large language designs. In his downtime, Vivek delights in hiking, enjoying motion pictures, and wiki.vst.hs-furtwangen.de attempting various 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 Science and Bioinformatics.
![](https://cdn.mos.cms.futurecdn.net/VFLt5vHV7aCoLrLGjP9Qwm-1200-80.jpg)
Jonathan Evans is a Professional Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.
Banu Nagasundaram leads item, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about constructing options that assist consumers accelerate their AI journey and unlock company value.