1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
otobrittney94 edited this page 2025-02-21 07:45:15 +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 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 release DeepSeek AI's first-generation frontier model, DeepSeek-R1, along with the distilled versions varying from 1.5 to 70 billion criteria to build, experiment, and properly scale your generative AI ideas on AWS.

In this post, we demonstrate how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to release the distilled variations of the designs too.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that uses support finding out to enhance reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key identifying function is its reinforcement learning (RL) step, which was utilized to refine the design's responses beyond the standard pre-training and fine-tuning process. By incorporating RL, DeepSeek-R1 can adjust more efficiently to user feedback and goals, ultimately improving both relevance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, meaning it's equipped to break down intricate inquiries and reason through them in a detailed manner. This directed reasoning process permits the design to produce more precise, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured responses while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually recorded the industry's attention as a flexible text-generation design that can be integrated into numerous workflows such as agents, logical thinking and information analysis tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture allows activation of 37 billion specifications, making it possible for effective reasoning by routing questions to the most appropriate professional "clusters." This method allows the design to focus on various problem domains while maintaining general effectiveness. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge circumstances to deploy the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning abilities of the main R1 design to more efficient architectures based on popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a procedure of training smaller sized, more efficient models to mimic the habits and thinking patterns of the larger DeepSeek-R1 design, 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 recommend releasing this model with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid damaging material, and assess models against essential safety criteria. At the time of writing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop multiple guardrails tailored to various usage cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you need access to an ml.p5e instance. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and confirm you're utilizing ml.p5e.48 xlarge for endpoint usage. 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 increase, create a limitation boost demand and connect to your account group.

Because you will be releasing this model 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 instructions, see Set up authorizations to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, avoid damaging content, and examine models against essential security requirements. You can execute security steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to assess user inputs and model 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 general 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 out to the design 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 result. However, if either the input or output is intervened 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 areas demonstrate reasoning utilizing 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, 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 utilize the InvokeModel API to invoke the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a provider and select the DeepSeek-R1 design.

The model detail page supplies vital details about the design's capabilities, pricing structure, and execution standards. You can discover detailed use directions, including sample API calls and code bits for combination. The design supports different text generation tasks, consisting of content development, code generation, and question answering, using its reinforcement discovering optimization and CoT reasoning capabilities. The page likewise consists of implementation alternatives and licensing details to assist you begin with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, choose Deploy.

You will be prompted to set up the deployment 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 Variety of circumstances, enter a number of instances (in between 1-100). 6. For example type, pick your instance type. For optimum efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure sophisticated security and infrastructure settings, consisting of virtual personal cloud (VPC) networking, service role consents, and encryption settings. For most use cases, the default settings will work well. However, for production releases, you might want to examine these settings to line up with your organization's security and trademarketclassifieds.com compliance requirements. 7. Choose Deploy to begin using the model.

When the implementation is total, you can check DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground. 8. Choose Open in play area to access an interactive interface where you can experiment with various prompts and change design criteria like temperature and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimum results. For instance, content for inference.

This is an outstanding way to check out the model's reasoning and text generation abilities before integrating it into your applications. The playground supplies instant feedback, assisting you understand it-viking.ch how the design reacts to various inputs and letting you tweak your prompts for ideal outcomes.

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

Run reasoning using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to carry out reasoning utilizing a deployed DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing 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 customer, configures reasoning parameters, and sends out a demand to produce text based on 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 release with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your data, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart uses two practical techniques: utilizing the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both techniques to assist you choose the approach that finest fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

1. On the SageMaker console, select Studio in the navigation pane. 2. First-time users will be prompted to develop a domain. 3. On the SageMaker Studio console, select JumpStart in the navigation pane.

The design web browser displays available designs, 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 shows crucial details, including:

- Model name - Provider name

  • Task category (for instance, Text Generation). Bedrock Ready badge (if suitable), suggesting that this design can be signed up with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to conjure up the design

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

    The model details page consists of the following details:

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

    The About tab includes crucial details, such as:

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

    Before you deploy the design, it's recommended to evaluate the design details and license terms to verify compatibility with your use case.

    6. Choose Deploy to continue with release.

    7. For Endpoint name, use the automatically created name or produce a custom-made one.
  1. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the variety of instances (default: 1). Selecting proper instance types and counts is vital for cost and efficiency optimization. Monitor your release 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 precision. For this model, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to release the design.

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

    When deployment is complete, your endpoint status will change to InService. At this point, the design is all set to accept reasoning requests through the endpoint. You can keep an eye on the release development on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the implementation 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 shows how to release and use DeepSeek-R1 for inference programmatically. The code for deploying the model is provided in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run additional demands against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

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

    Delete the Amazon Bedrock Marketplace implementation

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace implementations.
  5. In the Managed deployments section, it-viking.ch find the endpoint you wish to erase.
  6. Select the endpoint, and on the Actions menu, choose Delete.
  7. Verify the endpoint details to make certain you're erasing the proper deployment: 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 wish to stop sustaining charges. For more details, wiki.myamens.com see Delete Endpoints and Resources.

    Conclusion

    In this post, we checked out how you can access and release 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 Beginning with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions for Inference at AWS. He helps emerging generative AI companies develop ingenious services using AWS services and sped up calculate. Currently, he is concentrated on establishing strategies for fine-tuning and optimizing the inference efficiency of big language designs. In his totally free time, Vivek takes pleasure in treking, viewing films, 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 technology and Bioinformatics.

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