Deleting the wiki page 'DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart' cannot be undone. Continue?
Today, we are delighted 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, along with the distilled versions varying from 1.5 to 70 billion specifications to build, experiment, and properly scale your generative AI concepts on AWS.
In this post, we demonstrate 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 designs too.
Overview of DeepSeek-R1
DeepSeek-R1 is a large language model (LLM) established by DeepSeek AI that utilizes reinforcement learning to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential differentiating feature is its reinforcement knowing (RL) step, which was used to improve the model's reactions beyond the standard pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adjust better to user feedback and objectives, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, meaning it's geared up to break down intricate inquiries and factor through them in a detailed way. This directed reasoning process enables the model to produce more accurate, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT abilities, aiming to produce structured responses while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has caught the market's attention as a versatile text-generation model that can be incorporated into numerous workflows such as representatives, sensible reasoning and data interpretation jobs.
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, enabling efficient inference by routing queries to the most pertinent specialist "clusters." This technique allows the design to concentrate on various issue domains while maintaining overall effectiveness. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge instance to release the model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.
DeepSeek-R1 distilled models 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 describes a process of training smaller, more effective designs to mimic the habits and thinking patterns of the bigger DeepSeek-R1 model, utilizing it as a teacher design.
You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise deploying this model with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent harmful material, and evaluate designs against crucial security requirements. At the time of composing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce numerous guardrails tailored to various usage cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls across your generative AI applications.
Prerequisites
To release the DeepSeek-R1 model, you need access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and verify 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 releasing. To request a limit boost, produce a limit increase demand and connect to your account team.
Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) approvals to use Amazon Bedrock Guardrails. For instructions, see Set up permissions to utilize guardrails for content filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails permits you to introduce safeguards, prevent hazardous content, and assess designs against crucial safety requirements. You can execute security steps for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to examine user inputs and design responses deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.
The basic flow includes the following steps: 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 inference. After receiving the model's output, another guardrail check is applied. If the output passes this last check, it's returned as the last 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 occurred 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 gives you access to over 100 popular, emerging, and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following actions:
1. On the Amazon Bedrock console, pick Model catalog under Foundation models in the pane.
At the time of composing this post, you can use the InvokeModel API to conjure up the design. It does not support Converse APIs and other Amazon Bedrock tooling.
2. Filter for DeepSeek as a supplier and pick the DeepSeek-R1 design.
The design detail page provides necessary details about the model's capabilities, rates structure, and application standards. You can discover detailed usage instructions, including sample API calls and code snippets for integration. The design supports numerous text generation tasks, including content development, code generation, and concern answering, utilizing its reinforcement discovering optimization and CoT thinking abilities.
The page also consists of release options and licensing details to assist you start with DeepSeek-R1 in your applications.
3. To begin using DeepSeek-R1, select Deploy.
You will be prompted to configure the deployment details for DeepSeek-R1. The model ID will be pre-populated.
4. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters).
5. For Variety of circumstances, get in a number of instances (between 1-100).
6. For example type, choose your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is suggested.
Optionally, surgiteams.com you can set up sophisticated security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role approvals, and file encryption settings. For a lot of utilize cases, the default settings will work well. However, for production implementations, you may wish to review these settings to line up with your company's security and compliance requirements.
7. Choose Deploy to start using the model.
When the deployment is total, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock play ground.
8. Choose Open in play area to access an interactive user interface where you can try out different triggers and change model criteria like temperature level and optimum length.
When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimal outcomes. For instance, material for inference.
This is an exceptional way to explore the model's thinking and text generation capabilities before integrating it into your applications. The play area supplies instant feedback, helping you comprehend how the model reacts to various inputs and letting you tweak your triggers for optimal results.
You can quickly evaluate the design in the playground through the UI. However, to conjure up the released model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.
Run inference utilizing guardrails with the deployed DeepSeek-R1 endpoint
The following code example demonstrates how to carry out reasoning using a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo. After you have created the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime client, configures inference parameters, and sends a demand to create text based upon a user timely.
Deploy DeepSeek-R1 with SageMaker JumpStart
SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML options 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 deploy them into production using either the UI or SDK.
Deploying DeepSeek-R1 model through SageMaker JumpStart provides 2 practical methods: utilizing the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both methods to assist you select the method that best fits your requirements.
Deploy DeepSeek-R1 through SageMaker JumpStart UI
Complete the following actions to deploy DeepSeek-R1 utilizing SageMaker JumpStart:
1. On the SageMaker console, pick Studio in the navigation pane.
2. First-time users will be triggered to produce a domain.
3. On the SageMaker Studio console, select JumpStart in the navigation pane.
The model internet browser shows available designs, with details like the service provider name and design capabilities.
4. Search for DeepSeek-R1 to view the DeepSeek-R1 design card.
Each design card shows key details, including:
- Model name
- Provider name
Deleting the wiki page 'DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart' cannot be undone. Continue?