1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
helainemcgrath edited this page 2025-04-07 01:16:24 +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 delighted 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 model, DeepSeek-R1, together with the distilled versions ranging from 1.5 to 70 billion parameters to construct, experiment, and properly scale your generative AI ideas on AWS.

In this post, we demonstrate how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled variations of the designs too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that utilizes support discovering to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial differentiating function is its support knowing (RL) action, which was utilized to fine-tune the model's responses beyond the basic pre-training and tweak procedure. By including RL, DeepSeek-R1 can adjust more successfully to user feedback and goals, ultimately boosting both importance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, 89u89.com meaning it's geared up to break down complicated inquiries and factor through them in a detailed manner. This guided thinking procedure enables the model to produce more accurate, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT abilities, aiming to create structured responses while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has caught the market's attention as a versatile text-generation model that can be incorporated into different workflows such as agents, sensible thinking and information analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion parameters, making it possible for effective inference by routing inquiries to the most appropriate specialist "clusters." This technique enables the design to concentrate on different problem domains while maintaining overall effectiveness. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use 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 model to more efficient architectures based on popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a procedure of training smaller sized, more effective designs to simulate the habits and thinking patterns of the bigger DeepSeek-R1 design, using it as a teacher model.

You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise deploying this design with guardrails in place. In this blog, we will utilize Amazon Bedrock Guardrails to present safeguards, avoid damaging material, and assess models against key safety criteria. At the time of composing this blog site, for wavedream.wiki DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop multiple guardrails tailored to various usage cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To deploy 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, 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 a limit increase, develop a limitation increase demand and connect 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) permissions to utilize Amazon Bedrock Guardrails. For guidelines, see Establish permissions to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, prevent damaging content, and assess designs against crucial safety requirements. You can execute security measures for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to assess 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 produce the guardrail, see the GitHub repo.

The general flow involves 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 out to the design for reasoning. After getting the model's output, another guardrail check is used. If the output passes this last check, it's returned as the outcome. However, if either the input or output is intervened by the guardrail, a message is returned indicating the nature of the intervention and surgiteams.com whether it occurred at the input or output phase. The examples showcased in the following areas demonstrate reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers 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 models in the navigation pane. At the time of writing this post, setiathome.berkeley.edu you can use the InvokeModel API to conjure up the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a supplier and pick the DeepSeek-R1 model.

The design detail page provides essential details about the model's abilities, pricing structure, and implementation guidelines. You can discover detailed usage guidelines, consisting of sample API calls and hb9lc.org code bits for combination. The design supports numerous text generation tasks, consisting of material development, code generation, and concern answering, utilizing its support learning optimization and CoT reasoning abilities. The page also consists of release choices and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To start 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 (between 1-50 alphanumeric characters). 5. For Variety of circumstances, enter a number of instances (between 1-100). 6. For hb9lc.org example type, select your instance type. For ideal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure sophisticated security and facilities settings, including virtual personal cloud (VPC) networking, service function consents, and encryption settings. For most use cases, the default settings will work well. However, for production deployments, you might wish to evaluate these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to begin using the model.

When the implementation is complete, you can test DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in play ground to access an interactive user interface where you can explore various prompts and change model parameters like temperature level and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for ideal results. For example, material for inference.

This is an excellent method to explore the design's reasoning and text generation abilities before incorporating it into your applications. The play area supplies instant feedback, helping you comprehend how the model responds to different inputs and letting you fine-tune your prompts for optimum outcomes.

You can rapidly check the model in the play ground 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 shows how to carry out reasoning using a released DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can produce 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 inference parameters, and sends a demand to create text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, wiki.snooze-hotelsoftware.de integrated algorithms, and prebuilt ML options that you can deploy with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs 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 practical techniques: using the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both methods to help you select the technique that finest suits 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 prompted to create a domain. 3. On the SageMaker Studio console, pick JumpStart in the navigation pane.

The design browser shows available designs, with details like the supplier name and design abilities.

4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card. Each design card reveals essential details, consisting of:

- Model name

  • Provider name
  • Task classification (for example, Text Generation). Bedrock Ready badge (if suitable), showing that this design can be registered with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to conjure up the design

    5. Choose the model card to view the design details page.

    The design details page consists of 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 consists of crucial details, such as:

    - Model description.
  • License details.
  • Technical specifications.
  • Usage guidelines

    Before you release the design, it's suggested to examine the model details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, utilize the automatically produced name or develop a custom one.
  1. For Instance type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the variety of instances (default: 1). Selecting proper instance types and counts is essential for cost and performance optimization. Monitor your to adjust these settings as needed.Under Inference type, Real-time inference is chosen by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this design, we strongly advise sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to release 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 point, the design is ready to accept inference requests through the endpoint. You can keep track of the implementation progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the deployment is complete, you can invoke the design using a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the required AWS permissions and environment setup. The following is a detailed code example that demonstrates how to deploy and utilize 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 additional requests against the predictor:

    Implement guardrails and 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 produce a guardrail utilizing the Amazon Bedrock console or the API, and execute it as shown in the following code:

    Clean up

    To prevent unwanted charges, finish the steps in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you deployed the design using Amazon Bedrock Marketplace, total the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace implementations.
  5. In the Managed deployments area, find the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, choose Delete.
  7. Verify the endpoint details to make certain you're erasing the right deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model 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 checked out how you can access and deploy the DeepSeek-R1 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained designs, 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 business build ingenious options utilizing AWS services and sped up calculate. Currently, he is concentrated on establishing methods for fine-tuning and enhancing the inference performance of large language designs. In his downtime, Vivek takes pleasure in treking, viewing movies, and attempting various foods.

    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 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 tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about developing options that help consumers accelerate their AI journey and unlock organization value.