1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
alexandrialesc edited this page 2025-04-09 15:53:43 +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 reveal 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, along with the distilled versions ranging from 1.5 to 70 billion parameters to build, experiment, and properly scale your generative AI concepts on AWS.

In this post, we demonstrate how to get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable steps to deploy the distilled versions of the designs also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes reinforcement finding out to boost thinking abilities through a multi-stage training process from a DeepSeek-V3-Base structure. An essential distinguishing feature is its support knowing (RL) action, which was utilized to fine-tune the design's reactions beyond the standard pre-training and tweak procedure. By incorporating RL, DeepSeek-R1 can adjust more efficiently to user feedback and objectives, ultimately improving both importance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, meaning it's geared up to break down complex questions and reason through them in a detailed way. This directed reasoning process enables the model to produce more precise, transparent, and detailed answers. This design fine-tuning with CoT capabilities, aiming to create structured reactions while focusing on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has actually caught the industry's attention as a versatile text-generation design that can be integrated into numerous workflows such as agents, sensible thinking and information interpretation tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture allows activation of 37 billion criteria, enabling effective inference by routing questions to the most appropriate expert "clusters." This method enables the model to focus on different issue domains while maintaining total effectiveness. 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 reasoning capabilities of the main R1 design to more efficient architectures based upon popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a procedure of training smaller sized, more effective models to imitate the behavior and thinking patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor model.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise releasing this design with guardrails in place. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, prevent damaging content, and examine designs against key security requirements. At the time of writing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce numerous guardrails tailored to various use cases and apply them to the DeepSeek-R1 model, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, 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, select Amazon SageMaker, and confirm you're utilizing ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are deploying. To ask for a limitation boost, create a limitation increase request and reach out to your account group.

Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the proper AWS Identity and Gain Access To Management (IAM) approvals to use Amazon Bedrock Guardrails. For setiathome.berkeley.edu guidelines, see Set up authorizations to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, avoid hazardous content, and evaluate models against essential security criteria. You can implement safety measures for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to assess user inputs and design actions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo.

The basic circulation includes 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 to the model for reasoning. After receiving 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 stepped in by the guardrail, a message is returned showing the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following sections show inference 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, pick Model catalog under Foundation designs in the navigation pane. At the time of writing this post, you can use the InvokeModel API to conjure up the model. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a supplier and pick the DeepSeek-R1 design.

The design detail page provides necessary details about the model's capabilities, pricing structure, and application guidelines. You can find detailed usage guidelines, including sample API calls and code bits for integration. The design supports different text generation jobs, consisting of content production, code generation, and question answering, using its reinforcement learning optimization and CoT reasoning capabilities. The page also includes implementation options and licensing details to help you get started with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, choose Deploy.

You will be prompted to set up the release details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, photorum.eclat-mauve.fr get in an endpoint name (between 1-50 alphanumeric characters). 5. For Variety of circumstances, enter a variety of circumstances (in between 1-100). 6. For example type, pick your instance type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up sophisticated security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role consents, and file encryption settings. For the majority of use cases, the default settings will work well. However, for production deployments, you may desire to review these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start utilizing the model.

When the deployment is total, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock play ground. 8. Choose Open in play ground to access an interactive interface where you can experiment with various triggers and change design criteria like temperature and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimal outcomes. For example, material for reasoning.

This is an excellent way to explore the design's thinking and text generation capabilities before incorporating it into your applications. The playground offers immediate feedback, assisting you comprehend how the model reacts to different inputs and letting you tweak your triggers for ideal outcomes.

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

Run inference using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to carry out inference using a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can produce 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, use the following code to execute guardrails. The script initializes the bedrock_runtime client, configures reasoning criteria, and sends out a request to generate 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 options that you can deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart uses two hassle-free techniques: utilizing the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both approaches to assist you pick the technique 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, choose Studio in the navigation pane. 2. First-time users will be triggered to develop a domain. 3. On the SageMaker Studio console, select JumpStart in the navigation pane.

The design internet browser shows available models, with details like the company name and model abilities.

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

- Model name

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

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

    The model details page includes the following details:

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

    The About tab consists of essential details, such as:

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

    Before you deploy the design, it's suggested to examine the design details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, use the automatically produced name or produce a custom-made one.
  1. For Instance type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the variety of circumstances (default: 1). Selecting suitable circumstances types and counts is vital for cost and performance optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for precision. For this design, we strongly suggest adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to release the model.

    The deployment procedure can take numerous minutes to complete.

    When implementation is total, your endpoint status will alter to InService. At this point, the model is all set to accept reasoning requests through the endpoint. You can keep track of the release development on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the deployment is complete, you can conjure up the design utilizing a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 using the SageMaker Python SDK, you will require 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 releasing the design is offered in the Github here. You can clone the notebook and range 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 also use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail using the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Clean up

    To prevent unwanted charges, complete the actions in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you released the design using 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 wish to erase.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're erasing the appropriate 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 disgaeawiki.info more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we explored how you can access and deploy the DeepSeek-R1 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. 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 Getting going with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI business construct innovative options using AWS services and sped up calculate. Currently, he is focused on establishing strategies for fine-tuning and optimizing the inference performance of big language designs. In his spare time, Vivek enjoys hiking, viewing motion pictures, and attempting various 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 Science and Bioinformatics.

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

    Banu Nagasundaram leads product, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about constructing services that help customers accelerate their AI journey and unlock company value.