1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
colettelamothe edited this page 2025-02-09 13:23:28 +00: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 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 variations varying from 1.5 to 70 billion criteria to develop, experiment, and properly scale your generative AI ideas on AWS.

In this post, we demonstrate how to get started with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable 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 utilizes reinforcement discovering to enhance reasoning capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key differentiating feature is its reinforcement knowing (RL) action, which was utilized to improve the design's reactions beyond the standard pre-training and tweak procedure. By including RL, DeepSeek-R1 can adapt better to user feedback and goals, ultimately boosting both significance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, indicating it's equipped to break down complicated questions and factor through them in a detailed way. This assisted thinking procedure 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 responses while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has recorded the industry's attention as a flexible text-generation model that can be incorporated into different workflows such as agents, sensible thinking and data analysis tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion criteria, allowing effective reasoning by routing questions to the most appropriate expert "clusters." This approach allows the design to focus on various 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 instance to release the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning capabilities 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 describes a procedure of training smaller, more efficient models to simulate the habits and thinking patterns of the bigger 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 model, we recommend deploying this model with guardrails in place. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, prevent damaging material, and evaluate models against essential safety requirements. At the time of writing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce several guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, 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 validate 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 deploying. To ask for a limit increase, develop a limitation boost demand and reach out to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, avoid hazardous content, and examine models against essential security requirements. You can implement safety steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to assess user inputs and model reactions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create a guardrail using 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 steps: First, the system gets 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 model for reasoning. After getting the model's output, another guardrail check is applied. If the output passes this last check, it's returned as the last result. However, if either the input or output is stepped in by the guardrail, a message is returned showing the nature of the intervention and whether it occurred at the input or output stage. The examples showcased in the following areas demonstrate reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized foundation 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 composing this post, you can utilize the InvokeModel API to conjure up the model. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and pick the DeepSeek-R1 design.

The model detail page offers important details about the model's capabilities, pricing structure, and disgaeawiki.info execution guidelines. You can find detailed usage instructions, consisting of sample API calls and code snippets for integration. The design supports numerous text generation tasks, consisting of material production, code generation, and concern answering, utilizing its support discovering optimization and CoT reasoning abilities. The page likewise includes implementation options and licensing details to assist you get begun with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, select Deploy.

You will be prompted to configure the deployment 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 Variety of instances, go into a number of instances (in between 1-100). 6. For Instance type, pick your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up innovative security and facilities settings, consisting of virtual personal cloud (VPC) networking, service role consents, and file encryption settings. For most use cases, the default settings will work well. However, for production deployments, you may wish to examine these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start utilizing the model.

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

This is an excellent method to explore the design's reasoning and text generation capabilities before incorporating it into your applications. The play area supplies immediate feedback, assisting you understand how the design reacts to various inputs and letting you fine-tune your triggers for optimum outcomes.

You can quickly check the design in the play area through the UI. However, to conjure up the released model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run reasoning utilizing guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to perform inference using a deployed DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. 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. After you have developed the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up reasoning specifications, and sends a demand to create text based on a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, built-in algorithms, and prebuilt ML solutions that you can release with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, archmageriseswiki.com with your information, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses two practical techniques: utilizing the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's check out both approaches to assist you pick the method that best fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

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

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

- Model name

  • Provider name
  • Task category (for instance, Text Generation). Bedrock Ready badge (if applicable), showing that this design can be registered with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to conjure up the model

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

    The model details page includes the following details:

    - The design name and provider 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. specs.
  • Usage guidelines

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

    6. Choose Deploy to continue with release.

    7. For Endpoint name, utilize the immediately created name or produce a custom-made one.
  1. For Instance type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the number of instances (default: 1). Selecting suitable circumstances types and counts is essential for cost and performance optimization. Monitor wiki.myamens.com your implementation to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for precision. For this design, we strongly recommend adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to release the model.

    The implementation process 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 inference requests through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the implementation is total, you can invoke the design utilizing a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get begun with DeepSeek-R1 using the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the required AWS authorizations and environment setup. The following is a detailed code example that shows how to deploy and utilize DeepSeek-R1 for reasoning programmatically. The code for releasing the design is offered in the Github here. You can clone the notebook 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 create a guardrail utilizing the Amazon Bedrock console or the API, and implement it as shown in the following code:

    Clean up

    To avoid undesirable charges, finish the steps in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the design utilizing 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 deployments area, 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 deleting the right implementation: 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 erase the endpoint if you desire 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, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, 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 helps emerging generative AI business build ingenious services utilizing AWS services and accelerated compute. Currently, he is concentrated on establishing techniques for fine-tuning and optimizing the inference performance of big language designs. In his totally free time, Vivek takes pleasure in hiking, enjoying 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 Professional Solutions Architect working on 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 center. She is enthusiastic about building solutions that help customers accelerate their AI journey and unlock company worth.