1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
santostisdall5 edited this page 2025-05-27 22:27:53 +03: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 models 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 variations ranging from 1.5 to 70 billion parameters to construct, experiment, and responsibly scale your generative AI concepts on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes support finding out to enhance reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial distinguishing function is its support learning (RL) step, which was used to refine the design's responses beyond the basic pre-training and tweak procedure. By integrating RL, DeepSeek-R1 can adapt better to user feedback and objectives, eventually improving both significance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, meaning it's geared up to break down intricate inquiries and reason through them in a detailed way. This assisted reasoning procedure permits the design to produce more precise, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT abilities, aiming to generate structured responses while concentrating on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has actually captured the market's attention as a flexible text-generation design that can be integrated into numerous workflows such as agents, logical reasoning and information analysis jobs.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, making it possible for efficient inference by routing questions to the most pertinent specialist "clusters." This approach allows the design to focus on different problem domains while maintaining total effectiveness. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will use an ml.p5e.48 xlarge circumstances to deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled models 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 refers to a process of training smaller, more effective models to mimic the habits and reasoning patterns of the larger DeepSeek-R1 design, 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 releasing this design with guardrails in place. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent damaging content, and assess models against crucial security requirements. At the time of composing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop multiple guardrails tailored to different usage cases and apply them to the DeepSeek-R1 design, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you need access to an ml.p5e circumstances. 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 usage. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are releasing. To request a limit increase, create a limit increase demand and reach out to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, prevent hazardous content, and evaluate models against key safety criteria. You can execute precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to assess user inputs and design responses deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.

The general flow includes the following steps: 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 model for inference. After receiving the model's output, another guardrail check is applied. If the output passes this last 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 whether it happened at the input or output stage. The examples showcased in the following sections 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 steps:

1. On the Amazon Bedrock console, select Model catalog under Foundation designs in the navigation pane. At the time of writing this post, you can utilize the InvokeModel API to invoke the design. It does not 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 supplies necessary details about the design's abilities, prices structure, and application guidelines. You can discover detailed usage instructions, including sample API calls and code bits for integration. The model supports different text generation jobs, including material development, code generation, and question answering, using its reinforcement discovering optimization and CoT thinking capabilities. The page likewise includes deployment options and licensing details to help you start with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, choose Deploy.

You will be triggered to set up the release 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 instances, enter a variety of instances (between 1-100). 6. For example type, choose your circumstances type. For optimal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is suggested. Optionally, you can set up advanced security and facilities settings, consisting of virtual personal cloud (VPC) networking, service role approvals, and file encryption settings. For the majority of use cases, the default settings will work well. However, for production implementations, you may wish to review these settings to line up with your organization's security and compliance requirements. 7. Choose Deploy to start using the design.

When the deployment is complete, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground. 8. Choose Open in playground to access an interactive user interface where you can try out various prompts and adjust design specifications like temperature level and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimum outcomes. For instance, material for reasoning.

This is an outstanding way to check out the model's reasoning and text generation capabilities before integrating it into your applications. The play area offers instant feedback, assisting you comprehend how the design reacts to different inputs and letting you tweak your prompts for optimum results.

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

Run inference using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to perform reasoning using a released DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo. After you have actually produced the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, configures reasoning specifications, and sends out a request to generate text based on 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 options that you can release with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, and release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 practical methods: using the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both methods to help you choose the approach that best fits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

1. On the SageMaker console, pick 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 displays available designs, with details like the provider name and design capabilities.

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

- 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, permitting you to use Amazon Bedrock APIs to conjure up the design

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

    The model details page includes the following details:

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

    The About tab consists of important details, such as:

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

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

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, use the immediately generated name or produce a custom one.
  1. For Instance type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, go into the number of circumstances (default: 1). Selecting appropriate circumstances types and counts is essential for cost and performance optimization. Monitor your implementation to change these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is optimized for sustained traffic and low latency.
  3. Review all setups for precision. For this design, we highly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to release the model.

    The release procedure can take a number of minutes to complete.

    When deployment is total, your endpoint status will alter to InService. At this moment, the model is prepared to accept inference requests through the endpoint. You can keep an eye on the release development on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the implementation is complete, you can conjure up the model using a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the essential AWS permissions and . The following is a detailed code example that shows how to deploy 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 extra 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 utilizing the Amazon Bedrock console or the API, and execute it as revealed in the following code:

    Clean up

    To prevent undesirable charges, finish 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, complete the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace deployments.
  5. In the Managed releases section, find 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 proper release: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed will sustain costs if you leave it running. Use the following code to delete the endpoint if you desire 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 using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get started. 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 going with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI business construct innovative options utilizing AWS services and sped up calculate. Currently, he is focused on establishing strategies for fine-tuning and optimizing the reasoning efficiency of big language designs. In his leisure time, Vivek takes pleasure in treking, seeing 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 dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads product, engineering, and strategic collaborations for oeclub.org Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about building solutions that help customers accelerate their AI journey and unlock company value.