DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Today, we are delighted 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 design, DeepSeek-R1, together with the distilled versions varying from 1.5 to 70 billion criteria to build, experiment, and responsibly scale your generative AI concepts 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 versions of the models as well.
Overview of DeepSeek-R1
DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that utilizes reinforcement learning to boost thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key identifying feature is its reinforcement knowing (RL) step, which was utilized to refine the model's responses beyond the standard pre-training and fine-tuning process. By integrating RL, DeepSeek-R1 can adapt better to user feedback and goals, ultimately boosting both importance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, indicating it's equipped to break down complex questions and factor through them in a detailed way. This guided reasoning process enables the model to produce more precise, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT capabilities, aiming to create structured reactions while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has caught the market's attention as a versatile text-generation model that can be integrated into numerous workflows such as agents, logical thinking and information interpretation tasks.
DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion parameters, enabling effective reasoning by routing questions to the most pertinent professional "clusters." This approach permits the design to specialize in different issue domains while maintaining general effectiveness. DeepSeek-R1 needs 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 features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.
DeepSeek-R1 distilled models bring the reasoning abilities of the main R1 model to more effective 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 designs to imitate the behavior higgledy-piggledy.xyz and thinking patterns of the larger DeepSeek-R1 design, using it as an instructor design.
You can deploy 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 place. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous content, and examine designs against crucial security criteria. 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 produce multiple guardrails tailored to various use cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls across your generative AI applications.
Prerequisites
To release 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 verify you're using ml.p5e.48 xlarge for . 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, create a limit increase demand and reach out to your account team.
Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the proper AWS Identity and Gain Access To Management (IAM) approvals to utilize Amazon Bedrock Guardrails. For guidelines, see Establish approvals to utilize guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to present safeguards, prevent damaging material, and examine designs against crucial safety criteria. You can implement safety steps for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to assess user inputs and model actions released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.
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 reasoning. After receiving the design's output, another guardrail check is used. 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 happened at the input or output phase. The examples showcased in the following sections demonstrate inference utilizing this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized structure models (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 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 doesn't 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 provides necessary details about the model's capabilities, rates structure, and execution standards. You can discover detailed usage directions, hb9lc.org including sample API calls and code snippets for integration. The design supports numerous text generation tasks, consisting of content creation, code generation, and concern answering, using its reinforcement discovering optimization and CoT reasoning capabilities.
The page likewise consists of release alternatives and licensing details to assist you start with DeepSeek-R1 in your applications.
3. To begin utilizing DeepSeek-R1, select Deploy.
You will be prompted to configure the deployment details for DeepSeek-R1. The design ID will be pre-populated.
4. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters).
5. For Variety of instances, get in a number of circumstances (in between 1-100).
6. For example type, choose your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised.
Optionally, you can configure advanced security and facilities settings, consisting of virtual personal cloud (VPC) networking, service role permissions, and encryption settings. For many use cases, the default settings will work well. However, for production releases, you may desire to examine these settings to line up with your company's security and compliance requirements.
7. Choose Deploy to begin utilizing the model.
When the release 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 interface where you can explore different prompts and change design criteria like temperature level and maximum length.
When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimal results. For example, material for reasoning.
This is an exceptional way to explore the design's thinking and text generation abilities before incorporating it into your applications. The play ground supplies instant feedback, assisting you comprehend how the model reacts to numerous inputs and letting you tweak your prompts for optimum outcomes.
You can rapidly test the design in the play ground through the UI. However, to conjure up the released model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.
Run inference using guardrails with the released DeepSeek-R1 endpoint
The following code example demonstrates how to perform inference using a deployed DeepSeek-R1 model 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 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 criteria, and sends a demand to create text based upon a user prompt.
Deploy DeepSeek-R1 with SageMaker JumpStart
SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in algorithms, and prebuilt ML options that you can deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your data, and release them into production using either the UI or demo.qkseo.in SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 practical methods: using the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both techniques to assist you select the method that best suits your needs.
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 prompted to produce a domain.
3. On the SageMaker Studio console, pick JumpStart in the navigation pane.
The design browser displays available designs, with details like the supplier name and model abilities.
4. Search for DeepSeek-R1 to see the DeepSeek-R1 model card.
Each design card shows essential 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 use Amazon Bedrock APIs to conjure up the design
5. Choose the model card to view the design details page.
The design details page consists of the following details:
- The design name and service provider details. Deploy button to deploy the design. 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 release the model, it's recommended to review the model details and license terms to confirm compatibility with your use case.
6. Choose Deploy to continue with implementation.
7. For Endpoint name, utilize the immediately created name or develop a customized one.
- For Instance type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
- For Initial instance count, go into the variety of circumstances (default: 1). Selecting appropriate instance types and counts is crucial for cost and efficiency optimization. Monitor your implementation 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 accuracy. For this model, we highly recommend sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
- Choose Deploy to release the design.
The deployment procedure can take numerous minutes to finish.
When release is complete, your endpoint status will change to InService. At this point, the design is ready to accept inference demands through the endpoint. You can keep an eye on the deployment progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the release is total, you can conjure up the model using a SageMaker runtime customer and integrate it with your applications.
Deploy DeepSeek-R1 using the SageMaker Python SDK
To start with DeepSeek-R1 using the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the necessary AWS authorizations and environment setup. The following is a detailed code example that shows how to deploy and use DeepSeek-R1 for reasoning programmatically. The code for deploying the model is provided in the Github here. You can clone the notebook and range from SageMaker Studio.
You can run extra 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 create a guardrail using the Amazon Bedrock console or the API, and execute it as revealed in the following code:
Tidy up
To avoid undesirable charges, finish the steps in this area to tidy up your resources.
Delete the Amazon Bedrock Marketplace deployment
If you deployed the design utilizing Amazon Bedrock Marketplace, total the following actions:
1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace releases. - In the Managed deployments section, locate 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 deleting the appropriate implementation: 1. Endpoint name.
- Model name.
- Endpoint status
Delete the SageMaker JumpStart predictor
The SageMaker JumpStart design you released will sustain expenses if you leave it running. Use the following code to erase the endpoint if you desire 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 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 Getting started 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 build innovative solutions using AWS services and accelerated compute. Currently, he is focused on establishing techniques for fine-tuning and enhancing the reasoning performance of big language designs. In his spare time, Vivek enjoys hiking, seeing motion pictures, and attempting different cuisines.
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 technology and Bioinformatics.
Jonathan Evans is an Expert Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.
Banu Nagasundaram leads item, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about building options that help customers accelerate their AI journey and unlock company value.