1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Cleo Stjohn edited this page 2 weeks ago
This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.


Today, we are delighted to announce that DeepSeek R1 distilled Llama and larsaluarna.se Qwen models are available through Amazon Bedrock Marketplace and Amazon SageMaker JumpStart. With this launch, you can now release DeepSeek AI's first-generation frontier design, DeepSeek-R1, together with the distilled versions 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 begun 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 big language model (LLM) established by DeepSeek AI that uses support discovering to enhance reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A key identifying function is its support knowing (RL) action, which was used to improve the design's reactions beyond the basic pre-training and wiki.dulovic.tech tweak procedure. By incorporating RL, DeepSeek-R1 can adjust more efficiently to user feedback and objectives, ultimately boosting both significance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, suggesting it's equipped to break down intricate queries and reason through them in a detailed manner. This guided thinking process permits the model to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to generate structured actions while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually caught the market's attention as a versatile text-generation model that can be integrated into numerous workflows such as agents, logical reasoning and data analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion in size. The MoE architecture allows activation of 37 billion specifications, allowing efficient inference by routing questions to the most pertinent professional "clusters." This method permits the model to concentrate on different problem domains while maintaining general effectiveness. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will use an ml.p5e.48 xlarge instance to release the model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning abilities 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 effective models to simulate the behavior and reasoning patterns of the bigger DeepSeek-R1 design, 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 model, we recommend releasing this model with guardrails in location. In this blog, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent damaging material, and evaluate models against key security requirements. At the time of composing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create numerous guardrails tailored to different usage cases and apply them to the DeepSeek-R1 model, improving user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you require access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and confirm you're using 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 limit boost, produce a limitation boost request and connect to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent damaging content, and examine models against essential safety requirements. You can execute precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and design responses released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.

The basic circulation involves the following steps: First, the system receives an input for the design. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent out to the design 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 final 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 phase. The examples showcased in the following areas demonstrate inference using 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, complete the following actions:

1. On the Amazon Bedrock console, choose Model catalog 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 doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a provider and pick the DeepSeek-R1 design.

The model detail page supplies vital details about the model's capabilities, prices structure, and execution standards. You can discover detailed usage instructions, including sample API calls and code bits for integration. The design supports numerous text generation tasks, including material production, code generation, and question answering, using its support finding out optimization and CoT reasoning capabilities. The page likewise consists of deployment alternatives and licensing details to help you get begun with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, choose Deploy.

You will be prompted to set up 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 (in between 1-100). 6. For example type, pick your instance type. For optimum performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is suggested. Optionally, you can set up advanced security and infrastructure settings, consisting of virtual personal cloud (VPC) networking, service function authorizations, and file encryption settings. For many use cases, the default settings will work well. However, for production releases, you may wish to examine these settings to align with your company's security and compliance requirements. 7. Choose Deploy to begin utilizing the model.

When the deployment is total, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock playground. 8. Choose Open in play area to access an interactive user interface where you can explore various prompts and change design criteria like temperature level and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for ideal results. For instance, content for inference.

This is an outstanding way to explore the design's reasoning and text generation abilities before integrating it into your applications. The playground supplies immediate feedback, helping you comprehend how the design responds to different inputs and letting you tweak your triggers for optimum outcomes.

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

Run inference using guardrails with the released DeepSeek-R1 endpoint

The following code example demonstrates how to carry out inference using a released DeepSeek-R1 design 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 create 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 client, configures inference parameters, and sends out 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, integrated algorithms, and prebuilt ML services that you can deploy with simply a few 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 offers 2 convenient approaches: utilizing the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both techniques to help you choose the method that best suits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions 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 produce a domain. 3. On the SageMaker Studio console, select JumpStart in the navigation pane.

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

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

- Model name

  • Provider name
  • Task classification (for instance, Text Generation). Bedrock Ready badge (if applicable), showing that this model 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 model 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 crucial details, such as:

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

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

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, wavedream.wiki utilize the automatically generated name or produce a customized one.
  1. For Instance type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the number of instances (default: 1). Selecting appropriate instance types and counts is essential for expense and performance optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time reasoning is chosen by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for precision. For this model, we strongly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to release the model.

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

    When release is total, your endpoint status will change to InService. At this moment, the model is ready to accept reasoning demands through the endpoint. You can monitor the release development on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the deployment is complete, you can invoke 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 required AWS permissions and environment setup. The following is a detailed code example that shows how to release and use DeepSeek-R1 for reasoning programmatically. The code for deploying the model is provided in the Github here. You can clone the notebook 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 utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail using the Amazon Bedrock console or the API, and execute it as shown in the following code:

    Tidy up

    To prevent unwanted charges, complete the actions in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the design using Amazon Bedrock Marketplace, total the following actions:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace implementations.
  5. In the Managed releases section, find the endpoint you desire 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 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 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. 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 Beginning with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI companies build ingenious options using AWS services and accelerated compute. Currently, he is concentrated on establishing techniques for fine-tuning and optimizing the reasoning efficiency of large language models. In his downtime, Vivek takes pleasure in hiking, seeing films, 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 Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

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