2 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Aleisha Becher edited this page 14 hours ago


Today, we are thrilled to announce that DeepSeek R1 distilled Llama and Qwen models 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, in addition to the distilled versions varying from 1.5 to 70 billion criteria to develop, experiment, and properly scale your generative AI concepts on AWS.

In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to release the distilled versions of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) established by DeepSeek AI that utilizes support learning to improve reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential differentiating feature is its reinforcement learning (RL) action, which was utilized to improve the model's reactions beyond the standard pre-training and fine-tuning procedure. By integrating RL, DeepSeek-R1 can adapt better to user feedback and objectives, eventually improving both importance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, implying it's geared up to break down complex inquiries and reason through them in a detailed way. This directed thinking procedure permits the design to produce more accurate, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to create structured responses while focusing on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually caught the market's attention as a flexible text-generation design that can be integrated into various workflows such as representatives, sensible reasoning and information analysis 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 criteria, making it possible for effective inference by routing inquiries to the most appropriate specialist "clusters." This method enables the design to focus on various problem domains while maintaining overall performance. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge instance to deploy the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning capabilities of the main R1 model to more effective architectures based on popular open models 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 habits and thinking patterns of the larger DeepSeek-R1 design, utilizing it as a teacher model.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest deploying this model with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous material, and assess models against crucial security criteria. At the time of composing this blog, 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 use cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you require access to an ml.p5e instance. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and validate you're utilizing ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are releasing. To ask for a limitation increase, create a limitation increase demand and connect to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, avoid damaging material, and assess models against crucial safety requirements. You can carry out security measures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to evaluate user inputs and model reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail utilizing the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo.

The basic circulation includes the following steps: 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 reasoning. After getting the model'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 stepped in by the guardrail, a message is returned indicating the nature of the intervention and whether it took place at the input or output phase. The examples showcased in the following sections show reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives 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 steps:

1. On the Amazon Bedrock console, select Model brochure under Foundation models in the navigation pane. At the time of writing this post, you can use 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 supplier and choose the DeepSeek-R1 model.

The model detail page supplies important details about the model's abilities, prices structure, and application guidelines. You can discover detailed use instructions, consisting of sample API calls and code bits for integration. The model supports numerous text generation tasks, including material production, code generation, and concern answering, using its support learning optimization and CoT thinking abilities. The page likewise includes deployment choices and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, choose Deploy.

You will be triggered to set up the deployment details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of circumstances, go into a number of instances (between 1-100). 6. For Instance type, pick your instance type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up advanced security and facilities settings, including virtual personal cloud (VPC) networking, disgaeawiki.info service function permissions, and file encryption settings. For most utilize cases, the default settings will work well. However, for production implementations, you may desire to examine these settings to align with your company's security and compliance requirements. 7. Choose Deploy to start utilizing the model.

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 interface where you can explore different triggers and adjust model specifications like temperature level and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimum outcomes. For instance, material for reasoning.

This is an exceptional method to explore the model's reasoning and text generation abilities before integrating it into your applications. The play area provides instant feedback, assisting you understand how the model reacts to numerous inputs and letting you fine-tune your prompts for optimal outcomes.

You can rapidly test the design in the play area through the UI. However, to conjure up the deployed design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run reasoning using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to carry out reasoning utilizing a released DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can create 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 created the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime client, configures inference specifications, 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) hub with FMs, integrated algorithms, and prebuilt ML solutions that you can deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your data, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart offers 2 practical methods: using the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both techniques to assist you choose the approach that best suits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

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

4. Search for DeepSeek-R1 to view the DeepSeek-R1 design card. Each design card shows key details, including:

- Model name

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

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

    The model details page consists of the following details:

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

    The About tab consists of important details, such as:

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

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

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, use the automatically produced name or create a custom one.
  1. For Instance type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the variety of circumstances (default: 1). Selecting proper circumstances types and counts is crucial for cost and performance optimization. Monitor your release to adjust 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 setups for accuracy. For this design, we strongly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to deploy the model.

    The release process can take a number of minutes to complete.

    When implementation is total, your endpoint status will alter to InService. At this moment, the design is prepared to accept inference demands through the endpoint. You can keep an eye on the deployment progress on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the deployment is complete, you can conjure up the model using a SageMaker runtime customer and incorporate 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 set up the SageMaker Python SDK and make certain you have the required AWS approvals and environment setup. The following is a detailed code example that demonstrates how to deploy and utilize DeepSeek-R1 for reasoning programmatically. The code for releasing the model is offered in the Github here. You can clone the note pad and run from SageMaker Studio.

    You can run additional demands 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 execute it as revealed in the following code:

    Tidy up

    To prevent undesirable charges, complete the steps in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you released the design utilizing Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace deployments.
  5. In the Managed implementations section, locate the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, choose Delete.
  7. Verify the endpoint details to make certain you're deleting the proper deployment: 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 desire 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 utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Beginning with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI business build innovative options using AWS services and accelerated compute. Currently, he is concentrated on establishing strategies for fine-tuning and enhancing the reasoning efficiency of big language models. In his spare time, Vivek takes pleasure in hiking, watching motion pictures, and attempting various cuisines.

    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 Science and Bioinformatics.

    Jonathan Evans is an Expert Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads product, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about building services that help consumers accelerate their AI journey and unlock service value.