1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
tylerchippinda edited this page 1 month ago


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 release DeepSeek AI's first-generation frontier model, DeepSeek-R1, together with the distilled versions ranging from 1.5 to 70 billion criteria to build, experiment, and responsibly scale your generative AI concepts 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 release the distilled versions of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes reinforcement learning to enhance thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A crucial differentiating function is its reinforcement learning (RL) action, which was used to improve the model's reactions beyond the basic pre-training and tweak process. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and goals, eventually improving both significance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, suggesting it's equipped to break down complicated queries and reason through them in a detailed manner. This guided thinking process permits the design to produce more precise, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT capabilities, aiming to create structured reactions while concentrating on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has recorded the market's attention as a flexible text-generation model that can be integrated into various workflows such as representatives, rational thinking and information interpretation tasks.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion specifications, making it possible for efficient inference by routing inquiries to the most relevant expert "clusters." This technique allows the design to specialize in various problem domains while maintaining general 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 comes with 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 effective architectures based upon popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller sized, more efficient models to mimic the habits and reasoning patterns of the bigger DeepSeek-R1 model, 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 advise deploying this model with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, avoid hazardous material, and examine models against key safety criteria. At the time of writing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create several guardrails tailored to different use cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you need access to an ml.p5e instance. To check if you have quotas for setiathome.berkeley.edu P5e, open the Service Quotas console and under AWS Services, pick 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 releasing. To request a limitation increase, create a limitation boost 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) permissions to use Amazon Bedrock Guardrails. For directions, see Set up authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, prevent hazardous material, and examine designs against essential safety requirements. You can implement precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to evaluate user inputs and model actions 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 produce 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 out to the design for reasoning. After receiving the design'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 output is intervened by the guardrail, a message is returned indicating the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following sections demonstrate reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

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

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

The design detail page supplies necessary details about the model's abilities, prices structure, hb9lc.org and implementation guidelines. You can discover detailed use directions, consisting of sample API calls and code snippets for integration. The design supports various text generation tasks, including material development, code generation, and concern answering, wiki.asexuality.org using its reinforcement finding out optimization and CoT reasoning abilities. The page likewise includes deployment options and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, select Deploy.

You will be prompted to configure the release details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters). 5. For Variety of instances, get in a variety of circumstances (between 1-100). 6. For example type, select your circumstances type. For optimal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up sophisticated security and infrastructure settings, consisting of 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 deployments, you might wish to evaluate these settings to align with your company's security and compliance requirements. 7. Choose Deploy to begin using the design.

When the deployment is complete, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in playground to access an interactive interface where you can experiment with different triggers and adjust model criteria 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 reasoning.

This is an exceptional method to explore the model's thinking and text generation abilities before incorporating it into your applications. The play ground provides immediate feedback, helping you understand how the model reacts to different inputs and letting you tweak your triggers for optimum results.

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

Run reasoning utilizing guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to carry out reasoning using a released DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can produce 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 produced the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime client, configures inference parameters, and sends out a demand to generate text based upon 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 use case, with your information, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart provides 2 practical approaches: using the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both techniques to help you choose the technique that finest fits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following steps to deploy DeepSeek-R1 utilizing SageMaker JumpStart:

1. On the SageMaker console, pick 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 model web browser displays available designs, with details like the provider name and model abilities.

4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card. Each design card shows essential details, consisting of:

- Model name

  • Provider name
  • Task classification (for it-viking.ch example, Text Generation). Bedrock Ready badge (if relevant), suggesting that this design can be signed up with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to invoke the design

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

    The design details page consists of the following details:

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

    The About tab includes crucial details, such as:

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

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

    6. Choose Deploy to continue with release.

    7. For Endpoint name, utilize the automatically created name or produce a customized one.
  1. For example type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the variety of instances (default: 1). Selecting suitable instance types and counts is essential for cost and performance optimization. Monitor your release to change these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations for precision. For this model, we strongly suggest adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to release the model.

    The implementation process can take a number of minutes to finish.

    When implementation is total, your endpoint status will change to InService. At this point, the model is all set to accept inference demands through the endpoint. You can monitor the deployment development on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the deployment is complete, you can invoke the model utilizing a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To begin with DeepSeek-R1 using the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the essential AWS permissions 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 deploying the model is provided in the Github here. You can clone the note pad 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 avoid undesirable charges, complete the actions in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace deployments.
  5. In the Managed implementations area, wiki.dulovic.tech find the endpoint you desire to erase.
  6. Select the endpoint, and on the Actions menu, pick Delete.
  7. Verify the endpoint details to make certain you're erasing the correct deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The JumpStart design you deployed 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 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, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting started 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 innovative options using AWS services and sped up compute. Currently, he is focused on developing methods for fine-tuning and optimizing the reasoning efficiency of large language designs. In his complimentary time, Vivek enjoys hiking, watching motion pictures, and systemcheck-wiki.de attempting various cuisines.

    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 a Professional 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 center. She is enthusiastic about developing solutions that assist clients accelerate their AI journey and unlock service worth.