1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
ezraneustadt51 edited this page 2025-02-15 03:10:14 +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 deploy DeepSeek AI's first-generation frontier model, DeepSeek-R1, in addition to the distilled variations varying from 1.5 to 70 billion parameters 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 similar steps to deploy the distilled variations of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that uses reinforcement finding out to boost thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A key differentiating feature is its support learning (RL) step, which was used to refine the design's reactions beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adjust more successfully to user feedback and goals, eventually boosting both significance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, implying it's equipped to break down complex inquiries and reason through them in a detailed manner. This assisted reasoning process allows the design to produce more precise, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT abilities, aiming to generate structured responses 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 model that can be integrated into various workflows such as agents, rational reasoning and data interpretation tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion parameters, allowing effective reasoning by routing inquiries to the most appropriate professional "clusters." This technique enables the design to specialize in different problem domains while maintaining general 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 release the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

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

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise deploying this model with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, prevent damaging content, and evaluate designs against essential security requirements. At the time of composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create several guardrails tailored to various usage cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you require access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, select Amazon SageMaker, and validate 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 releasing. To ask for a limit boost, produce a limit increase demand and connect to your account team.

Because you will be deploying this model 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 guidelines, see Establish 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 designs against key safety requirements. You can implement precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to evaluate user inputs and design reactions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the .

The basic 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 to the model for reasoning. After receiving the model's output, another guardrail check is applied. If the output passes this final check, it's returned as the outcome. However, if either the input or it-viking.ch output is intervened by the guardrail, a message is returned showing the nature of the intervention and whether it took place at the input or output stage. The examples showcased in the following sections show reasoning utilizing 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 brochure under Foundation models in the navigation pane. At the time of writing this post, you can use the InvokeModel API to invoke the model. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and select the DeepSeek-R1 design.

The model detail page provides important details about the model's capabilities, pricing structure, and application guidelines. You can find detailed use instructions, including sample API calls and code snippets for combination. The design supports numerous text generation tasks, including content development, code generation, and question answering, utilizing its reinforcement discovering optimization and CoT reasoning capabilities. The page also includes implementation options and licensing details to assist you get going with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, pick Deploy.

You will be triggered to set up the implementation details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters). 5. For Number of instances, enter a variety of instances (in between 1-100). 6. For Instance type, choose 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, including virtual private cloud (VPC) networking, service function permissions, and encryption settings. For the majority of use cases, the default settings will work well. However, for production releases, you might desire to examine these settings to align with your company's security and compliance requirements. 7. Choose Deploy to start using the model.

When the deployment is total, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in play area to access an interactive interface where you can experiment with various prompts and adjust model criteria like temperature and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimal results. For instance, material for inference.

This is an excellent way to check out the design's thinking and text generation capabilities before integrating it into your applications. The playground supplies instant feedback, helping you comprehend how the design reacts to various inputs and letting you fine-tune your prompts for ideal results.

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

Run reasoning utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to perform reasoning using a deployed DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo. After you have developed the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, sets up inference specifications, and sends out a request to produce text based upon a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, integrated algorithms, and prebuilt ML options that you can deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your data, and release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 hassle-free methods: using the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both techniques to assist you choose the technique that best suits 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, select 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 model card. Each model card shows key details, including:

- Model name

  • Provider name
  • Task classification (for instance, Text Generation). Bedrock Ready badge (if suitable), indicating that this model can be registered 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 model details page includes the following details:

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

    The About tab consists of important details, such as:

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

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

    6. Choose Deploy to continue with release.

    7. For engel-und-waisen.de Endpoint name, use the immediately created name or develop a custom one.
  1. For example type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, go into the variety of circumstances (default: 1). Selecting appropriate circumstances types and counts is vital for cost and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all setups for accuracy. For raovatonline.org this design, we highly advise sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to release the design.

    The release process can take several minutes to finish.

    When release is complete, your endpoint status will change to InService. At this point, the design 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 deployment is complete, you can conjure up the model using a SageMaker runtime customer and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 using the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the essential AWS approvals and environment setup. The following is a detailed code example that shows how to release and utilize DeepSeek-R1 for reasoning programmatically. The code for releasing the model is provided in the Github here. You can clone the notebook and run from SageMaker Studio.

    You can run extra demands against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise utilize 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 steps in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you released the model utilizing Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace deployments.
  5. In the Managed releases area, find the endpoint you want to erase.
  6. Select the endpoint, it-viking.ch and on the Actions menu, choose 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 design you deployed will sustain costs if you leave it running. Use the following code to delete 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 design utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. 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 Beginning 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 using AWS services and accelerated calculate. Currently, he is focused on establishing strategies for fine-tuning and optimizing the reasoning efficiency of large language designs. In his leisure time, Vivek delights in treking, seeing movies, and attempting various foods.

    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 an Expert Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads item, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about constructing options that help customers accelerate their AI journey and unlock service worth.