5 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Alta Forest edited this page 5 days ago


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 deploy DeepSeek AI's first-generation frontier model, DeepSeek-R1, together with the distilled variations ranging from 1.5 to 70 billion parameters to build, experiment, and responsibly scale your generative AI ideas on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that uses support learning to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A key distinguishing feature is its support learning (RL) action, which was used to improve the design's reactions beyond the basic pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adjust better to user feedback and objectives, eventually improving both relevance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, meaning it's equipped to break down complicated questions and factor through them in a detailed way. This assisted reasoning procedure allows the model to produce more accurate, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT capabilities, aiming to create structured reactions while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has caught the market's attention as a versatile text-generation design that can be incorporated into various workflows such as representatives, sensible reasoning and information analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion parameters, enabling effective inference by routing inquiries to the most relevant expert "clusters." This method permits the design to specialize in various issue domains while maintaining total performance. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for inference. In this post, we will use an ml.p5e.48 xlarge circumstances to deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning capabilities of the main R1 model to more effective architectures based upon popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a procedure of training smaller sized, more efficient models to simulate the habits and thinking patterns of the larger DeepSeek-R1 model, using it as an instructor design.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend deploying this design with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, avoid damaging material, and against crucial safety criteria. At the time of composing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce numerous guardrails tailored to different usage cases and apply them to the DeepSeek-R1 model, wiki.snooze-hotelsoftware.de improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, 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, select Amazon SageMaker, and validate 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 deploying. To request a limitation increase, develop a limitation boost request and reach out to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent harmful content, and assess models against essential security requirements. You can execute precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to examine 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 produce the guardrail, see the GitHub repo.

The general circulation includes the following actions: First, the system receives an input for the model. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent out to the model 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 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 occurred at the input or output stage. The examples showcased in the following areas demonstrate inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, systemcheck-wiki.de emerging, and specialized foundation models (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 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. 2. Filter for DeepSeek as a company and pick the DeepSeek-R1 design.

The design detail page provides essential details about the model's abilities, prices structure, and execution standards. You can find detailed use guidelines, including sample API calls and code snippets for combination. The design supports different text generation jobs, including content development, code generation, and concern answering, utilizing its support finding out optimization and CoT thinking abilities. The page likewise consists of deployment alternatives and licensing details to help you get going with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, select Deploy.

You will be triggered to configure the implementation details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (between 1-50 alphanumeric characters). 5. For Variety of instances, go into a number of circumstances (between 1-100). 6. For Instance type, pick your circumstances type. For optimal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can set up sophisticated security and facilities settings, including virtual personal cloud (VPC) networking, service function approvals, and encryption settings. For a lot of utilize cases, the default settings will work well. However, for production deployments, you may want to review these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to begin using the model.

When the release is complete, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in play area to access an interactive interface where you can explore various prompts and change design specifications like temperature level and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for ideal results. For example, content for reasoning.

This is an outstanding way to explore the design's thinking and text generation abilities before incorporating it into your applications. The playground provides instant feedback, helping you understand how the design responds to various inputs and letting you fine-tune your triggers for optimal outcomes.

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

Run reasoning using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to perform reasoning utilizing 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 develop the guardrail, see the GitHub repo. After you have developed the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime client, sets up reasoning criteria, and sends out a demand to produce text based upon a user timely.

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 simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 practical techniques: using the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both approaches to help you pick the method that best suits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The design browser shows available models, with details like the company name and design capabilities.

4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card. Each model card reveals key details, consisting of:

- Model name

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

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

    The model details page includes the following details:

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

    The About tab consists of important details, such as:

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

    Before you release the design, it's suggested to examine the model details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to continue with release.

    7. For Endpoint name, use the instantly produced name or produce a customized one.
  1. For example type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the variety of circumstances (default: 1). Selecting appropriate circumstances types and counts is crucial for cost and efficiency optimization. Monitor your implementation to change these settings as needed.Under Inference type, Real-time inference is picked by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this design, we strongly suggest adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to deploy the model.

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

    When implementation is total, your endpoint status will change to InService. At this point, the design is all set to accept inference requests through the endpoint. You can keep an eye on the deployment progress on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the implementation is total, you can invoke the model utilizing a SageMaker runtime customer and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get begun with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the essential AWS approvals and environment setup. The following is a detailed code example that shows how to deploy and utilize DeepSeek-R1 for inference programmatically. The code for releasing the design is provided in the Github here. You can clone the notebook and run 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 also utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail using the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Tidy up

    To avoid unwanted charges, finish the actions in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the model utilizing Amazon Bedrock Marketplace, complete the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace implementations.
  5. In the Managed deployments section, locate the endpoint you want to delete.
  6. Select the endpoint, and on the Actions menu, select 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 deployed will sustain expenses if you leave it running. Use the following code to erase the endpoint if you want to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we explored 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 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 Getting started 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 develop ingenious services utilizing AWS services and sped up compute. Currently, he is focused on establishing methods for fine-tuning and optimizing the reasoning performance of large language models. In his free time, Vivek enjoys treking, watching 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 location of focus is AWS AI accelerators (AWS Neuron). He holds a Bachelor's degree in Computer Science 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 item, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about constructing services that help customers accelerate their AI journey and unlock company value.