Clone
1
DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
alvinmahurin72 edited this page 2025-02-15 18:36:06 +08: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 designs 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 versions ranging 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 get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to deploy the distilled versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that utilizes reinforcement learning to enhance reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial identifying function is its support knowing (RL) step, which was used to fine-tune the model's responses beyond the basic pre-training and tweak procedure. By including RL, DeepSeek-R1 can adapt more successfully to user feedback and objectives, eventually improving both importance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, indicating it's equipped to break down complex inquiries and reason through them in a detailed manner. This guided thinking process allows the model to produce more precise, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to create structured responses while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually captured the industry's attention as a versatile text-generation model that can be integrated into numerous workflows such as agents, logical thinking and information analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion specifications, making it possible for effective reasoning by routing queries to the most relevant expert "clusters." This approach allows the model to focus on various problem domains while maintaining general performance. DeepSeek-R1 needs 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 deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning abilities of the main R1 design 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 sized, more efficient models to simulate the habits and thinking patterns of the bigger DeepSeek-R1 model, using it as an instructor design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise releasing this design with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, prevent harmful content, and assess models against key safety criteria. At the time of writing this blog site, for DeepSeek-R1 implementations 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, improving user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, 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, pick Amazon SageMaker, and verify 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 request a limit boost, produce a limitation increase request and connect to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, prevent harmful material, and examine designs against essential security criteria. You can carry out precaution for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to examine user inputs and design actions 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 circulation involves the following steps: 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 to the model for reasoning. After getting the design'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 showing the nature of the intervention and whether it occurred at the input or wiki.rolandradio.net output phase. The examples showcased in the following sections demonstrate reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized foundation models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:

1. On the Amazon Bedrock console, choose Model brochure under Foundation designs in the navigation pane. At the time of composing this post, you can utilize 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 service provider and pick the DeepSeek-R1 model.

The model detail page offers important details about the model's capabilities, pricing structure, and application standards. You can discover detailed use guidelines, consisting of sample API calls and code snippets for integration. The model supports numerous text generation tasks, including content production, code generation, and question answering, utilizing its support finding out optimization and CoT reasoning abilities. The page likewise consists of implementation choices and licensing details to help you get started with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, select Deploy.

You will be prompted to set up the release details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters). 5. For Number of circumstances, enter a variety of instances (between 1-100). 6. For example type, select your instance type. For ideal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can configure innovative 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 wish to examine these settings to align with your company's security and compliance requirements. 7. to begin utilizing the model.

When the implementation is complete, you can check 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 design parameters like temperature level and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimum results. For example, material for reasoning.

This is an exceptional method to explore the design's thinking and text generation capabilities before incorporating it into your applications. The play area supplies instant feedback, assisting you understand how the model reacts to various inputs and letting you tweak your triggers for optimal results.

You can quickly check the design in the playground through the UI. However, to invoke the released model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run inference using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to carry out reasoning utilizing a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can develop 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 produced the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up inference criteria, 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 options that you can release 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 using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart offers 2 convenient approaches: using the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both methods to assist you select the method that finest fits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

1. On the SageMaker console, select 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 model internet browser shows available designs, with details like the company name and design abilities.

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

- Model name

  • Provider name
  • Task classification (for wakewiki.de instance, Text Generation). Bedrock Ready badge (if appropriate), showing that this model can be registered with Amazon Bedrock, allowing you to use Amazon Bedrock APIs to invoke the model

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

    The design details page includes the following details:

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

    The About tab consists of essential details, such as:

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

    Before you deploy the model, it's advised to examine the design details and wiki.snooze-hotelsoftware.de license terms to verify compatibility with your use case.

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, utilize the automatically produced name or create a customized one.
  1. For Instance type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the number of circumstances (default: 1). Selecting suitable instance types and counts is vital for cost and performance optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all setups for precision. For this model, we strongly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to release the model.

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

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

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To begin with DeepSeek-R1 using the SageMaker Python SDK, you will need to install 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 reasoning programmatically. The code for releasing the design is offered in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run additional requests against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail using the Amazon Bedrock console or the API, and implement it as revealed in the following code:

    Tidy up

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

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace releases.
  5. In the Managed deployments area, locate the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're deleting the correct deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you released will sustain costs 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 checked out how you can access and deploy the DeepSeek-R1 model 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 models, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting begun with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI companies develop innovative services utilizing AWS services and sped up calculate. Currently, he is concentrated on developing strategies for fine-tuning and optimizing the reasoning performance of large language designs. In his downtime, Vivek takes pleasure in treking, watching films, and attempting different cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team at AWS. His area 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 dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about constructing options that help customers accelerate their AI journey and unlock business worth.