1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
mariabyron8937 edited this page 2025-03-12 13:15:29 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.


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 deploy DeepSeek AI's first-generation frontier model, DeepSeek-R1, together with the distilled versions ranging from 1.5 to 70 billion parameters to develop, experiment, and properly scale your generative AI ideas on AWS.

In this post, we demonstrate how to get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to deploy the distilled variations of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that uses support discovering to enhance reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A key identifying feature is its support knowing (RL) action, which was utilized to improve the model's responses beyond the standard pre-training and tweak procedure. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and goals, ultimately enhancing both significance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, indicating it's geared up to break down complex questions and factor through them in a detailed manner. This assisted thinking procedure permits the design to produce more precise, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT abilities, aiming to generate structured actions while focusing on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has recorded the industry's attention as a versatile text-generation design that can be incorporated into different workflows such as representatives, sensible reasoning and data analysis jobs.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion criteria, enabling effective inference by routing queries to the most relevant specialist "clusters." This technique permits the design to focus on various problem domains while maintaining overall efficiency. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances to release the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking capabilities of the main R1 design to more effective architectures based on popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a process of training smaller, more efficient models to simulate the behavior and thinking patterns of the larger DeepSeek-R1 model, wavedream.wiki using it as a teacher model.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest deploying this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, avoid harmful material, and examine designs against essential security requirements. At the time of writing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop multiple guardrails tailored to different usage cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you need access to an ml.p5e instance. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and confirm you're using 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 releasing. To ask for a limit increase, create a limit increase request and reach out to your account group.

Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) approvals to use Amazon Bedrock Guardrails. For guidelines, see Establish authorizations to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, prevent damaging content, and evaluate models against key safety requirements. You can carry out security steps for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to evaluate user inputs and model responses 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 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 model for reasoning. After receiving the model'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 stepped in by the guardrail, a message is returned showing the nature of the intervention and whether it happened at the input or output stage. The examples showcased in the following areas demonstrate inference using 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, complete the following actions:

1. On the Amazon Bedrock console, select Model brochure under Foundation designs in the navigation pane. At the time of composing this post, you can use the InvokeModel API to conjure up the model. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and pick the DeepSeek-R1 model.

The model detail page provides vital details about the design's capabilities, prices structure, and execution standards. You can find detailed use directions, consisting of sample API calls and code bits for combination. The design supports numerous text generation tasks, including material production, code generation, and question answering, using its support discovering optimization and CoT thinking capabilities. The page also includes release options and licensing details to assist you start with DeepSeek-R1 in your applications. 3. To start utilizing 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 Variety of instances, go into a variety of instances (in between 1-100). 6. For example type, choose your circumstances type. For ideal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and facilities settings, wiki.myamens.com consisting of virtual private cloud (VPC) networking, service function consents, and encryption settings. For most utilize cases, the default settings will work well. However, for production implementations, you may desire to evaluate these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to begin utilizing the design.

When the release is complete, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in playground to access an interactive interface where you can experiment with various prompts and adjust design parameters like temperature level and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimum results. For instance, content for reasoning.

This is an excellent method to explore the model's thinking and text generation abilities before incorporating it into your applications. The play area supplies immediate feedback, helping you comprehend how the design reacts to different inputs and letting you tweak your prompts for ideal outcomes.

You can rapidly test the design in the play area through the UI. However, to invoke 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 shows how to perform reasoning utilizing a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. 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. After you have actually developed the guardrail, utilize the following code to . The script initializes the bedrock_runtime client, configures inference parameters, and sends 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, built-in algorithms, and prebuilt ML options that you can release with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, hb9lc.org and release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart offers 2 convenient approaches: using the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both methods to assist you choose the approach that best matches your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following steps to deploy DeepSeek-R1 using SageMaker JumpStart:

1. On the SageMaker console, pick Studio in the navigation pane. 2. First-time users will be prompted to produce a domain. 3. On the SageMaker Studio console, choose JumpStart in the navigation pane.

The model web browser displays available models, with details like the company name and model capabilities.

4. Search for DeepSeek-R1 to see the DeepSeek-R1 design card. Each model card reveals crucial details, consisting of:

- Model name

  • Provider name
  • Task classification (for instance, Text Generation). Bedrock Ready badge (if appropriate), suggesting that this design can be registered with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to conjure up the design

    5. Choose the model card to see the model details page.

    The design details page includes the following details:

    - The model name and company details. Deploy button to deploy the design. About and Notebooks tabs with detailed details

    The About tab includes essential details, such as:

    - Model description.
  • License details. - Technical requirements.
  • Usage standards

    Before you release the model, it's suggested to review the design details and license terms to confirm compatibility with your use case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, use the automatically generated name or produce a custom one.
  1. For Instance type ¸ select an instance type (default: wiki.myamens.com ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the number of circumstances (default: 1). Selecting suitable circumstances types and counts is crucial for expense and efficiency optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all setups for accuracy. For this design, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to release the model.

    The deployment procedure can take several minutes to complete.

    When implementation is total, your endpoint status will change to InService. At this point, the model is all set to accept inference demands through the endpoint. You can keep an eye on the implementation progress on the SageMaker console Endpoints page, which will show 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 using the SageMaker Python SDK

    To get started 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 design is provided in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run additional requests against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail utilizing 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 section to clean up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you released the design using Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace releases.
  5. In the Managed releases area, find the endpoint you want to delete.
  6. Select the endpoint, and on the Actions menu, pick Delete.
  7. Verify the endpoint details to make certain you're deleting the proper deployment: 1. Endpoint name.
  8. Model name.
  9. 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 deploy the DeepSeek-R1 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. 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 Beginning with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI companies build ingenious options utilizing AWS services and sped up compute. Currently, he is concentrated on establishing techniques for fine-tuning and optimizing the inference efficiency of big language models. In his downtime, Vivek enjoys hiking, seeing motion pictures, and attempting different foods.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team at AWS. His area 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 working on generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads item, bytes-the-dust.com engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about constructing services that assist customers accelerate their AI journey and unlock service worth.