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


Today, we are thrilled to reveal 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, together with the distilled variations varying from 1.5 to 70 billion criteria to construct, experiment, and responsibly scale your generative AI concepts on AWS.

In this post, we demonstrate how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to deploy the distilled variations of the designs also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that uses reinforcement finding out to enhance thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A key distinguishing feature is its reinforcement learning (RL) action, which was used to fine-tune the model’s actions beyond the standard pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adjust better to user feedback and objectives, ultimately boosting both significance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, suggesting it’s geared up to break down complicated queries and reason through them in a detailed manner. This directed thinking process enables the model to produce more precise, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT abilities, aiming to generate structured reactions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has caught the industry’s attention as a versatile text-generation model that can be incorporated into different workflows such as representatives, logical reasoning and information interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion specifications, enabling effective inference by routing inquiries to the most pertinent professional “clusters.” This method permits the model to concentrate on various issue domains while maintaining overall effectiveness. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge circumstances to release the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking capabilities of the main R1 design to more efficient architectures based upon popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller, more effective models to mimic the habits and reasoning 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 model, we advise deploying this model with guardrails in place. In this blog, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent damaging content, and evaluate models against key security criteria. At the time of composing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create several guardrails tailored to various use cases and use 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 need access to an ml.p5e instance. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and verify you’re utilizing 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 ask for a limitation increase, produce a limitation increase request and reach out to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, prevent damaging content, and examine models against essential safety criteria. You can implement safety steps for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This you to apply guardrails to examine user inputs and design responses 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 general 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 model 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 outcome. 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 demonstrate reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

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

1. On the Amazon Bedrock console, pick Model catalog under Foundation models in the navigation pane. At the time of writing this post, you can utilize the InvokeModel API to conjure up the model. It does not support Converse APIs and other Amazon Bedrock tooling.

  1. Filter for DeepSeek as a supplier and pick the DeepSeek-R1 model.

    The design detail page offers necessary details about the design’s capabilities, rates structure, and application standards. You can discover detailed use directions, including sample API calls and code bits for combination. The model supports different text generation jobs, including content development, code generation, and concern answering, using its support finding out optimization and CoT reasoning abilities. The page also includes deployment options and licensing details to help you start with DeepSeek-R1 in your applications.
  2. To begin utilizing DeepSeek-R1, pick Deploy.

    You will be prompted to configure the release details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters).
  4. For Variety of circumstances, enter a variety of instances (between 1-100).
  5. For Instance type, select your instance type. For optimum efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure advanced security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role approvals, and file encryption settings. For most utilize cases, the default settings will work well. However, for production releases, you may desire to review these settings to line up with your company’s security and compliance requirements.
  6. Choose Deploy to start using the model.

    When the implementation is total, you can test DeepSeek-R1’s capabilities straight in the Amazon Bedrock play ground.
  7. Choose Open in play area to access an interactive user interface where you can experiment with different prompts and adjust design criteria like temperature and optimum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat template for optimum results. For example, material for reasoning.

    This is an outstanding method to explore the model’s reasoning and text generation abilities before incorporating it into your applications. The playground offers immediate feedback, helping you comprehend how the design reacts to numerous inputs and letting you tweak your prompts for systemcheck-wiki.de optimal outcomes.

    You can quickly check the model in the playground through the UI. However, to conjure up the released 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 demonstrates how to carry out reasoning using a released DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can create a guardrail utilizing the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo. After you have actually created the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime customer, sets up reasoning parameters, and sends a demand to produce text based on a user timely.

    Deploy DeepSeek-R1 with SageMaker JumpStart

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

    Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 practical approaches: using the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s explore both methods to assist you select the technique that best fits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

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

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

    - Model name
  10. Provider name
  11. Task classification (for wiki.whenparked.com example, Text Generation). Bedrock Ready badge (if relevant), 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 model details page.

    The design details page includes the following details:

    - The design name and wiki.dulovic.tech company details. Deploy button to release the design. About and Notebooks tabs with detailed details

    The About tab consists of crucial details, such as:

    - Model description.
  12. License details.
  13. Technical requirements.
  14. Usage standards

    Before you release the model, it’s recommended to examine the design details and wiki.snooze-hotelsoftware.de license terms to confirm compatibility with your usage case.

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, utilize the immediately created name or produce a custom-made one.
  15. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, get in the variety of circumstances (default: 1). Selecting appropriate instance types and counts is essential for cost and efficiency 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.
  17. Review all setups for accuracy. For this design, we strongly suggest adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  18. Choose Deploy to deploy the design.

    The implementation procedure can take several minutes to finish.

    When implementation is complete, your endpoint status will alter to InService. At this moment, the model is prepared to accept reasoning requests through the endpoint. You can keep track of the deployment progress on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the release is complete, you can conjure up the model using a SageMaker runtime customer and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the needed 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 model is supplied 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 produce a guardrail utilizing the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Tidy up

    To prevent undesirable charges, finish the actions in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, setiathome.berkeley.edu pick Marketplace deployments.
  19. In the Managed releases section, find the endpoint you want to delete.
  20. Select the endpoint, and on the Actions menu, choose Delete.
  21. Verify the endpoint details to make certain you’re deleting the proper release: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed will sustain expenses if you leave it running. Use the following code to delete 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 model 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 designs, 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 options using AWS services and sped up compute. Currently, he is concentrated on establishing techniques for fine-tuning and enhancing the reasoning performance of large language designs. In his free time, Vivek takes pleasure in treking, seeing 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 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 team at AWS.

    Banu Nagasundaram leads item, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is passionate about constructing options that help customers accelerate their AI journey and unlock business value.