1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Alycia Clifford edited this page 2025-02-06 21:33:48 +01: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 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, together with the distilled versions ranging from 1.5 to 70 billion criteria to build, experiment, and responsibly scale your generative AI ideas on AWS.

In this post, we show how to get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable 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 utilizes reinforcement learning to boost reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A key differentiating feature is its reinforcement knowing (RL) action, which was used to refine the model's responses beyond the basic pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adapt better to user feedback and goals, ultimately boosting both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, meaning it's geared up to break down complex queries and factor through them in a detailed way. This assisted thinking procedure allows the design to produce more accurate, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to create structured actions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually captured the industry's attention as a flexible text-generation design that can be integrated into various workflows such as agents, rational thinking and data analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion specifications, enabling efficient reasoning by routing questions to the most relevant specialist "clusters." This approach enables the model to concentrate on various problem domains while maintaining general efficiency. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances to release the model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking 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 efficient models to imitate the habits and reasoning patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor design.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend releasing this model with guardrails in place. In this blog, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent harmful content, and assess designs against essential 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 several guardrails tailored to different use cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you require access to an ml.p5e instance. To check 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 use. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are deploying. To request a limit boost, develop a limitation increase request and reach out to your account group.

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) permissions to use Amazon Bedrock Guardrails. For directions, see Establish permissions to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid harmful content, and assess models against essential safety requirements. You can carry out precaution for engel-und-waisen.de the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to assess user inputs and design reactions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo.

The general flow involves 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 model for inference. After getting the design's output, another guardrail check is used. If the output passes this final check, it's returned as the final result. However, if either the input or output is stepped in by the guardrail, a message is returned suggesting the nature of the intervention and whether it took place 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 gives you access to over 100 popular, emerging, and specialized foundation models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following steps:

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 utilize the InvokeModel API to invoke the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and select the DeepSeek-R1 model.

The model detail page supplies necessary details about the model's abilities, rates structure, and implementation guidelines. You can find detailed usage directions, including sample API calls and code bits for integration. The model supports different text generation jobs, including content production, code generation, and concern answering, utilizing its support finding out optimization and CoT thinking abilities. The page also consists of release choices and licensing details to help you get started with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, pick Deploy.

You will be triggered to set up the release details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters). 5. For Number of instances, go into a number of instances (between 1-100). 6. For example type, choose your instance type. For optimum efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure sophisticated security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role consents, and encryption settings. For the majority of utilize cases, the default settings will work well. However, for production deployments, you may wish to review these settings to line up 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 playground. 8. Choose Open in play area to access an interactive user interface where you can experiment with various prompts and change model parameters 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, material for inference.

This is an outstanding way to check out the model's reasoning and text generation abilities before integrating it into your applications. The play area supplies instant feedback, helping you understand how the model reacts to different inputs and letting you fine-tune your triggers for optimal outcomes.

You can rapidly evaluate the model in the play area through the UI. However, to conjure up the released design programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run inference using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to carry out inference utilizing a released DeepSeek-R1 model through Amazon Bedrock utilizing 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 actually developed the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, and sends a demand to generate text based upon a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

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

Deploying DeepSeek-R1 model through SageMaker JumpStart provides 2 convenient techniques: utilizing the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both methods to assist you pick the technique that finest fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions to release DeepSeek-R1 utilizing SageMaker JumpStart:

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

The design web browser shows available designs, 35.237.164.2 with details like the company name and design abilities.

4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card. Each model card reveals crucial details, including:

- Model name

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

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

    The design details page consists of the following details:

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

    The About tab consists of essential details, such as:

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

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

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, use the instantly produced name or produce a custom one.
  1. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the number of instances (default: 1). Selecting appropriate circumstances types and counts is vital for expense and performance optimization. Monitor your release to change these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this design, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to deploy the model.

    The release process can take a number of minutes to finish.

    When deployment is complete, your endpoint status will change to InService. At this point, the design is ready to accept inference demands through the endpoint. You can monitor the release development on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the deployment is complete, you can conjure up the design using a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get begun with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the necessary AWS approvals and environment setup. The following is a detailed code example that demonstrates how to release and use DeepSeek-R1 for reasoning programmatically. The code for deploying the design is supplied in the Github here. You can clone the note pad 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 use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail using the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Clean up

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

    Delete the Amazon Bedrock Marketplace release

    If you released the design utilizing Amazon Bedrock Marketplace, total the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace releases.
  5. In the Managed releases area, locate the endpoint you desire to erase.
  6. Select the endpoint, and on the Actions menu, choose Delete.
  7. Verify the endpoint details to make certain you're erasing the correct deployment: 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 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, SageMaker JumpStart pretrained models, 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 services using AWS services and accelerated calculate. Currently, he is focused on developing techniques for fine-tuning and enhancing the reasoning efficiency of large language models. In his downtime, Vivek enjoys treking, watching movies, and attempting 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 Bioinformatics.

    Jonathan Evans is a Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

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