1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
kassandraartea edited this page 2025-02-27 06:21:08 +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 reveal 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 design, DeepSeek-R1, in addition to the distilled variations ranging from 1.5 to 70 billion parameters to construct, 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 versions of the designs also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that utilizes support finding out to improve reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential identifying function is its reinforcement learning (RL) action, which was utilized to fine-tune the design's responses beyond the standard pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adjust more effectively to user feedback and objectives, eventually enhancing both significance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, implying it's equipped to break down complicated questions and factor through them in a detailed way. This guided thinking process allows the model to produce more precise, transparent, and detailed answers. This model integrates RL-based fine-tuning with CoT abilities, aiming to generate structured reactions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has captured the industry's attention as a versatile text-generation model that can be integrated into numerous workflows such as agents, rational thinking and information interpretation tasks.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, allowing effective reasoning by routing queries to the most appropriate expert "clusters." This method allows the model to concentrate on different problem domains while maintaining overall performance. 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 circumstances to release the model. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking abilities of the main R1 model 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 simulate the habits and thinking patterns of the larger DeepSeek-R1 model, utilizing it as an instructor design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest releasing this model with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, avoid damaging content, and examine models against key security criteria. At the time of writing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce numerous guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, improving 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 instance. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and verify 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, produce a limit increase request and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, avoid harmful content, and evaluate models against essential safety criteria. You can execute security procedures for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to evaluate user inputs and design responses 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 develop the guardrail, see the GitHub repo.

The basic circulation includes the following steps: First, the system receives an input for the design. 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 receiving the design's output, another guardrail check is used. If the output passes this last check, it's returned as the last outcome. 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 occurred at the input or output phase. The examples showcased in the following areas demonstrate 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 actions:

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

The model detail page supplies necessary details about the model's capabilities, prices structure, and execution standards. You can discover detailed usage directions, including sample API calls and code bits for combination. The design supports different text generation jobs, including content production, code generation, and question answering, utilizing its support discovering optimization and CoT reasoning capabilities. The page also consists of release alternatives and licensing details to help you get going with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, pick Deploy.

You will be prompted to configure the release 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, go into a variety of circumstances (between 1-100). 6. For example type, pick your circumstances type. For optimum efficiency with DeepSeek-R1, wiki.myamens.com a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and infrastructure settings, including virtual personal cloud (VPC) networking, service role approvals, and encryption settings. For many use cases, the default settings will work well. However, for production implementations, you may wish to examine these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to start using the model.

When the implementation is complete, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock playground. 8. Choose Open in play ground to access an interactive interface where you can explore different prompts and change design parameters like temperature level and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimum outcomes. For instance, material for inference.

This is an exceptional way to check out the model's thinking and text generation abilities before incorporating it into your applications. The playground provides immediate feedback, assisting you comprehend how the model reacts to numerous inputs and letting you tweak your triggers for ideal outcomes.

You can rapidly evaluate the model in the playground through the UI. However, to invoke the deployed model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run reasoning using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to perform inference using a released DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can produce 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, yewiki.org use the following code to implement 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) center with FMs, built-in algorithms, and prebuilt ML services that you can release with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart offers two practical techniques: utilizing the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both methods to assist you choose the technique that best fits 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, pick 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 models, setiathome.berkeley.edu with details like the company name and design capabilities.

4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card. Each design card reveals essential details, setiathome.berkeley.edu including:

- Model name

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

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

    The model details page consists of the following details:

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

    The About tab includes important details, such as:

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

    Before you release the design, it's suggested to evaluate the design details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to continue with release.

    7. For Endpoint name, utilize the automatically produced name or develop a custom-made one.
  1. For example type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the variety of instances (default: 1). Selecting suitable instance types and counts is essential for cost and performance optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this design, we highly recommend sticking to SageMaker JumpStart and making certain that network seclusion remains in location.
  4. Choose Deploy to deploy the model.

    The deployment procedure can take several minutes to complete.

    When release is complete, your endpoint status will change to InService. At this point, the design is prepared to accept reasoning requests through the endpoint. You can keep an eye on the implementation development on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the implementation is complete, you can conjure up the model utilizing a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To begin with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to install 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 use DeepSeek-R1 for reasoning 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 extra demands 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 using the Amazon Bedrock console or the API, and implement 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 implementation

    If you deployed the model using Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace deployments.
  5. In the Managed implementations area, find the endpoint you desire 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 right release: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you released will sustain costs if you leave it running. Use the following code to erase the endpoint if you want 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 going. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting begun 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 options utilizing AWS services and sped up compute. Currently, he is focused on developing techniques for fine-tuning and optimizing the reasoning efficiency of large language designs. In his complimentary time, Vivek delights in treking, seeing motion pictures, and trying various foods.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team at AWS. His area of focus is AWS AI accelerators (AWS Neuron). He holds a Bachelor's degree in Computer technology and Bioinformatics.

    Jonathan Evans is a Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about building services that assist clients accelerate their AI journey and unlock organization worth.