1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
rhondah8723836 edited this page 2025-04-08 10:53:27 +00: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 excited 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 release DeepSeek AI's first-generation frontier model, DeepSeek-R1, together with the distilled variations varying from 1.5 to 70 billion parameters to build, experiment, and properly scale your generative AI concepts on AWS.

In this post, we demonstrate how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable steps to release the distilled versions of the designs also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that utilizes reinforcement learning to improve reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A key identifying feature is its support learning (RL) action, which was used to refine the model's reactions beyond the basic pre-training and tweak procedure. By integrating RL, DeepSeek-R1 can adapt more successfully to user feedback and goals, eventually enhancing both relevance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, meaning it's equipped to break down complicated questions and factor through them in a detailed way. This guided reasoning process enables the design to more precise, transparent, and detailed responses. This design combines RL-based fine-tuning with CoT capabilities, aiming to produce structured actions while focusing on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has recorded the industry's attention as a flexible text-generation design that can be incorporated into various workflows such as agents, rational reasoning and information analysis 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, making it possible for efficient reasoning by routing queries to the most relevant expert "clusters." This approach enables the design to focus on various issue domains while maintaining general 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 instance to deploy the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

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

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we recommend deploying this model with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid harmful material, and assess models against key safety criteria. At the time of writing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce several guardrails tailored to various use cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you need 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 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 deploying. To request a limitation increase, develop a limitation increase request and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, avoid harmful material, and assess models against key safety requirements. You can implement precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to examine user inputs and design reactions 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 produce the guardrail, see the GitHub repo.

The general flow includes 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 to the design for reasoning. After getting the design's output, another guardrail check is used. If the output passes this final check, it's returned as the result. 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 happened at the input or output stage. 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 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 catalog under Foundation models in the navigation pane. At the time of writing this post, you can utilize the InvokeModel API to invoke the design. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and choose the DeepSeek-R1 design.

The design detail page provides necessary details about the model's capabilities, rates structure, and implementation standards. You can find detailed use guidelines, including sample API calls and code snippets for integration. The design supports numerous text generation jobs, including content production, code generation, and concern answering, using its support learning optimization and CoT reasoning capabilities. The page also consists of release alternatives and licensing details to assist you get begun with DeepSeek-R1 in your applications. 3. 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. 4. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of instances, enter a number of instances (between 1-100). 6. For Instance type, select your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, you can set up sophisticated security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role authorizations, and file encryption settings. For most use cases, the default settings will work well. However, for production releases, you may wish to review these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to begin utilizing the design.

When the release is complete, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock playground. 8. Choose Open in playground to access an interactive interface where you can experiment with various triggers and adjust design criteria like temperature level and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for ideal outcomes. For instance, material for inference.

This is an excellent way to explore the design's reasoning and text generation abilities before incorporating it into your applications. The play area provides instant feedback, helping you understand how the model reacts to various inputs and letting you fine-tune your prompts for optimal results.

You can quickly test the design in the play ground through the UI. However, to invoke the released model 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 demonstrates how to carry out inference utilizing a deployed 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 produced the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime client, configures reasoning specifications, and sends a request to produce text based upon a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

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

Deploying DeepSeek-R1 design through SageMaker JumpStart offers 2 practical approaches: utilizing the intuitive SageMaker JumpStart UI or larsaluarna.se implementing programmatically through the SageMaker Python SDK. Let's explore both techniques to help you pick the technique that finest matches 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 develop a domain. 3. On the SageMaker Studio console, pick JumpStart in the navigation pane.

The design browser displays available designs, with details like the service provider name and design capabilities.

4. Search for DeepSeek-R1 to view the DeepSeek-R1 design card. Each design card shows crucial details, consisting of:

- Model name

  • Provider name
  • Task classification (for higgledy-piggledy.xyz example, Text Generation). Bedrock Ready badge (if relevant), indicating that this design can be signed up with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to invoke the design

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

    The model details page includes the following details:

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

    The About tab consists of essential details, such as:

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

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

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, use the instantly generated name or produce a custom one.
  1. For Instance type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the variety of instances (default: 1). Selecting appropriate instance types and counts is vital for cost 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 larsaluarna.se precision. For this design, we highly advise adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to deploy the design.

    The implementation process can take numerous minutes to complete.

    When deployment is total, your endpoint status will change to InService. At this point, the design is prepared to accept inference requests through the endpoint. You can monitor the implementation progress on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the release is complete, you can invoke the design using a SageMaker runtime customer and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To begin 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 consents and environment setup. The following is a detailed code example that demonstrates how to deploy and use DeepSeek-R1 for inference programmatically. The code for deploying the model is supplied 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 also use 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:

    Clean up

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

    Delete the Amazon Bedrock Marketplace release

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace releases.
  5. In the Managed implementations area, find the endpoint you wish 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 right deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed will sustain costs 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 deploy 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, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, demo.qkseo.in 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 innovative options using AWS services and accelerated compute. Currently, he is focused on establishing methods for fine-tuning and optimizing the inference performance of big language designs. In his totally free time, Vivek takes pleasure in treking, enjoying 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 a Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science group 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 constructing solutions that assist consumers accelerate their AI journey and unlock company value.