1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
lonna10c67355 edited this page 2025-04-08 19:05:28 +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 model, DeepSeek-R1, in addition to the distilled versions varying from 1.5 to 70 billion criteria to build, experiment, and properly scale your generative AI concepts on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that uses reinforcement learning to improve thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential identifying function is its reinforcement learning (RL) action, which was used to fine-tune the design's reactions beyond the basic pre-training and tweak procedure. By integrating RL, DeepSeek-R1 can adapt more effectively to user feedback and goals, eventually enhancing both relevance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, implying it's equipped to break down complicated queries and factor through them in a detailed way. This directed reasoning process enables the model to produce more precise, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT capabilities, aiming to create structured reactions while concentrating on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has actually captured the market's attention as a versatile text-generation model that can be integrated into numerous workflows such as agents, rational thinking and data interpretation tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture enables activation of 37 billion criteria, making it possible for effective inference by routing inquiries to the most pertinent professional "clusters." This approach allows the design to specialize in various issue domains while maintaining overall effectiveness. DeepSeek-R1 needs 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 includes 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking abilities of the main R1 design to more effective architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller, more effective models to mimic the behavior and thinking patterns of the bigger DeepSeek-R1 model, using 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, we will use Amazon Bedrock Guardrails to present safeguards, avoid hazardous material, and examine designs against crucial safety criteria. At the time of composing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create multiple guardrails tailored to various use cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you require access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas and under AWS Services, select Amazon SageMaker, and confirm 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 deploying. To ask for a limit increase, develop a limitation increase request and reach out to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, avoid harmful content, and evaluate models against key safety requirements. You can carry out security measures for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to evaluate user inputs and design actions released 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 general circulation includes the following actions: First, the system gets an input for wiki.asexuality.org the model. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent to the design for reasoning. After receiving the design's output, another guardrail check is used. If the output passes this final check, it's returned as the result. However, if either the input or output is stepped in by the guardrail, a message is returned indicating the nature of the intervention and whether it took place at the input or output phase. The examples showcased in the following areas show reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized foundation models (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 brochure under Foundation models in the navigation pane. At the time of composing this post, 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 company and pick the DeepSeek-R1 model.

The design detail page supplies necessary details about the design's capabilities, pricing structure, and implementation guidelines. You can find detailed usage guidelines, consisting of sample API calls and code bits for integration. The model supports different text generation tasks, consisting of content development, code generation, and concern answering, using its support finding out optimization and CoT reasoning abilities. The page also includes deployment choices and licensing details to help you get going 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, enter a variety of circumstances (in between 1-100). 6. For Instance type, choose your instance type. For optimal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can configure innovative security and facilities settings, including virtual private cloud (VPC) networking, service role consents, and encryption settings. For the majority of use cases, the default settings will work well. However, for production implementations, you may wish to evaluate these settings to line up with your organization's security and compliance requirements. 7. Choose Deploy to start using the model.

When the release is total, you can check DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in play area to access an interactive user interface where you can experiment with various prompts and adjust design criteria like temperature and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for ideal outcomes. For example, content for inference.

This is an exceptional way to explore the model's thinking and text generation abilities before incorporating it into your applications. The playground supplies instant feedback, helping you comprehend how the model responds to various inputs and letting you fine-tune your triggers for optimum outcomes.

You can rapidly check the model in the play area through the UI. However, to invoke the deployed model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run inference utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to carry out reasoning utilizing a released DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can create a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo. After you have actually created the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures inference criteria, and sends a request to produce 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 deploy with just 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 provides two hassle-free approaches: using the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both approaches to help you choose the method that best matches your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions 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 produce a domain. 3. On the SageMaker Studio console, pick JumpStart in the navigation pane.

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

4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card. Each model card shows crucial details, consisting of:

- Model name

  • Provider name
  • Task classification (for instance, Text Generation). Bedrock Ready badge (if applicable), indicating that this design can be registered with Amazon Bedrock, permitting you to utilize Amazon Bedrock APIs to invoke the model

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

    The model details page includes the following details:

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

    The About tab consists of crucial details, such as:

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

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

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, use the instantly created name or create a customized one.
  1. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, enter the variety of instances (default: 1). Selecting proper instance types and counts is vital for expense and performance optimization. Monitor your deployment to adjust 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 configurations for precision. For this model, we strongly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to release the model.

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

    When release is total, your endpoint status will change to InService. At this moment, the design is prepared to accept inference demands through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the deployment is complete, you can conjure up the model utilizing a SageMaker runtime client and integrate 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 install the SageMaker Python SDK and make certain you have the required AWS consents and environment setup. The following is a detailed code example that shows how to release and utilize DeepSeek-R1 for inference programmatically. The code for releasing 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 likewise utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail using the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Clean up

    To avoid undesirable charges, finish the steps in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace implementations.
  5. In the Managed releases area, locate the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, pick Delete.
  7. Verify the endpoint details to make certain you're deleting the appropriate release: 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 erase 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 models, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting begun 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 build innovative solutions utilizing AWS services and sped up calculate. Currently, he is concentrated on establishing techniques for fine-tuning and enhancing the reasoning efficiency of large language designs. In his free time, Vivek takes pleasure in hiking, watching motion pictures, and trying 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 Science and Bioinformatics.

    Jonathan Evans is a Professional Solutions Architect working on generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads product, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about building solutions that assist clients accelerate their AI journey and unlock organization worth.