DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Today, we are excited 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 model, DeepSeek-R1, together with the distilled versions varying from 1.5 to 70 billion parameters to construct, experiment, and responsibly scale your generative AI concepts on AWS.
In this post, we show how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled variations of the designs too.
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 differentiating feature is its support learning (RL) step, which was used to fine-tune the model's responses beyond the standard pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adapt more successfully to user feedback and goals, eventually boosting both relevance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, meaning it's geared up to break down complicated inquiries and reason through them in a detailed manner. This assisted 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 produce structured responses while focusing on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has recorded the market's attention as a flexible text-generation design that can be incorporated into numerous workflows such as agents, sensible reasoning and information analysis jobs.
DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion parameters, allowing effective inference by routing queries to the most appropriate specialist "clusters." This technique enables the design to specialize in various problem domains while maintaining overall efficiency. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances to release the design. ml.p5e.48 xlarge features 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 refers to a process of training smaller, more efficient designs to simulate the habits and thinking patterns of the larger DeepSeek-R1 model, using it as a teacher design.
You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we recommend deploying this design with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous content, and evaluate designs against essential safety requirements. At the time of composing this blog, wiki.myamens.com for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create numerous guardrails tailored to different usage cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing security controls throughout your generative AI applications.
Prerequisites
To deploy the DeepSeek-R1 model, you require 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 usage. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are deploying. To request a limitation boost, produce a limit boost request and reach out to your account group.
Because you will be releasing this design with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For directions, see Set up approvals to use guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails enables you to introduce safeguards, prevent damaging content, and examine designs against essential safety criteria. You can implement safety procedures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to examine user inputs and model reactions 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 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 reasoning. After getting the design's output, another guardrail check is used. If the output passes this final 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 took place 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, total the following steps:
1. On the Amazon Bedrock console, choose Model catalog under Foundation designs 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 service provider and choose the DeepSeek-R1 design.
The design detail page offers important details about the design's capabilities, rates structure, and execution guidelines. You can find detailed use directions, consisting of sample API calls and code bits for combination. The design supports various text generation jobs, consisting of material production, code generation, and concern answering, using its support learning optimization and CoT reasoning abilities.
The page likewise consists of deployment choices and licensing details to help you start with DeepSeek-R1 in your applications.
3. To start utilizing DeepSeek-R1, pick Deploy.
You will be triggered to configure the implementation 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, go into a number of instances (in between 1-100).
6. For Instance type, select your instance type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended.
Optionally, you can set up sophisticated security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service function consents, and encryption settings. For a lot of use cases, the default settings will work well. However, for production deployments, you might want to review these settings to align with your organization's security and compliance requirements.
7. Choose Deploy to begin utilizing the design.
When the deployment is complete, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock playground.
8. Choose Open in play ground to access an interactive user interface where you can try out various prompts and adjust design criteria like temperature and optimum length.
When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for ideal outcomes. For example, content for reasoning.
This is an outstanding method to explore the design's reasoning and text generation abilities before incorporating it into your applications. The play ground offers immediate feedback, helping you comprehend how the design reacts to different inputs and you tweak your triggers for optimum outcomes.
You can rapidly evaluate the design in the playground through the UI. However, to invoke the deployed design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.
Run inference using guardrails with the deployed DeepSeek-R1 endpoint
The following code example shows how to perform inference utilizing a released DeepSeek-R1 design through Amazon Bedrock using 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 actually 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 demand to create text based on a user prompt.
Deploy DeepSeek-R1 with SageMaker JumpStart
SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, integrated algorithms, and prebuilt ML services that you can deploy with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your information, and release them into production utilizing either the UI or SDK.
Deploying DeepSeek-R1 design through SageMaker JumpStart uses 2 convenient approaches: utilizing the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both techniques to assist you pick the method that best matches 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 prompted to produce a domain.
3. On the SageMaker Studio console, select JumpStart in the navigation pane.
The model browser displays available models, with details like the service provider name and model abilities.
4. Look for DeepSeek-R1 to view the DeepSeek-R1 model card.
Each design card shows essential details, including:
- Model name
- Provider name
- Task classification (for instance, Text Generation).
Bedrock Ready badge (if relevant), indicating that this model can be signed up with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to invoke the model
5. Choose the model card to see the model details page.
The model details page includes the following details:
- The model name and service provider details. Deploy button to deploy the design. About and Notebooks tabs with detailed details
The About tab consists of essential details, such as:
- Model description. - License details.
- Technical specifications.
- Usage guidelines
Before you release the design, it's suggested to evaluate the model details and license terms to verify compatibility with your use case.
6. Choose Deploy to continue with deployment.
7. For Endpoint name, use the automatically created name or produce a custom one.
- For Instance type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
- For Initial circumstances count, go into the variety of instances (default: 1). Selecting appropriate instance types and counts is crucial for cost and efficiency optimization. Monitor pediascape.science your implementation 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.
- Review all setups for accuracy. For this model, we strongly suggest adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
- Choose Deploy to release the model.
The implementation procedure can take several minutes to complete.
When implementation is total, your endpoint status will change to InService. At this point, the design is prepared to accept inference demands through the endpoint. You can keep an eye on the implementation development on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the deployment is total, you can invoke the model using a SageMaker runtime client and integrate 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 require 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 shows how to deploy and utilize DeepSeek-R1 for reasoning programmatically. The code for deploying the model is offered in the Github here. You can clone the notebook and range from SageMaker Studio.
You can run additional requests against the predictor:
Implement guardrails and run inference with your SageMaker JumpStart predictor
Similar to Amazon Bedrock, you can also use 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 revealed in the following code:
Tidy up
To avoid unwanted charges, finish the actions in this area to clean up your resources.
Delete the Amazon Bedrock Marketplace implementation
If you released the design using Amazon Bedrock Marketplace, total the following actions:
1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace implementations. - In the Managed deployments section, find the endpoint you wish 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 design you deployed will sustain expenses if you leave it running. Use the following code to erase the endpoint if you want to stop sustaining charges. For more details, see Delete Endpoints and Resources.
Conclusion
In this post, we explored how you can access and deploy the DeepSeek-R1 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. 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 Getting begun with Amazon SageMaker JumpStart.
About the Authors
Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI business develop innovative solutions using AWS services and accelerated compute. Currently, he is concentrated on establishing techniques for fine-tuning and enhancing the inference performance of big language models. In his free time, Vivek delights in hiking, viewing films, and 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.
Jonathan Evans is a Specialist 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 center. She is passionate about building services that assist customers accelerate their AI journey and unlock organization worth.