1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
darcybroinowsk edited this page 2025-04-06 18:16:34 +02: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 announce that DeepSeek R1 distilled Llama and Qwen models are available through Amazon Bedrock Marketplace and Amazon SageMaker JumpStart. With this launch, you can now deploy DeepSeek AI's first-generation frontier design, DeepSeek-R1, along with the distilled variations varying from 1.5 to 70 billion specifications to develop, 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 versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) established by DeepSeek AI that utilizes reinforcement finding out to improve reasoning capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial identifying feature is its reinforcement learning (RL) action, which was used to refine the design's reactions beyond the standard pre-training and tweak procedure. By integrating RL, DeepSeek-R1 can adapt more effectively to user feedback and objectives, ultimately boosting both importance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, suggesting it's equipped to break down complicated questions and factor through them in a detailed manner. This guided reasoning process allows the model to produce more accurate, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT abilities, aiming to create structured responses while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has recorded the industry's attention as a versatile text-generation model that can be integrated into numerous workflows such as agents, logical thinking and data interpretation jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion specifications, enabling effective reasoning by routing queries to the most pertinent expert "clusters." This technique permits the design to concentrate on different issue domains while maintaining total performance. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will use an ml.p5e.48 xlarge circumstances to release the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning abilities 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 refers to a process of training smaller sized, more effective designs to imitate the habits and thinking patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor model.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest releasing this design with guardrails in location. In this blog, we will utilize Amazon Bedrock Guardrails to introduce safeguards, avoid damaging content, and evaluate models against crucial safety requirements. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce numerous guardrails tailored to various use cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you need access to an ml.p5e instance. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and verify you're using ml.p5e.48 xlarge for endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are releasing. To request a limit boost, create a limit boost request and reach out to your account team.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) authorizations to utilize Amazon Bedrock Guardrails. For instructions, see Set up approvals to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, avoid harmful content, and examine designs against key safety criteria. You can carry out precaution for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to evaluate user inputs and model reactions 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 develop the guardrail, see the GitHub repo.

The general circulation involves the following steps: First, the system gets 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 getting the model's output, another guardrail check is applied. If the output passes this last check, it's returned as the result. However, if either the input or output is intervened 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 show inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides 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, pick Model brochure under Foundation models in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to conjure up the model. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and choose the DeepSeek-R1 model.

The design detail page supplies necessary details about the design's capabilities, pricing structure, and application standards. You can discover detailed use guidelines, including sample API calls and code snippets for combination. The design supports different text generation tasks, consisting of material development, code generation, and question answering, utilizing its reinforcement finding out optimization and CoT reasoning abilities. The page likewise includes deployment options and licensing details to help you get begun with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, choose Deploy.

You will be prompted to configure the deployment details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters). 5. For Variety of circumstances, enter a number of circumstances (between 1-100). 6. For example type, pick your circumstances type. For optimum performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, you can set up innovative security and infrastructure settings, including virtual private cloud (VPC) networking, service role approvals, and file encryption settings. For many utilize cases, the default settings will work well. However, for production deployments, you may wish to examine these settings to align 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 abilities straight in the Amazon Bedrock playground. 8. Choose Open in play area to access an interactive user interface where you can explore different triggers and change design criteria like temperature level and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimum results. For instance, material for inference.

This is an excellent method to check out the design's thinking and text generation abilities before integrating it into your applications. The play ground supplies instant feedback, assisting you understand how the design responds to numerous inputs and letting you tweak your prompts for ideal results.

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

Run inference utilizing guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to carry out 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 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 customer, sets up reasoning criteria, and sends out a demand to create text based upon a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, built-in algorithms, and prebuilt ML services that you can release with simply a couple of 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 uses two convenient techniques: utilizing the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both techniques to help you pick the approach that finest suits your needs.

Deploy DeepSeek-R1 through UI

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

1. On the SageMaker console, select 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 internet browser shows available designs, with details like the supplier name and design abilities.

4. Look for DeepSeek-R1 to see the DeepSeek-R1 design card. Each model card reveals essential details, including:

- Model name

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

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

    The model details page includes the following details:

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

    The About tab includes crucial details, such as:

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

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

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, use the instantly created name or produce a custom one.
  1. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the variety of instances (default: 1). Selecting suitable circumstances types and counts is crucial for cost and performance optimization. Monitor your deployment to adjust 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 precision. For this design, we strongly recommend sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to deploy the model.

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

    When release is complete, your endpoint status will change to InService. At this moment, the design is all set to accept reasoning requests through the endpoint. You can keep track of the implementation progress on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the release is total, you can conjure up the model 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 approvals and environment setup. The following is a detailed code example that shows how to deploy and use DeepSeek-R1 for inference programmatically. The code for releasing the model is provided in the Github here. You can clone the notebook and run from SageMaker Studio.

    You can run additional 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 develop a guardrail utilizing the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Tidy up

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

    Delete the Amazon Bedrock Marketplace implementation

    If you released the model utilizing Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace implementations.
  5. In the Managed deployments area, find the endpoint you desire to delete.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're deleting the appropriate implementation: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed will sustain expenses 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 checked out how you can access and systemcheck-wiki.de deploy the DeepSeek-R1 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, 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 assists emerging generative AI companies develop ingenious solutions using AWS services and accelerated calculate. Currently, he is focused on developing methods for fine-tuning and optimizing the reasoning performance of big language designs. In his downtime, Vivek takes pleasure in treking, seeing films, 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 dealing with generative AI with the Third-Party Model Science group 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 options that assist consumers accelerate their AI journey and unlock company worth.