1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Adelaida Gurner edited this page 2025-03-12 23:04:53 +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 models 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 parameters to develop, experiment, and responsibly scale your generative AI concepts on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that uses reinforcement finding out to improve reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A key differentiating feature is its support knowing (RL) action, which was utilized to fine-tune the model's reactions beyond the standard pre-training and tweak process. By integrating RL, DeepSeek-R1 can adapt more efficiently to user feedback and objectives, ultimately improving both importance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, suggesting it's geared up to break down complicated questions and reason through them in a detailed way. This directed reasoning procedure allows the model to produce more accurate, transparent, and . This design integrates RL-based fine-tuning with CoT capabilities, aiming to create structured responses while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually recorded the industry's attention as a versatile text-generation model that can be incorporated into various workflows such as representatives, sensible reasoning and data analysis tasks.

DeepSeek-R1 utilizes a Mix 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 reasoning by routing queries to the most pertinent specialist "clusters." This technique permits the design to concentrate on various issue domains while maintaining general efficiency. DeepSeek-R1 requires 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 deploy the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning abilities of the main R1 model to more effective architectures based on 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 efficient models to mimic the habits and reasoning patterns of the larger DeepSeek-R1 design, utilizing 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 advise deploying this design with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, avoid harmful material, and assess models against essential security requirements. At the time of composing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce multiple guardrails tailored to different usage cases and apply them to the DeepSeek-R1 model, improving user experiences and standardizing safety controls throughout 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, choose Amazon SageMaker, and validate 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 releasing. To request a limit boost, develop a limit boost request and reach out 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) authorizations to use Amazon Bedrock Guardrails. For instructions, see Set up permissions to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, avoid hazardous content, and examine designs against key safety criteria. You can execute safety procedures for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to evaluate user inputs and design 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 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 to the model for reasoning. After getting the design's output, another guardrail check is applied. If the output passes this final check, it's returned as the last result. However, if either the input or output is intervened by the guardrail, a message is returned indicating the nature of the intervention and whether it occurred at the input or output stage. The examples showcased in the following sections show reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides 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, choose Model catalog under Foundation designs in the navigation pane. At the time of writing this post, you can utilize the InvokeModel API to invoke the model. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a provider and select the DeepSeek-R1 design.

The design detail page provides vital details about the design's abilities, rates structure, and execution standards. You can discover detailed use directions, including sample API calls and code snippets for combination. The model supports numerous text generation jobs, including material creation, code generation, and concern answering, using its support discovering optimization and CoT reasoning capabilities. The page also includes implementation options and licensing details to assist you get begun with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, pick Deploy.

You will be triggered to configure the implementation details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of instances, get in a variety of instances (in between 1-100). 6. For example type, pick your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can configure innovative security and demo.qkseo.in facilities settings, consisting of virtual private cloud (VPC) networking, service role permissions, and encryption settings. For the majority of utilize cases, the default settings will work well. However, for production implementations, you might desire to review these settings to line up with your organization's security and compliance requirements. 7. Choose Deploy to start using the design.

When the deployment is complete, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in playground to access an interactive interface where you can experiment with various triggers and change model criteria like temperature and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for ideal results. For example, content for reasoning.

This is an exceptional way to check out the design's thinking and text generation abilities before integrating it into your applications. The play area provides instant feedback, helping you understand how the design reacts to various inputs and letting you fine-tune your triggers for optimal results.

You can quickly evaluate the design in the play ground through the UI. However, to conjure up the released 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 carry out inference using a deployed 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 develop the guardrail, see the GitHub repo. After you have developed the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime client, hb9lc.org sets up reasoning specifications, and sends a request to generate text based on a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML solutions that you can deploy with just a couple of 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 model through SageMaker JumpStart offers two hassle-free methods: utilizing the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's check out both techniques to assist you pick the method that finest fits 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, select Studio in the navigation pane. 2. First-time users will be prompted to create a domain. 3. On the SageMaker Studio console, choose JumpStart in the navigation pane.

The model internet browser shows available designs, with details like the service provider name and design capabilities.

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

- Model name

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

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

    The design details page consists of the following details:

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

    The About tab consists of important details, hb9lc.org such as:

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

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

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, use the immediately produced name or develop a custom-made one.
  1. For example type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the variety of circumstances (default: bytes-the-dust.com 1). Selecting appropriate circumstances types and counts is vital for expense and pipewiki.org performance optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this design, we highly advise sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to deploy the model.

    The implementation process can take a number of minutes to complete.

    When release is complete, your endpoint status will alter to InService. At this point, the model is ready to accept inference requests through the endpoint. You can monitor genbecle.com the release progress on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the deployment is complete, you can conjure up the model using a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To begin with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the required AWS approvals 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 model is offered in the Github here. You can clone the note pad and run 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 utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail using the Amazon Bedrock console or the API, and implement it as revealed in the following code:

    Tidy up

    To prevent unwanted charges, complete the steps in this area to clean up your resources.

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace deployments.
  5. In the Managed releases section, locate the endpoint you want 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 release: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you released will sustain costs if you leave it running. Use the following code to delete the endpoint if you want to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we explored how you can access and release the DeepSeek-R1 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. 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 Getting going with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI companies construct innovative options utilizing AWS services and sped up calculate. Currently, he is concentrated on establishing strategies for fine-tuning and enhancing the inference efficiency of big language designs. In his free time, Vivek delights in treking, watching movies, and trying various cuisines.

    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 technology and Bioinformatics.

    Jonathan Evans is an Expert 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 center. She is enthusiastic about building services that help clients accelerate their AI journey and unlock company worth.