1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
violetteblyth edited this page 2025-04-06 20:08:14 +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 delighted 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 design, DeepSeek-R1, in addition to the distilled variations ranging from 1.5 to 70 billion specifications to construct, experiment, and properly scale your generative AI concepts on AWS.

In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable steps to deploy the distilled variations of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that uses support finding out to improve thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential differentiating function is its support knowing (RL) step, which was utilized to refine the model's responses beyond the standard pre-training and fine-tuning process. By incorporating RL, DeepSeek-R1 can adapt better to user feedback and goals, eventually improving both importance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, indicating it's equipped to break down complex questions and factor through them in a detailed manner. This assisted reasoning procedure permits the design to produce more precise, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT abilities, aiming to produce structured reactions while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has captured the industry's attention as a versatile text-generation model that can be incorporated into different workflows such as representatives, logical thinking and information interpretation tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion specifications, allowing effective inference by routing questions to the most appropriate professional "clusters." This approach enables the model to focus on different issue domains while maintaining general effectiveness. 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 design. 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 design to more effective architectures based upon popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a process of training smaller sized, more effective models to mimic the behavior and thinking patterns of the larger DeepSeek-R1 model, mediawiki.hcah.in utilizing it as a teacher design.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest deploying this model with guardrails in place. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent damaging content, and evaluate models against key safety criteria. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create several guardrails tailored to various use cases and apply them to the DeepSeek-R1 model, improving user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you require access to an ml.p5e instance. To examine 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 setiathome.berkeley.edu endpoint use. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are deploying. To request a limit boost, develop a limit boost demand and reach out to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, prevent damaging content, and assess designs against essential security criteria. You can carry out security procedures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to examine user inputs and model 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 create the guardrail, see the GitHub repo.

The general circulation involves the following actions: 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 design for inference. After receiving 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 indicating the nature of the intervention and whether it took place at the input or output stage. The examples showcased in the following sections show inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, wiki.rolandradio.net and specialized structure 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 catalog under Foundation models in the navigation pane. At the time of composing this post, you can use the InvokeModel API to invoke the design. It does not APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and select the DeepSeek-R1 model.

The design detail page offers important details about the design's abilities, pricing structure, and execution guidelines. You can find detailed use instructions, including sample API calls and code snippets for combination. The design supports various text generation tasks, including material development, code generation, and concern answering, utilizing its support finding out optimization and CoT reasoning capabilities. The page also consists of deployment choices 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 deployment details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters). 5. For Variety of instances, go into a variety of instances (in between 1-100). 6. For example type, pick your circumstances type. For ideal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can configure sophisticated security and facilities settings, consisting of virtual private cloud (VPC) networking, service function approvals, and file encryption settings. For many use cases, the default settings will work well. However, for production deployments, you may want to examine these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start utilizing the model.

When the deployment is complete, you can evaluate 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 experiment with different triggers and change design specifications like temperature level and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimum outcomes. For instance, content for reasoning.

This is an exceptional way to check out the model's reasoning and text generation abilities before incorporating it into your applications. The playground provides instant feedback, helping you comprehend how the design reacts to various inputs and letting you tweak your prompts for optimal results.

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

Run reasoning using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to carry out inference using a deployed DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo. After you have actually created the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, 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, built-in algorithms, and prebuilt ML options that you can release with just a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your data, it-viking.ch and release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart provides 2 convenient approaches: using the intuitive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's check out both techniques to assist you pick the method that finest fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following steps to deploy DeepSeek-R1 using SageMaker JumpStart:

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

The model browser displays available models, with details like the supplier name and model abilities.

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

- Model name

  • Provider name
  • Task classification (for example, Text Generation). Bedrock Ready badge (if suitable), indicating that this design can be registered with Amazon Bedrock, permitting you to utilize Amazon Bedrock APIs to conjure up the model

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

    The model details page includes the following details:

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

    The About tab consists of crucial details, such as:

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

    Before you release the design, it's recommended to review the design details and license terms to confirm compatibility with your use case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the instantly generated name or develop a custom-made one.
  1. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the variety of circumstances (default: 1). Selecting appropriate instance types and counts is crucial for cost and performance optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations for precision. For this model, we highly advise sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to deploy the design.

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

    When release is complete, higgledy-piggledy.xyz your endpoint status will alter to InService. At this moment, the design is ready to accept inference demands through the endpoint. You can keep an eye on the implementation progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the implementation is complete, you can invoke the design using a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using 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 necessary 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 supplied in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run additional requests 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 utilizing the Amazon Bedrock console or yewiki.org the API, and implement it as displayed in the following code:

    Tidy up

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

    Delete the Amazon Bedrock Marketplace release

    If you released the model utilizing Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace releases.
  5. In the Managed deployments section, locate the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, choose 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 released will sustain expenses 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 design utilizing 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 designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and it-viking.ch Getting begun 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 construct innovative options using AWS services and accelerated calculate. Currently, he is focused on establishing techniques for fine-tuning and enhancing the inference efficiency of big language designs. In his leisure time, Vivek takes pleasure in treking, watching motion pictures, and trying various 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 technology 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 item, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about constructing services that help customers accelerate their AI journey and unlock service worth.