1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Hyman Costello edited this page 2025-02-07 12:00:02 +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 reveal 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, along with the distilled versions ranging from 1.5 to 70 billion parameters to develop, 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 comparable 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 enhance reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base structure. A key distinguishing function is its reinforcement knowing (RL) action, which was used to improve the model's actions beyond the standard pre-training and fine-tuning process. By integrating RL, DeepSeek-R1 can adjust better to user feedback and objectives, ultimately boosting both significance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, implying it's equipped to break down intricate questions and factor through them in a detailed way. This assisted reasoning procedure enables the design to produce more accurate, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT capabilities, it-viking.ch aiming to generate structured reactions while focusing on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has recorded the market's attention as a versatile text-generation design that can be incorporated into numerous workflows such as representatives, logical thinking and information interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion parameters, allowing efficient reasoning by routing inquiries to the most pertinent professional "clusters." This technique permits the model to concentrate on different issue domains while maintaining total performance. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances to deploy the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

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

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend deploying this design with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to present safeguards, avoid damaging content, and examine designs against essential safety criteria. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce numerous guardrails tailored to different use cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, 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, choose Amazon SageMaker, and confirm you're using ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are deploying. To ask for a limit increase, develop a limitation increase demand and reach out 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) authorizations to use Amazon Bedrock Guardrails. For guidelines, see Establish authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, avoid damaging content, and bio.rogstecnologia.com.br evaluate models against essential safety requirements. You can execute precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to evaluate user inputs and model reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo.

The general circulation includes the following actions: 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 inference. After getting the design's output, another guardrail check is used. 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 stage. The examples showcased in the following areas demonstrate reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized structure models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following actions:

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

The model detail page offers vital details about the design's abilities, prices structure, and implementation guidelines. You can find detailed usage instructions, consisting of sample API calls and code bits for combination. The model supports different text generation tasks, including content production, code generation, and concern answering, utilizing its reinforcement finding out optimization and CoT thinking capabilities. The page likewise includes implementation alternatives and licensing details to assist you start with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, choose Deploy.

You will be prompted to configure the implementation details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters). 5. For Number of instances, go into a number of circumstances (in between 1-100). 6. For Instance type, select your circumstances type. For ideal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can configure innovative security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role approvals, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production implementations, you may wish to review these settings to align with your company's security and compliance requirements. 7. Choose Deploy to start using the design.

When the implementation is complete, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock play area. 8. Choose Open in playground to access an interactive interface where you can experiment with various prompts and change design specifications like temperature level and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for ideal outcomes. For instance, content for inference.

This is an excellent method to check out the design's thinking and text generation abilities before integrating it into your applications. The play area provides instant feedback, assisting you understand how the design reacts to different inputs and letting you tweak your triggers for optimum results.

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

Run inference utilizing guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to carry out inference using a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can create a guardrail utilizing the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo. After you have developed the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime client, sets up inference parameters, and sends out a demand to generate text based upon a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in 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 usage case, with your data, and release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart provides two hassle-free techniques: using the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you pick the method that best matches 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 produce a domain. 3. On the SageMaker Studio console, choose JumpStart in the navigation pane.

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

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

- Model name

  • Provider name
  • Task classification (for instance, Text Generation). Bedrock Ready badge (if suitable), suggesting that this design can be registered with Amazon Bedrock, permitting you to utilize Amazon Bedrock APIs to conjure up the model

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

    The model details page consists of the following details:

    - The design name and supplier 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 standards

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

    6. Choose Deploy to continue with .

    7. For Endpoint name, utilize the instantly produced name or create a custom-made one.
  1. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the number of circumstances (default: 1). Selecting suitable circumstances types and counts is vital for cost and performance optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time reasoning is chosen by default. This is optimized for sustained traffic and bytes-the-dust.com low latency.
  3. Review all setups for precision. For this design, we strongly advise sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to release the model.

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

    When implementation is total, your endpoint status will alter to InService. At this point, the model is all set to accept inference requests through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the implementation is total, you can conjure up the model using a SageMaker runtime customer 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 need to set up the SageMaker Python SDK and make certain you have the required AWS permissions and environment setup. The following is a detailed code example that demonstrates how to release and use DeepSeek-R1 for inference programmatically. The code for releasing the design is supplied in the Github here. You can clone the note pad and range 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 likewise use 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 revealed in the following code:

    Tidy up

    To prevent unwanted charges, finish the steps in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you deployed the design using Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace releases.
  5. In the Managed implementations area, find the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're deleting the appropriate implementation: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you released will sustain expenses 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, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained models, 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 helps emerging generative AI business build ingenious services using AWS services and accelerated compute. Currently, he is concentrated on establishing strategies for fine-tuning and optimizing the inference efficiency of big language designs. In his leisure time, Vivek enjoys treking, 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 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 working on generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about developing services that help consumers accelerate their AI journey and unlock business worth.