Vous n'êtes pas identifié.
Today, we are excited to announce 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 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 get started with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable steps to deploy the distilled versions of the models also.
Overview of DeepSeek-R1
DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that uses support discovering to improve thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential identifying function is its support knowing (RL) step, which was used to fine-tune the model's responses beyond the basic pre-training and tweak procedure. By incorporating RL, DeepSeek-R1 can adjust more effectively to user feedback and objectives, ultimately boosting both significance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, indicating it's geared up to break down complex inquiries and factor through them in a detailed manner. This guided reasoning process enables the design to produce more accurate, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT abilities, aiming to generate structured responses while concentrating on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has recorded the market's attention as a versatile text-generation model that can be integrated into different workflows such as agents, rational reasoning and data analysis jobs.
DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture allows activation of 37 billion parameters, allowing efficient reasoning by routing queries to the most pertinent specialist "clusters." This approach enables the model to concentrate on various problem 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 utilize an ml.p5e.48 xlarge circumstances to deploy the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.
DeepSeek-R1 distilled models bring the thinking capabilities 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 efficient models to mimic the habits and reasoning patterns of the larger DeepSeek-R1 model, using it as a teacher model.
You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest deploying this design with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous material, and assess designs against crucial safety requirements. At the time of composing this blog, for DeepSeek-R1 deployments 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 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 circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and confirm you're utilizing ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are deploying. To ask for photorum.eclat-mauve.fr a limitation boost, create a limit boost demand and reach out to your account team.
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) approvals to use Amazon Bedrock Guardrails. For directions, see Set up permissions to use guardrails for content filtering.
Implementing guardrails with the ApplyGuardrail API
Amazon Bedrock Guardrails allows you to introduce safeguards, prevent damaging material, and assess designs against essential safety requirements. You can carry out safety steps for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to assess user inputs and model responses released 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 circulation includes 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 to the model for inference. After getting 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 suggesting the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following areas demonstrate inference utilizing this API.
Deploy DeepSeek-R1 in Amazon Bedrock Marketplace
Amazon Bedrock Marketplace offers 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, pick 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 doesn't support Converse APIs and other Amazon Bedrock tooling.
2. Filter for DeepSeek as a provider and pick the DeepSeek-R1 design.
The model detail page provides vital details about the design's capabilities, rates structure, and execution standards. You can discover detailed use instructions, including sample API calls and code bits for combination. The design supports different text generation jobs, consisting of content creation, code generation, and question answering, using its reinforcement finding out optimization and CoT thinking abilities.
The page likewise includes deployment choices and licensing details to help you start with DeepSeek-R1 in your applications.
3. To begin utilizing DeepSeek-R1, choose Deploy.
You will be prompted to set up the implementation details for DeepSeek-R1. The design ID will be pre-populated.
4. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters).
5. For Number of instances, go into a variety of circumstances (between 1-100).
6. For Instance type, pick your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended.
Optionally, you can set up advanced security and infrastructure settings, including virtual private cloud (VPC) networking, service role permissions, and encryption settings. For the majority of use cases, the default settings will work well. However, for production deployments, you might want to evaluate these settings to line up with your organization's security and compliance requirements.
7. Choose Deploy to begin using the model.
When the deployment is total, you can check DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground.
8. Choose Open in play area to access an interactive interface where you can try out various triggers and change design parameters like temperature and optimum length.
When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimal results. For example, <_begin_of_sentence_><_User_>material for inference<_Assistant_>.
This is an exceptional method to check out the model's thinking and text generation abilities before incorporating it into your applications. The play ground supplies immediate feedback, helping you understand how the model reacts to various inputs and letting you tweak your prompts for optimal outcomes.
You can rapidly test 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 released DeepSeek-R1 endpoint
The following code example demonstrates how to perform reasoning utilizing a deployed DeepSeek-R1 model through Amazon Bedrock using 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 actually produced the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures reasoning criteria, and sends a request to generate text based upon 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 usage case, with your information, and release them into production using either the UI or SDK.
Deploying DeepSeek-R1 design through SageMaker JumpStart offers two hassle-free approaches: using the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both methods to help you select the technique that best matches your requirements.
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 internet browser displays available designs, with details like the service provider name and design abilities.
4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card.
Each model card reveals essential details, including:
- Model name
- Provider name
- Task classification (for higgledy-piggledy.xyz example, Text Generation).
Bedrock Ready badge (if applicable), suggesting that this model can be signed up with Amazon Bedrock, permitting 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 company details.
Deploy button to release the model.
About and Notebooks tabs with detailed details
The About tab includes crucial details, such as:
- Model description.
- License details.
- Technical specs.
- Usage guidelines
Before you deploy the design, it's recommended to review the model details and license terms to verify compatibility with your use case.
6. Choose Deploy to proceed with implementation.
7. For Endpoint name, use the automatically generated name or develop a custom one.
8. For Instance type ¸ pick an instance type (default: ml.p5e.48 xlarge).
9. For Initial circumstances count, enter the number of instances (default: 1).
Selecting appropriate circumstances types and counts is essential for cost and efficiency optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time inference is chosen by default. This is enhanced for sustained traffic and low latency.
10. Review all configurations for accuracy. For this model, we highly recommend adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
11. Choose Deploy to deploy the model.
The release process can take a number of minutes to finish.
When deployment is total, your endpoint status will change to InService. At this moment, the model is all set to accept reasoning requests through the endpoint. You can keep an eye on the release development on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the implementation is total, you can conjure up the design utilizing a SageMaker runtime client and incorporate it with your applications.
Deploy DeepSeek-R1 utilizing the SageMaker Python SDK
To get going with DeepSeek-R1 using the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the necessary AWS permissions and environment setup. The following is a detailed code example that demonstrates how to release and use DeepSeek-R1 for inference programmatically. The code for deploying the design is provided in the Github here. You can clone the notebook and run from SageMaker Studio.
You can run extra requests against the predictor:
Implement guardrails and run reasoning with your SageMaker JumpStart predictor
Similar to Amazon Bedrock, you can likewise use 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 shown in the following code:
Tidy up
To avoid unwanted charges, finish the steps in this section to tidy up your resources.
Delete the Amazon Bedrock Marketplace deployment
If you deployed the model utilizing Amazon Bedrock Marketplace, complete the following actions:
1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace deployments.
2. In the Managed deployments area, find the endpoint you wish to delete.
3. Select the endpoint, and on the Actions menu, pick Delete.
4. Verify the endpoint details to make certain you're deleting the appropriate implementation: 1. Endpoint name.
2. Model name.
3. 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 wish to stop sustaining charges. For more details, see Delete Endpoints and Resources.
Conclusion
In this post, we checked out 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, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Starting with Amazon SageMaker JumpStart.
About the Authors
Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI business build ingenious options utilizing AWS services and accelerated calculate. Currently, he is concentrated on developing methods for fine-tuning and optimizing the inference efficiency of big language models. In his complimentary time, Vivek delights in treking, viewing films, and trying various cuisines.
Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team at AWS. His location of focus is AWS AI accelerators (AWS Neuron). He holds a Bachelor's degree in Computer Science and Bioinformatics.
Jonathan Evans is a Professional Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.
Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about building solutions that help customers accelerate their AI journey and unlock organization worth.
Hors ligne