Deleting the wiki page 'DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart' cannot be undone. Continue?
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 variations ranging from 1.5 to 70 billion criteria to construct, experiment, and responsibly scale your generative AI concepts 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 actions to release the distilled variations of the models too.
Overview of DeepSeek-R1
DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes reinforcement finding out to improve reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key identifying feature is its reinforcement learning (RL) step, which was utilized to improve the model's reactions beyond the basic pre-training and tweak procedure. By integrating RL, DeepSeek-R1 can adapt better to user feedback and goals, ultimately improving both significance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, meaning it's geared up to break down complicated queries and factor through them in a detailed way. This directed reasoning procedure allows the design to produce more accurate, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT abilities, aiming to produce structured responses while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has captured the industry's attention as a versatile text-generation model that can be integrated into various workflows such as representatives, rational thinking and data interpretation tasks.
DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, allowing effective inference by routing inquiries to the most pertinent specialist "clusters." This approach enables the design to focus on various issue 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 circumstances to release 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 sized, more efficient models to mimic the habits and thinking patterns of the bigger DeepSeek-R1 design, using it as a teacher design.
You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest releasing this model with guardrails in location. In this blog, we will utilize Amazon Bedrock Guardrails to introduce safeguards, avoid damaging content, and examine designs against essential safety criteria. At the time of composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create several guardrails tailored to various use cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing security controls throughout your generative AI applications.
Prerequisites
To release the DeepSeek-R1 design, you require 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 verify you're utilizing ml.p5e.48 xlarge for endpoint use. 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 limitation boost request and reach out to your account group.
Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) approvals to use Amazon Bedrock Guardrails. For directions, see Set up authorizations to utilize guardrails for content filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to present safeguards, avoid harmful material, and examine models against key security criteria. You can implement safety procedures for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to examine user inputs and model reactions deployed 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 create the guardrail, see the GitHub repo.
The basic flow involves the following steps: First, the system receives an input for the design. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent out to the design for reasoning. After receiving the design's output, another guardrail check is used. 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 showing the nature of the intervention and whether it occurred at the input or output stage. The examples showcased in the following areas show inference using 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, total the following steps:
1. On the Amazon Bedrock console, select Model brochure under Foundation designs in the navigation pane.
At the time of writing this post, you can use the InvokeModel API to invoke the design. It does not support Converse APIs and other Amazon Bedrock tooling.
2. Filter for DeepSeek as a company and choose the DeepSeek-R1 model.
The design detail page offers essential details about the design's abilities, rates structure, and execution standards. You can discover detailed use guidelines, consisting of sample API calls and code bits for combination. The design supports various text generation jobs, including material production, code generation, and question answering, using its reinforcement learning optimization and CoT thinking abilities.
The page likewise includes release options and licensing details to help you get begun with DeepSeek-R1 in your applications.
3. To begin utilizing DeepSeek-R1, choose Deploy.
You will be triggered to configure 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 of circumstances (between 1-100).
6. For example type, pick your instance type. For optimum performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised.
Optionally, you can set up innovative security and facilities settings, including virtual personal cloud (VPC) networking, service role approvals, and encryption settings. For most use cases, the default settings will work well. However, for production implementations, you may desire to review these settings to align with your company's security and compliance requirements.
7. Choose Deploy to start utilizing the model.
When the release is total, you can test DeepSeek-R1's abilities straight in the Amazon Bedrock playground.
8. Choose Open in play ground to access an interactive interface where you can try out various prompts and change model parameters like temperature and optimum length.
When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimum results. For example, material for inference.
This is an exceptional way to check out the design's reasoning and text generation capabilities before incorporating it into your applications. The play area offers immediate feedback, assisting you understand how the model reacts to various inputs and letting you fine-tune your prompts for optimum outcomes.
You can rapidly test the design in the play ground through the UI. However, to invoke the deployed design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.
Run reasoning using guardrails with the deployed DeepSeek-R1 endpoint
The following code example shows how to perform reasoning utilizing a released DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can create 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 actually created the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime customer, sets up reasoning specifications, and sends out a request to produce 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 options that you can release with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your information, and release them into production using either the UI or SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart provides two convenient techniques: using the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both methods to assist you pick the approach that best suits your requirements.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following actions to deploy DeepSeek-R1 using SageMaker JumpStart:
1. On the SageMaker console, select Studio in the navigation pane.
2. First-time users will be triggered to create a domain.
3. On the SageMaker Studio console, choose JumpStart in the navigation pane.
The model browser shows available models, with details like the company name and model capabilities.
4. Look for DeepSeek-R1 to view the DeepSeek-R1 model card.
Each model card reveals key details, including:
- Model name
Deleting the wiki page 'DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart' cannot be undone. Continue?