1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Katrin Dilke edited this page 2025-02-07 14:49:40 +01: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 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 variations ranging from 1.5 to 70 billion specifications to construct, experiment, and properly 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 comparable steps to release the distilled versions of the designs too.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that utilizes support discovering to enhance thinking abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial distinguishing feature is its support knowing (RL) step, which was used to fine-tune the design's actions beyond the standard pre-training and fine-tuning process. By integrating RL, DeepSeek-R1 can adjust more successfully to user feedback and goals, eventually improving both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, implying it's geared up to break down complicated inquiries and reason through them in a detailed manner. This guided reasoning process enables the design to produce more accurate, transparent, and detailed responses. This design combines RL-based fine-tuning with CoT abilities, aiming to create structured responses while focusing on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually captured the industry's attention as a flexible text-generation design that can be integrated into numerous workflows such as representatives, logical thinking and information interpretation jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture allows activation of 37 billion specifications, making it possible for effective inference by routing queries to the most appropriate professional "clusters." This approach enables the model to focus on various problem domains while maintaining general performance. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking abilities of the main R1 model to more effective architectures based upon 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 effective designs to imitate the behavior and thinking patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor design.

You can deploy DeepSeek-R1 model either through SageMaker JumpStart or . Because DeepSeek-R1 is an emerging model, we advise deploying this model with guardrails in place. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid harmful content, forum.altaycoins.com and assess models against key security requirements. 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 multiple guardrails tailored to different usage cases and apply them to the DeepSeek-R1 model, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy 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, pick Amazon SageMaker, and confirm you're utilizing 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 limitation boost, create a limit increase demand and reach out to your account team.

Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the proper AWS Identity and Gain Access To Management (IAM) authorizations to utilize Amazon Bedrock Guardrails. For directions, see Set up authorizations to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

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

The basic flow involves the following actions: 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 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 stepped in by the guardrail, a message is returned suggesting the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following sections demonstrate reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives 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, choose Model brochure under Foundation designs 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 company and pick the DeepSeek-R1 design.

The design detail page provides important details about the model's abilities, pricing structure, and execution guidelines. You can find detailed use guidelines, consisting of sample API calls and code bits for combination. The design supports numerous text generation tasks, including content development, code generation, and question answering, utilizing its support discovering optimization and CoT thinking abilities. The page also consists of release alternatives and licensing details to help you start with DeepSeek-R1 in your applications. 3. To start using DeepSeek-R1, select Deploy.

You will be prompted to configure the implementation 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, enter a number of instances (between 1-100). 6. For Instance type, select your circumstances type. For ideal efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and facilities settings, consisting of virtual personal cloud (VPC) networking, service function permissions, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production implementations, you might wish to review 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 test 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 try out different triggers and adjust design specifications like temperature and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for ideal outcomes. For instance, content for inference.

This is an excellent method to explore the model's reasoning and text generation capabilities before integrating it into your applications. The play ground supplies instant feedback, helping you comprehend how the design responds to different inputs and letting you tweak your prompts for optimal outcomes.

You can rapidly evaluate the design in the play area through the UI. However, to invoke the deployed 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 deployed DeepSeek-R1 model 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 actually developed the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime customer, sets up inference criteria, and sends a demand to produce text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, built-in algorithms, and prebuilt ML services that you can release with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your information, and release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart provides 2 practical methods: using the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both approaches to help you select the method that finest matches your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The model web browser shows available models, with details like the service provider name and model capabilities.

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

- Model name

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

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

    The design details page consists of the following details:

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

    The About tab consists of essential details, wiki.myamens.com such as:

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

    Before you release the model, it's advised to examine the model details and license terms to validate compatibility with your use case.

    6. Choose Deploy to continue with release.

    7. For Endpoint name, utilize the instantly created name or produce a custom-made one.
  1. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, enter the number of circumstances (default: 1). Selecting appropriate instance types and counts is vital for cost and performance optimization. Monitor your deployment to change 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 accuracy. For this model, we highly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to release the model.

    The deployment procedure can take a number of minutes to complete.

    When deployment is complete, your endpoint status will change to InService. At this moment, the design is ready to accept reasoning demands through the endpoint. You can keep an eye on the deployment progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the release is total, you can conjure up the design utilizing a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start 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 authorizations and environment setup. The following is a detailed code example that shows how to deploy and use DeepSeek-R1 for reasoning programmatically. The code for deploying the design is supplied in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run additional demands against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, wiki.myamens.com you can also 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 displayed in the following code:

    Tidy up

    To avoid undesirable charges, complete the actions in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

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

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

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed 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 release the DeepSeek-R1 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, 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 assists emerging generative AI companies build ingenious options using AWS services and accelerated compute. Currently, he is concentrated on developing methods for fine-tuning and enhancing the reasoning performance of big language models. In his downtime, Vivek enjoys treking, enjoying motion pictures, and attempting various cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group 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 team 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 building services that help clients accelerate their AI journey and unlock service value.