1
DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Alberto Fernandez edited this page 2025-03-05 21:43:23 +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 design, DeepSeek-R1, along with the distilled versions varying from 1.5 to 70 billion criteria to construct, experiment, and properly scale your generative AI ideas on AWS.

In this post, we show how to start 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 model (LLM) established by DeepSeek AI that uses support learning to improve reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial identifying feature is its support knowing (RL) action, which was used to improve the model's actions beyond the basic pre-training and tweak process. By integrating RL, DeepSeek-R1 can adjust more successfully to user feedback and goals, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, implying it's geared up to break down intricate queries and factor through them in a detailed manner. This directed reasoning process allows the design to produce more accurate, transparent, and detailed answers. This model integrates RL-based 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 recorded the market's attention as a versatile text-generation design that can be incorporated into various workflows such as representatives, logical reasoning and data analysis tasks.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion specifications, allowing effective reasoning by routing queries to the most appropriate specialist "clusters." This method enables the model to specialize in 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 use an ml.p5e.48 xlarge instance to deploy the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning abilities of the main R1 model to more effective architectures based upon popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller, more effective designs to simulate the behavior and thinking patterns of the bigger DeepSeek-R1 model, using it as an instructor design.

You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise releasing this model with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent damaging content, and evaluate models against crucial security criteria. At the time of writing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create numerous guardrails tailored to different usage cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release 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 validate 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 request a limitation increase, create a limit boost request and reach out to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, avoid hazardous content, and evaluate designs against crucial security criteria. You can implement precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to assess user inputs and model responses deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail using the Amazon Bedrock console or pipewiki.org the API. For the example code to produce the guardrail, see the GitHub repo.

The basic flow includes the following actions: First, the system gets an input for the model. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent to the model for inference. After getting the design'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 stepped in by the guardrail, a message is returned suggesting the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following sections demonstrate 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 designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:

1. On the Amazon Bedrock console, choose Model brochure under Foundation designs in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to conjure up the model. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and select the DeepSeek-R1 design.

The model detail page supplies necessary details about the model's abilities, pricing structure, and implementation standards. You can find detailed use instructions, consisting of sample API calls and code snippets for integration. The design supports numerous text generation jobs, consisting of content development, code generation, and concern answering, using its reinforcement finding out optimization and CoT reasoning abilities. The page likewise includes deployment choices and licensing details to assist you start with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, choose Deploy.

You will be prompted to configure 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 circumstances, enter a variety of instances (in between 1-100). 6. For Instance type, pick your instance type. For ideal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, you can set up innovative security and infrastructure settings, consisting of virtual personal cloud (VPC) networking, service role authorizations, and encryption settings. For most use cases, the default settings will work well. However, for production deployments, you might wish to examine these settings to align with your company's security and wiki.snooze-hotelsoftware.de compliance requirements. 7. Choose Deploy to begin using the model.

When the deployment is total, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock play area. 8. Choose Open in play area to access an interactive interface where you can try out different triggers and change design criteria like temperature level and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for ideal outcomes. For example, material for reasoning.

This is an exceptional method to explore the model's reasoning and text generation abilities before incorporating it into your applications. The playground supplies immediate feedback, helping you understand how the model reacts to numerous inputs and letting you fine-tune your triggers for optimal results.

You can rapidly check the design 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 utilizing guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to perform inference using a released DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. 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. After you have produced the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime customer, sets up reasoning specifications, and sends a request to produce text based upon a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in algorithms, and prebuilt ML solutions that you can deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your information, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart provides 2 convenient methods: using the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both approaches to help you pick the method that best fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

1. On the SageMaker console, choose Studio in the navigation pane. 2. First-time users will be triggered to produce 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 provider name and model abilities.

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

- Model name

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

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

    The model details page includes the following details:

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

    The About tab includes crucial details, such as:

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

    Before you release the design, it's advised to examine the model details and license terms to validate compatibility with your usage case.

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, use the instantly created name or develop a custom one.
  1. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, enter the number of instances (default: 1). Selecting appropriate circumstances types and counts is crucial for cost and efficiency optimization. Monitor your implementation to change these settings as needed.Under Inference type, Real-time inference is chosen by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this design, we strongly suggest adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to deploy the design.

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

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

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To begin with DeepSeek-R1 using the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the required 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 releasing the model is offered in the Github here. You can clone the note pad and range 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 develop a guardrail utilizing the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Clean up

    To prevent undesirable charges, complete the steps in this section to clean 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 deployments.
  5. In the Managed implementations section, find the endpoint you desire to erase.
  6. Select the endpoint, and on the Actions menu, pick Delete.
  7. Verify the endpoint details to make certain you're erasing the proper implementation: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed will sustain costs 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 deploy the DeepSeek-R1 model utilizing 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 Starting 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 develop innovative options utilizing AWS services and accelerated calculate. Currently, he is focused on establishing methods for fine-tuning and optimizing the inference efficiency of big language models. In his free time, Vivek enjoys treking, viewing movies, and attempting various 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 Science and systemcheck-wiki.de Bioinformatics.

    Jonathan Evans is an Expert Solutions Architect dealing with generative AI with the Third-Party Model Science group 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 constructing solutions that assist clients accelerate their AI journey and unlock business value.