1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
anastasiapenne edited this page 2025-03-01 04:57:38 +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 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, along with the distilled variations varying from 1.5 to 70 billion criteria to develop, experiment, and properly scale your generative AI concepts on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that utilizes reinforcement discovering to improve reasoning capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key distinguishing feature is its reinforcement knowing (RL) action, which was used to improve the design's reactions beyond the basic pre-training and fine-tuning process. By incorporating RL, wiki.dulovic.tech DeepSeek-R1 can adapt more efficiently to user feedback and goals, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, meaning it's equipped to break down complex questions and factor through them in a detailed manner. This guided thinking process permits the model to produce more precise, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to generate structured actions while concentrating on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has caught the industry's attention as a flexible text-generation model that can be incorporated into different workflows such as representatives, rational thinking and data analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion criteria, making it possible for efficient inference by routing queries to the most relevant professional "clusters." This method allows the model to specialize in different issue domains while maintaining overall performance. DeepSeek-R1 requires at least 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 offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning capabilities 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 describes a process of training smaller sized, more efficient designs to imitate the habits and reasoning patterns of the bigger DeepSeek-R1 model, utilizing it as a teacher design.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest deploying this model with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, avoid harmful material, and assess models against essential safety 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 create numerous guardrails tailored to various use cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you need access to an ml.p5e instance. 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 usage. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are releasing. To ask for a limitation increase, create a limit boost demand and connect to your account team.

Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the proper AWS Identity and Gain Access To Management (IAM) permissions to utilize Amazon Bedrock Guardrails. For directions, ratemywifey.com see Establish authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid harmful content, and assess designs against key security criteria. You can implement safety measures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to evaluate user inputs and design responses released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create a guardrail utilizing the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo.

The general circulation includes 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 applied. If the output passes this final 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 occurred at the input or output stage. The examples showcased in the following areas demonstrate reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following actions:

1. On the Amazon Bedrock console, pick Model catalog under Foundation designs in the navigation pane. At the time of composing this post, you can use the InvokeModel API to invoke the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and choose the DeepSeek-R1 design.

The model detail page provides important details about the design's abilities, pricing structure, and implementation guidelines. You can find detailed use directions, including sample API calls and code bits for combination. The design supports numerous text generation tasks, including material development, code generation, and question answering, utilizing its reinforcement discovering optimization and CoT thinking capabilities. The page likewise consists of implementation alternatives and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, pick 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, enter an endpoint name (in between 1-50 alphanumeric characters). 5. For Variety of circumstances, get in a number of circumstances (in between 1-100). 6. For Instance type, select your circumstances type. For optimum performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure sophisticated security and infrastructure settings, including virtual private cloud (VPC) networking, service function permissions, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production releases, you may wish to review these settings to align with your company's security and compliance requirements. 7. Choose Deploy to begin using the design.

When the implementation is complete, you can check 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 triggers and adjust model specifications like temperature and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimal results. For example, material for inference.

This is an outstanding method to explore the design's thinking and text generation abilities before integrating it into your applications. The playground provides instant feedback, helping you understand how the model reacts to various inputs and letting you fine-tune your triggers for ideal results.

You can rapidly test the model in the playground through the UI. However, to invoke the released design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to perform reasoning using a released DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo. After you have created the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, and sends out a request to create text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, integrated algorithms, and prebuilt ML options that you can deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your data, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart provides 2 hassle-free methods: using the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both methods to assist you choose the method that best suits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The model web browser displays available designs, with details like the supplier name and design capabilities.

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

- Model name

  • Provider name
  • Task classification (for example, Text Generation). Bedrock Ready badge (if suitable), suggesting that this model can be registered with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to invoke the model

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

    The design details page includes the following details:

    - The design name and provider details. Deploy button to deploy 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 design, it's recommended to examine the model details and license terms to validate compatibility with your use case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the automatically generated name or produce a customized one.
  1. For Instance type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the variety of circumstances (default: 1). Selecting suitable instance types and counts is crucial for expense and efficiency optimization. Monitor your release 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 configurations for precision. For this design, we highly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to deploy the design.

    The deployment process can take numerous minutes to complete.

    When release is total, your endpoint status will alter to InService. At this point, the design is ready to accept inference demands through the endpoint. You can keep track of the implementation progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the implementation is total, you can invoke the design using a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the needed AWS authorizations and environment setup. The following is a detailed code example that demonstrates how to deploy and use DeepSeek-R1 for reasoning programmatically. The code for deploying the model is provided in the Github here. You can clone the notebook and run from SageMaker Studio.

    You can run extra requests against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail utilizing the Amazon Bedrock console or the API, and implement it as shown in the following code:

    Tidy up

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

    Delete the Amazon Bedrock Marketplace release

    If you released the model using Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace implementations.
  5. In the Managed implementations area, find the endpoint you desire 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 proper release: 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 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 release the DeepSeek-R1 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get begun. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, surgiteams.com SageMaker JumpStart pretrained models, 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 assists emerging generative AI companies construct innovative options using AWS services and sped up calculate. Currently, he is concentrated on establishing methods for fine-tuning and optimizing the inference efficiency of large language models. In his spare time, Vivek takes pleasure in hiking, watching motion pictures, and trying different 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 technology and systemcheck-wiki.de 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 strategic partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about developing options that assist consumers accelerate their AI journey and unlock business value.