1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Abbie Hubert edited this page 2025-03-05 17:14:54 +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 thrilled 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 variations varying from 1.5 to 70 billion specifications to develop, experiment, and responsibly scale your generative AI concepts on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes support learning to boost thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential differentiating function is its reinforcement knowing (RL) action, which was used to improve the model's reactions beyond the standard pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adapt better to user feedback and objectives, ultimately enhancing both significance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, indicating it's geared up to break down intricate queries and factor through them in a detailed way. This assisted thinking procedure enables the design to produce more precise, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT abilities, aiming to create structured responses while focusing on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has captured the market's attention as a flexible text-generation design that can be incorporated into numerous workflows such as representatives, logical thinking and data analysis jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture allows activation of 37 billion parameters, making it possible for efficient inference by routing questions to the most pertinent expert "clusters." This method enables the design to specialize in various problem domains while maintaining overall effectiveness. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge instance to deploy the design. ml.p5e.48 xlarge comes with 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 efficient architectures based upon popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a process of training smaller, more effective designs to simulate the habits and thinking patterns of the larger DeepSeek-R1 model, using it as an instructor design.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend deploying this model with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent harmful content, and examine designs against essential security criteria. At the time of writing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop multiple guardrails tailored to different use cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you need access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and confirm you're utilizing 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 deploying. To ask for a limit increase, produce a request and engel-und-waisen.de connect to your account group.

Because you will be releasing this design with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) consents to utilize Amazon Bedrock Guardrails. For guidelines, see Set up consents to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, avoid hazardous material, and evaluate designs against essential safety requirements. You can carry out precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and model reactions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, wiki.lafabriquedelalogistique.fr see the GitHub repo.

The general circulation includes the following actions: 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 inference. After receiving the design's output, another guardrail check is applied. 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 suggesting the nature of the intervention and whether it took place 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 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, complete 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, you can use the InvokeModel API to invoke the model. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and select the DeepSeek-R1 model.

The model detail page provides necessary details about the design's capabilities, prices structure, and implementation standards. You can find detailed use guidelines, consisting of sample API calls and code bits for combination. The model supports various text generation jobs, wavedream.wiki consisting of material development, wiki.whenparked.com code generation, and concern answering, utilizing its reinforcement finding out optimization and CoT reasoning abilities. The page likewise consists of implementation alternatives and licensing details to assist you get started with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, choose Deploy.

You will be triggered 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 instances, get in a number of circumstances (between 1-100). 6. For example type, select your instance type. For ideal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can configure innovative security and infrastructure settings, pediascape.science consisting of virtual private cloud (VPC) networking, service function consents, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production deployments, you might desire to review these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to begin utilizing the design.

When the deployment is complete, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock play area. 8. Choose Open in play ground to access an interactive user interface where you can explore different prompts and adjust design specifications like temperature and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimum results. For instance, material for reasoning.

This is an outstanding method to explore the model's reasoning and text generation abilities before incorporating it into your applications. The playground provides instant feedback, helping you comprehend how the design reacts to different inputs and letting you fine-tune your prompts for optimal outcomes.

You can rapidly evaluate the design in the play ground through the UI. However, to invoke the deployed model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run inference using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to perform inference utilizing a released DeepSeek-R1 model through Amazon Bedrock utilizing 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 client, configures reasoning criteria, and sends a demand to create 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 solutions that you can release with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your information, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart offers two hassle-free methods: utilizing the instinctive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you choose the approach that finest fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions to release DeepSeek-R1 using SageMaker JumpStart:

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

The model internet browser displays available designs, with details like the supplier name and model abilities.

4. Search for DeepSeek-R1 to see the DeepSeek-R1 model card. Each design card shows key details, including:

- Model name

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

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

    The design details page includes the following details:

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

    The About tab includes important details, such as:

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

    Before you deploy the design, it's recommended to evaluate the model details and license terms to validate compatibility with your use case.

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, utilize the immediately created name or wakewiki.de create a customized one.
  1. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the variety of instances (default: 1). Selecting suitable instance types and counts is vital for expense and performance optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for precision. For this model, we strongly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to deploy the design.

    The deployment process can take a number of minutes to finish.

    When implementation is total, your endpoint status will alter to InService. At this point, the model is ready to accept inference demands through the endpoint. You can keep an eye on the release progress on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the release is total, you can invoke the model utilizing a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To begin with DeepSeek-R1 using the SageMaker Python SDK, you will require 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 release and utilize DeepSeek-R1 for inference programmatically. The code for deploying the design is supplied in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run extra demands against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also use 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 displayed in the following code:

    Tidy up

    To avoid undesirable charges, complete the actions in this area 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, choose Marketplace releases.
  5. In the Managed implementations area, wavedream.wiki find the endpoint you wish to erase.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're deleting the correct implementation: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed will sustain expenses if you leave it running. Use the following code to delete the endpoint if you wish 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 model utilizing 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 models, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting started 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 construct ingenious services utilizing AWS services and accelerated calculate. Currently, he is concentrated on establishing methods for fine-tuning and enhancing the reasoning performance of big language models. In his free time, Vivek takes pleasure in hiking, enjoying films, and attempting various foods.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group at AWS. His area of focus is AWS AI accelerators (AWS Neuron). He holds a Bachelor's degree in Computer technology and Bioinformatics.

    Jonathan Evans is a Specialist Solutions Architect working on 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 hub. She is enthusiastic about constructing services that help clients accelerate their AI journey and unlock organization value.