Today, we are thrilled to reveal that DeepSeek R1 distilled Llama and Qwen designs 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, in addition to the distilled variations varying from 1.5 to 70 billion criteria to develop, experiment, and properly scale your generative AI ideas 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 variations of the models too.

Overview of DeepSeek-R1
DeepSeek-R1 is a big language model (LLM) established by DeepSeek AI that uses reinforcement discovering to enhance thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. An essential differentiating feature is its reinforcement learning (RL) step, which was used to refine the model's reactions beyond the basic pre-training and tweak process. By integrating RL, DeepSeek-R1 can adjust more successfully to user feedback and objectives, eventually boosting both importance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, implying it's equipped to break down complex queries and factor through them in a detailed manner. This directed reasoning process permits the model to produce more precise, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured actions while focusing on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has actually recorded the market's attention as a versatile text-generation model that can be incorporated into numerous workflows such as agents, logical reasoning and data analysis tasks.
DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture enables activation of 37 billion parameters, allowing effective reasoning by routing queries to the most relevant professional "clusters." This technique enables the model to focus on different problem domains while maintaining overall performance. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge instance to deploy the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.
DeepSeek-R1 distilled models bring the reasoning capabilities 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 procedure of training smaller, more effective models to mimic the behavior and reasoning patterns of the bigger DeepSeek-R1 design, using it as a teacher model.
You can deploy DeepSeek-R1 model either through SageMaker JumpStart or gratisafhalen.be Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend deploying this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent damaging material, and assess models against crucial safety criteria. At the time of writing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create multiple guardrails tailored to various usage 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 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, pick Amazon SageMaker, and validate you're using 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 limitation boost, develop a limit boost demand and reach out to your account team.
Because you will be deploying this design 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 approvals to use guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails permits you to present safeguards, avoid harmful content, and evaluate models against essential security requirements. You can execute security procedures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to examine user inputs and design responses 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 develop the guardrail, see the GitHub repo.
The basic flow involves the following actions: 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 inference. After receiving the design'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 intervened by the guardrail, a message is returned suggesting the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following sections show reasoning utilizing this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace provides 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, choose Model brochure under Foundation models in the navigation pane.
At the time of writing 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 supplies essential details about the model's capabilities, rates structure, and execution guidelines. You can discover detailed use instructions, consisting of sample API calls and code snippets for integration. The model supports numerous text generation jobs, including content production, code generation, and question answering, using its support discovering optimization and CoT reasoning capabilities.
The page likewise includes implementation options and licensing details to assist you begin with DeepSeek-R1 in your applications.
3. To start using DeepSeek-R1, pick Deploy.
You will be triggered to set up the release details for DeepSeek-R1. The model ID will be pre-populated.
4. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters).
5. For Number of circumstances, enter a number of instances (in between 1-100).
6. For example type, select your instance type. For ideal efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended.
Optionally, you can set up sophisticated security and links.gtanet.com.br facilities settings, including virtual private cloud (VPC) networking, service function permissions, and encryption settings. For a lot of utilize cases, the default settings will work well. However, for production deployments, you might wish to review these settings to line up with your company's security and compliance requirements.
7. Choose Deploy to start utilizing the model.
When the deployment is total, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground.
8. Choose Open in play ground to access an interactive interface where you can explore various prompts and change design parameters like temperature and optimum length.
When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimum outcomes. For example, <|begin▁of▁sentence|><|User|>material for reasoning<|Assistant|>.
This is an outstanding method to check out the design's thinking and text generation capabilities before integrating it into your applications. The play ground supplies instant feedback, helping you understand how the model reacts to various inputs and garagesale.es letting you fine-tune your triggers for ideal outcomes.
You can rapidly evaluate the design in the play ground through the UI. However, to invoke the released design programmatically with any Amazon Bedrock APIs, you require 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 using the invoke_model and ApplyGuardrail API. 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. After you have created the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures inference specifications, and sends out a request to generate text based upon 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 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 utilizing either the UI or SDK.
Deploying DeepSeek-R1 design through SageMaker JumpStart offers 2 practical methods: utilizing the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you select the technique 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, choose 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 design browser shows available models, with details like the company name and design capabilities.
4. Look for DeepSeek-R1 to view the DeepSeek-R1 model card.
Each design card shows key details, including:
- Model name
- Provider name
- Task category (for instance, Text Generation).
Bedrock Ready badge (if suitable), suggesting that this model can be registered with Amazon Bedrock, allowing you to utilize Amazon Bedrock APIs to conjure up the model
5. Choose the design 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 specifications.
- Usage standards
Before you deploy the design, archmageriseswiki.com it's suggested to evaluate the design details and license terms to verify compatibility with your usage case.
6. Choose Deploy to proceed with release.
7. For Endpoint name, use the automatically generated name or develop a custom-made one.
8. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
9. For Initial circumstances count, get in the number of circumstances (default: 1).
Selecting suitable instance types and counts is vital 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.
10. Review all configurations for precision. For bio.rogstecnologia.com.br this model, we highly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
11. Choose Deploy to deploy the model.
The implementation procedure can take numerous minutes to complete.
When implementation is complete, your endpoint status will alter to InService. At this moment, the model is all set to accept inference demands through the endpoint. You can keep an eye on the implementation progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the deployment is complete, you can invoke the design using a SageMaker runtime client and integrate it with your applications.
Deploy DeepSeek-R1 using the SageMaker Python SDK
To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the necessary AWS consents and environment setup. The following is a detailed code example that demonstrates how to deploy and utilize DeepSeek-R1 for inference programmatically. The code for deploying the model is supplied in the Github here. You can clone the notebook and range 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 utilizing the Amazon Bedrock console or the API, and implement it as displayed in the following code:
Tidy up
To prevent undesirable charges, finish the steps in this area to clean up your resources.
Delete the Amazon Bedrock Marketplace release
If you released 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 implementations.
2. In the Managed implementations section, find the endpoint you wish to erase.
3. Select the endpoint, and on the Actions menu, choose Delete.
4. Verify the endpoint details to make certain you're deleting the appropriate implementation: 1. Endpoint name.
2. Model name.
3. 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 erase 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 fishtanklive.wiki deploy the DeepSeek-R1 design utilizing 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 models, SageMaker JumpStart pretrained designs, 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 helps emerging generative AI business develop innovative services utilizing AWS services and accelerated compute. Currently, he is concentrated on developing techniques for fine-tuning and optimizing the inference efficiency of big language models. In his spare time, Vivek delights in treking, enjoying films, and trying various foods.
Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group at AWS. His location of focus is AWS AI accelerators (AWS Neuron). He holds a Bachelor's degree in Computer Science and Bioinformatics.

Jonathan Evans is an Expert Solutions Architect dealing with 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 passionate about building solutions that assist consumers accelerate their AI journey and unlock business worth.