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 release DeepSeek AI's first-generation frontier design, DeepSeek-R1, together with the distilled versions ranging from 1.5 to 70 billion parameters to build, experiment, and responsibly scale your generative AI concepts on AWS.
In this post, we demonstrate how to start 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) developed by DeepSeek AI that utilizes support finding out to enhance reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial distinguishing function is its reinforcement knowing (RL) action, which was used to fine-tune the design's reactions beyond the standard pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adapt more effectively to user feedback and objectives, eventually enhancing both importance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, meaning it's equipped to break down complex questions and factor through them in a detailed manner. This assisted reasoning procedure permits the design to produce more precise, transparent, and detailed answers. This model integrates RL-based fine-tuning with CoT abilities, aiming to produce structured reactions 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 integrated into various workflows such as representatives, rational thinking and data interpretation jobs.
DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion parameters, allowing efficient inference by routing queries to the most relevant professional "clusters." This method permits the model to focus on various issue domains while maintaining total performance. DeepSeek-R1 needs at least 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 design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.
DeepSeek-R1 distilled models bring the thinking capabilities 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 describes a procedure of training smaller sized, more effective models to imitate the behavior and reasoning patterns of the larger DeepSeek-R1 design, using it as an instructor model.
You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise deploying this design with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid harmful material, and examine models against crucial safety criteria. At the time of writing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop several guardrails tailored to various use cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls throughout your generative AI applications.
Prerequisites
To release the DeepSeek-R1 design, you require access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and setiathome.berkeley.edu confirm you're using ml.p5e.48 xlarge for endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are releasing. To ask for a limitation increase, create a limit boost request and reach out to your account group.
Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the proper AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For directions, see Establish approvals to use guardrails for material filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails enables you to present safeguards, avoid harmful content, and assess designs against essential safety criteria. You can carry out precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and model reactions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail using the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo.
The basic circulation includes 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 to the design for inference. After getting 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 stepped in by the guardrail, a message is returned suggesting the nature of the intervention and whether it took place at the input or output stage. The examples showcased in the following sections show reasoning utilizing 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, total the following steps:
1. On the Amazon Bedrock console, choose Model brochure under Foundation models in the navigation pane.
At the time of composing 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 company and pick the DeepSeek-R1 model.
The model detail page provides important details about the model's abilities, pricing structure, and execution guidelines. You can discover detailed use guidelines, including sample API calls and code snippets for integration. The design supports different text generation jobs, including content development, code generation, and concern answering, utilizing its support discovering optimization and CoT thinking abilities.
The page likewise includes release alternatives and licensing details to assist you begin with DeepSeek-R1 in your applications.
3. To start using DeepSeek-R1, choose Deploy.
You will be prompted to set up the deployment details for DeepSeek-R1. The design ID will be pre-populated.
4. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters).
5. For Number of circumstances, go into a variety of instances (between 1-100).
6. For Instance type, choose your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested.
Optionally, you can set up innovative security and facilities settings, including virtual personal cloud (VPC) networking, service function approvals, and encryption settings. For most use cases, the default settings will work well. However, for production implementations, you might want to examine 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 evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock play area.
8. Choose Open in play area to access an interactive user interface where you can explore various triggers and change design specifications like temperature and optimum length.
When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for ideal results. For instance, material for inference.
This is an excellent method to check out the model's thinking and text generation abilities before incorporating it into your applications. The play ground supplies instant feedback, assisting you understand how the design reacts to various inputs and letting you fine-tune your prompts for optimum results.
You can rapidly check the design in the playground through the UI. However, to invoke the deployed design programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.
Run reasoning utilizing guardrails with the deployed DeepSeek-R1 endpoint
The following code example shows how to carry out reasoning using a deployed DeepSeek-R1 model 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 develop the guardrail, see the GitHub repo. After you have developed the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime client, sets up inference criteria, and sends out a request to create 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 just a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and release them into production using either the UI or SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart uses two hassle-free methods: utilizing the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you select the technique that finest suits your requirements.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following steps to deploy DeepSeek-R1 utilizing SageMaker JumpStart:
1. On the SageMaker console, select Studio in the navigation pane.
2. First-time users will be triggered to produce a domain.
3. On the SageMaker Studio console, pick JumpStart in the navigation pane.
The model internet browser displays available models, with details like the company name and design abilities.
4. Search for DeepSeek-R1 to view the DeepSeek-R1 design card.
Each model card shows essential details, consisting of:
- Model name
- Provider name
- Task classification (for instance, Text Generation).
Bedrock Ready badge (if suitable), showing that this design can be registered with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to invoke the design
5. Choose the design card to view the design details page.
The design details page consists of the following details:
- The model name and provider details. Deploy button to deploy the model. About and Notebooks tabs with detailed details
The About tab consists of essential details, such as:
- Model description. - License details.
- Technical specs.
- Usage standards
Before you release the design, it's suggested to evaluate the design details and wavedream.wiki license terms to with your use case.
6. Choose Deploy to continue with implementation.
7. For Endpoint name, use the immediately created name or create a customized one.
- For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
- For Initial circumstances count, get in the number of instances (default: 1). Selecting suitable circumstances types and counts is vital for expense and performance optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is optimized for sustained traffic and low latency.
- Review all setups for precision. For this design, we strongly recommend adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
- Choose Deploy to deploy the model.
The implementation procedure can take numerous minutes to complete.
When deployment is complete, your endpoint status will alter to InService. At this moment, the design is all set to accept reasoning demands through the endpoint. You can keep an eye on the implementation progress on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the implementation is total, you can conjure up the model utilizing a SageMaker runtime client and integrate it with your applications.
Deploy DeepSeek-R1 utilizing the SageMaker Python SDK
To begin with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the needed AWS authorizations and environment setup. The following is a detailed code example that demonstrates how to release and utilize DeepSeek-R1 for inference programmatically. The code for releasing the design is supplied 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 oeclub.org 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 develop a guardrail utilizing the Amazon Bedrock console or the API, and execute it as revealed in the following code:
Clean up
To avoid unwanted charges, finish the steps in this area to clean up your resources.
Delete the Amazon Bedrock Marketplace deployment
If you deployed the model using Amazon Bedrock Marketplace, complete the following steps:
1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace deployments. - In the Managed releases area, find the endpoint you desire to erase.
- Select the endpoint, and on the Actions menu, select Delete.
- Verify the endpoint details to make certain you're deleting the proper deployment: 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 wish 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 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. 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 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 build innovative services using AWS services and sped up compute. Currently, he is concentrated on establishing methods for fine-tuning and optimizing the inference efficiency of large language models. In his leisure time, Vivek takes pleasure in hiking, viewing motion pictures, and trying various 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 a Professional Solutions Architect working on generative AI with the Third-Party Model Science group at AWS.
Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about developing services that assist consumers accelerate their AI journey and unlock company value.