1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
shawnclendinne edited this page 2 weeks ago
This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.


Today, we are thrilled 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, together with the distilled variations varying 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 release the distilled versions 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 procedure from a DeepSeek-V3-Base structure. A crucial differentiating function is its support learning (RL) action, which was used to fine-tune the design's actions beyond the basic pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adapt more efficiently to user feedback and goals, ultimately improving both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, meaning it's geared up to break down complex queries and reason through them in a detailed manner. This guided thinking process permits the design to produce more accurate, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT capabilities, aiming to create structured actions while focusing on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has captured the industry's attention as a flexible text-generation model that can be integrated into various workflows such as representatives, rational thinking and data interpretation jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion specifications, allowing efficient reasoning by routing inquiries to the most relevant specialist "clusters." This technique enables the model to concentrate on various problem domains while maintaining general performance. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for pipewiki.org reasoning. In this post, we will utilize an ml.p5e.48 xlarge instance to release the model. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

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

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest deploying this design with guardrails in location. In this blog, we will utilize Amazon Bedrock Guardrails to present safeguards, disgaeawiki.info avoid harmful content, and evaluate designs against key safety criteria. At the time of writing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop numerous guardrails tailored to various usage cases and wiki.whenparked.com apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, you require access to an ml.p5e circumstances. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose 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 request a limitation increase, create a limit boost demand and connect to your account team.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) authorizations to utilize Amazon Bedrock Guardrails. For guidelines, see Establish authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid damaging material, and assess models against crucial security requirements. You can carry out precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to examine user inputs and model responses released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo.

The general flow 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 to the design for inference. After getting the model's output, another guardrail check is applied. If the output passes this final check, it's returned as the final result. 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 stage. The examples showcased in the following areas show inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers 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, select 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 model. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and pick the DeepSeek-R1 model.

The model detail page supplies vital details about the model's capabilities, prices structure, and raovatonline.org application standards. You can find detailed use guidelines, including sample API calls and code bits for combination. The design supports numerous text generation jobs, consisting of material development, code generation, and concern answering, utilizing its reinforcement discovering optimization and CoT thinking capabilities. The page also includes implementation options and licensing details to help you get going with DeepSeek-R1 in your applications. 3. To start using DeepSeek-R1, select Deploy.

You will be triggered to configure the deployment details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters). 5. For Variety of instances, enter a number of circumstances (between 1-100). 6. For Instance type, pick your circumstances type. For optimum performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can configure sophisticated security and facilities settings, consisting of virtual personal cloud (VPC) networking, service function permissions, and file encryption settings. For a lot of use cases, the default settings will work well. However, for production implementations, you might wish to examine these settings to line up with your organization's security and compliance requirements. 7. Choose Deploy to begin using the design.

When the deployment is complete, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in playground to access an interactive user interface where you can explore various prompts and change model specifications like temperature and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for ideal outcomes. For example, material for reasoning.

This is an outstanding way to explore the model's thinking and text generation capabilities before integrating it into your applications. The play area offers immediate feedback, helping you comprehend how the design responds to different inputs and letting you tweak your prompts for optimal results.

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 inference using guardrails with the deployed 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 using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo. After you have developed the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime client, configures inference specifications, and sends a request to generate text based upon a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

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

Deploying DeepSeek-R1 design through SageMaker JumpStart offers two hassle-free methods: using the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both methods to assist you choose the approach that best suits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The design browser displays available designs, with details like the supplier name and model capabilities.

4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card. Each design card shows crucial details, consisting of:

- Model name

  • Provider name
  • Task category (for example, Text Generation). Bedrock Ready badge (if appropriate), showing that this model can be signed up with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to invoke the model

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

    The model details page consists of the following details:

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

    The About tab includes important details, such as:

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

    Before you deploy the model, surgiteams.com it's suggested to evaluate the design details and license terms to validate compatibility with your use case.

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, use the instantly created name or develop a custom one.
  1. For Instance type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the number of circumstances (default: 1). Selecting suitable instance types and counts is essential for expense and efficiency optimization. Monitor your deployment 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 configurations for precision. For this model, we strongly recommend sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to release the model.

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

    When deployment is complete, your endpoint status will alter 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 pertinent metrics and status details. When the deployment is complete, you can invoke the model using 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 need to install the SageMaker Python SDK and make certain you have the required AWS authorizations and environment setup. The following is a detailed code example that demonstrates how to deploy and use DeepSeek-R1 for reasoning programmatically. The code for deploying the model is provided in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run additional requests 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 develop a guardrail using the Amazon Bedrock console or the API, and implement it as shown in the following code:

    Clean up

    To avoid unwanted charges, complete the actions in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you released the design using Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace releases.
  5. In the Managed deployments section, locate the endpoint you want 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 release: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model 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 checked out 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 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 Starting 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 develop ingenious services using AWS services and accelerated compute. Currently, he is focused on developing strategies for fine-tuning and enhancing the reasoning efficiency of big language models. In his leisure time, Vivek takes pleasure in hiking, enjoying motion pictures, and attempting different 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 a Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads product, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about developing services that help customers accelerate their AI journey and unlock company worth.