1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
hoseawainscott edited this page 2025-02-20 03:04:32 +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 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 deploy DeepSeek AI's first-generation frontier model, DeepSeek-R1, in addition to the distilled variations ranging from 1.5 to 70 billion specifications to develop, experiment, and properly scale your generative AI concepts on AWS.

In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to release the distilled versions of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) established by DeepSeek AI that utilizes support learning to boost reasoning capabilities through a multi-stage training process from a DeepSeek-V3-Base structure. A key differentiating feature is its reinforcement knowing (RL) action, which was utilized to fine-tune the model's responses beyond the standard pre-training and tweak procedure. By integrating RL, DeepSeek-R1 can adapt better to user feedback and objectives, eventually improving both relevance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, meaning it's equipped to break down complicated inquiries and factor through them in a detailed manner. This directed reasoning process enables the design to produce more precise, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT abilities, aiming to produce structured responses while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually caught the market's attention as a flexible text-generation model that can be incorporated into different workflows such as representatives, logical reasoning and data interpretation tasks.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion specifications, allowing efficient reasoning by routing inquiries to the most relevant specialist "clusters." This technique allows the model to specialize in various problem domains while maintaining general performance. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances 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 thinking capabilities of the main R1 design to more efficient architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a procedure of training smaller, more efficient designs to imitate the habits and thinking patterns of the larger DeepSeek-R1 model, using it as an instructor design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest deploying this model with guardrails in place. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous material, and examine models against key safety requirements. At the time of writing this blog, for DeepSeek-R1 deployments 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 design, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you require access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, select 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 limitation increase, develop a limit boost request and connect to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, prevent harmful material, and assess designs against crucial security criteria. You can execute safety procedures for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and model actions deployed 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 produce the guardrail, see the GitHub repo.

The basic 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 design for reasoning. After getting the model's output, another guardrail check is used. If the output passes this final check, it's returned as the outcome. However, if either the input or output is intervened by the guardrail, a message is returned suggesting the nature of the intervention and wavedream.wiki 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 offers you access to over 100 popular, emerging, and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following actions:

1. On the Amazon Bedrock console, select Model catalog under Foundation models in the navigation pane. At the time of writing 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 supplier and choose the DeepSeek-R1 model.

The model detail page provides vital details about the design's abilities, rates structure, and implementation guidelines. You can find detailed use directions, consisting of sample API calls and code snippets for combination. The design supports different text generation jobs, consisting of content development, code generation, and concern answering, utilizing its reinforcement finding out optimization and CoT thinking capabilities. The page likewise includes implementation options and licensing details to assist you start with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, select 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 (between 1-50 alphanumeric characters). 5. For Number of circumstances, go into a variety of instances (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 recommended. Optionally, you can set up advanced security and facilities settings, including virtual private cloud (VPC) networking, service function consents, and file encryption settings. For many utilize cases, the default settings will work well. However, for production releases, you may wish to evaluate these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to begin using the design.

When the implementation is total, you can check DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground. 8. Choose Open in play area to access an interactive user interface where you can experiment with different triggers and adjust model specifications like temperature level and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimum results. For instance, content for reasoning.

This is an outstanding method to explore the design's reasoning and text generation capabilities before incorporating it into your applications. The playground provides instant feedback, assisting you understand how the design reacts to numerous inputs and letting you tweak your triggers for optimum outcomes.

You can rapidly check the design in the playground through the UI. However, to conjure up the deployed design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run reasoning utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to perform inference utilizing a deployed DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can create a guardrail using the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo. After you have created the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime customer, sets up inference criteria, and sends a request to produce text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, built-in 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 data, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart provides 2 practical approaches: using the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both techniques to assist you pick the approach that finest matches 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 triggered 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 supplier name and design abilities.

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

- Model name

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

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

    The design details page includes the following details:

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

    The About tab consists of crucial details, such as:

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

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

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the instantly generated name or produce a custom one.
  1. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the number of instances (default: 1). Selecting proper circumstances types and counts is crucial for cost and efficiency optimization. Monitor your deployment to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all setups for precision. For this design, we strongly advise adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to deploy the design.

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

    When deployment is complete, your endpoint status will alter to InService. At this point, the design is prepared to accept reasoning demands through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the release is total, you can invoke the model using a SageMaker runtime customer and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To begin with DeepSeek-R1 using the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the required AWS authorizations and environment setup. The following is a detailed code example that shows how to release and use DeepSeek-R1 for inference programmatically. The code for releasing the design is supplied 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 inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail using the Amazon Bedrock console or the API, and execute it as revealed in the following code:

    Tidy up

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

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace releases.
  5. In the Managed implementations section, find the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're erasing the appropriate release: 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 erase the endpoint if you wish to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we checked out 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 get going. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, surgiteams.com SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, genbecle.com and Starting with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging AI business construct innovative options utilizing AWS services and accelerated calculate. Currently, he is focused on developing techniques for fine-tuning and optimizing the reasoning efficiency of big language designs. In his totally free time, Vivek delights in hiking, seeing films, and attempting different cuisines.

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

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

    Banu Nagasundaram leads product, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about developing services that assist consumers accelerate their AI journey and unlock company worth.