1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
percyconder48 edited this page 2025-04-09 05:38:04 +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 thrilled 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 design, DeepSeek-R1, along with the distilled variations varying from 1.5 to 70 billion parameters to build, experiment, and properly scale your generative AI ideas on AWS.

In this post, we demonstrate how to get begun with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to deploy the distilled variations of the models as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes support learning to boost thinking abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial identifying function is its reinforcement learning (RL) action, which was utilized to refine the model's responses beyond the basic pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adjust better to user feedback and goals, eventually improving both relevance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, suggesting it's geared up to break down intricate queries and reason through them in a detailed way. This assisted reasoning procedure permits the design to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to produce structured actions while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually recorded the market's attention as a versatile text-generation design that can be incorporated into various workflows such as agents, rational thinking and information analysis jobs.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion criteria, enabling effective inference by routing queries to the most relevant expert "clusters." This method permits the model to specialize in different problem domains while maintaining total efficiency. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge instance to release the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking capabilities of the main R1 model 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 effective designs to imitate the behavior and reasoning patterns of the bigger DeepSeek-R1 design, using it as an instructor design.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an design, we suggest deploying this model with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous content, and evaluate designs against key security requirements. At the time of composing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop several guardrails tailored to different usage cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you need access to an ml.p5e circumstances. To inspect if you have quotas for raovatonline.org P5e, open the Service Quotas console and under AWS Services, select 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 deploying. To ask for a limitation boost, create a limitation boost request and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, avoid hazardous content, and examine designs against essential security criteria. You can carry out security steps for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to assess user inputs and model actions released 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 produce the guardrail, see the GitHub repo.

The basic circulation 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 design for reasoning. After getting the design's output, another guardrail check is used. If the output passes this final check, it's returned as the result. However, if either the input or output is stepped in by the guardrail, a message is returned indicating the nature of the intervention and whether it took place at the input or output stage. The examples showcased in the following sections show inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides 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 catalog under Foundation designs in the navigation pane. At the time of writing this post, you can utilize 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 provider and select the DeepSeek-R1 model.

The design detail page provides vital details about the design's capabilities, pricing structure, and execution standards. You can discover detailed use guidelines, consisting of sample API calls and code snippets for integration. The model supports numerous text generation tasks, including content creation, code generation, and concern answering, using its support finding out optimization and CoT reasoning abilities. The page also consists of implementation alternatives and licensing details to assist you get started with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, select Deploy.

You will be prompted to set up the release details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters). 5. For Variety of circumstances, enter a number of circumstances (between 1-100). 6. For Instance type, select your instance type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up innovative security and facilities settings, consisting of virtual private cloud (VPC) networking, service function approvals, and file encryption settings. For many use cases, the default settings will work well. However, for production releases, you may want to review these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to start utilizing the design.

When the deployment is total, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock play ground. 8. Choose Open in playground to access an interactive interface where you can experiment with various prompts and adjust design criteria 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 example, content for reasoning.

This is an exceptional way to explore the model's thinking and text generation abilities before integrating it into your applications. The play area provides immediate feedback, assisting you comprehend how the design reacts to different inputs and letting you tweak your prompts for optimal outcomes.

You can quickly test the design in the play area 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 using guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to perform reasoning using a deployed DeepSeek-R1 model 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 develop the guardrail, see the GitHub repo. After you have produced the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime customer, sets up reasoning parameters, 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) center with FMs, integrated algorithms, and prebuilt ML services that you can deploy with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your data, and release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses two convenient techniques: utilizing the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both methods to help you select the method 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, pick JumpStart in the navigation pane.

The design browser displays available models, with details like the service provider name and model abilities.

4. Search for DeepSeek-R1 to see the DeepSeek-R1 design card. Each design card reveals key details, including:

- Model name

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

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

    The design details page consists of the following details:

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

    The About tab includes important details, such as:

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

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

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the automatically generated name or produce a custom one.
  1. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, go into the number of circumstances (default: 1). Selecting proper circumstances types and counts is essential for cost and wiki.myamens.com efficiency 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 model, we strongly recommend sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to release the design.

    The release procedure can take several minutes to complete.

    When implementation is total, your endpoint status will alter to InService. At this point, the model is ready to accept reasoning demands through the endpoint. You can keep an eye on the deployment progress on the SageMaker console Endpoints page, which will display appropriate 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 begin with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the needed AWS approvals and environment setup. The following is a detailed code example that shows how to release and use DeepSeek-R1 for reasoning 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 also 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 unwanted charges, complete the actions in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the model using Amazon Bedrock Marketplace, complete the following actions:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace releases.
  5. In the Managed releases area, photorum.eclat-mauve.fr locate the endpoint you desire to delete.
  6. Select the endpoint, and on the Actions menu, choose 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 released will sustain costs if you leave it running. Use the following code to delete the endpoint if you want 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 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. For more details, describe 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 assists emerging generative AI companies build ingenious solutions utilizing AWS services and sped up compute. Currently, he is focused on establishing methods for fine-tuning and enhancing the inference performance of large language designs. In his spare time, Vivek delights in hiking, seeing motion pictures, and trying different cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team 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 Professional Solutions Architect working on generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads item, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about building options that assist customers accelerate their AI journey and unlock service value.