1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Ali Mccune edited this page 2025-02-15 11:47:45 +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 thrilled 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 release DeepSeek AI's first-generation frontier model, setiathome.berkeley.edu DeepSeek-R1, in addition to the distilled variations varying from 1.5 to 70 billion specifications to construct, experiment, and properly scale your generative AI ideas 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 actions to deploy the distilled versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that utilizes reinforcement discovering to enhance reasoning capabilities through a multi-stage training process from a DeepSeek-V3-Base structure. A key differentiating feature is its support learning (RL) action, which was utilized to improve the design's actions beyond the standard pre-training and tweak procedure. By including RL, DeepSeek-R1 can adjust better to user feedback and objectives, ultimately enhancing both importance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, suggesting it's geared up to break down complicated questions and reason through them in a detailed manner. This guided reasoning procedure permits the model to produce more precise, transparent, wiki.vst.hs-furtwangen.de and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to generate structured responses while focusing on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has actually recorded the industry's attention as a versatile text-generation model that can be integrated into different workflows such as representatives, sensible thinking and data analysis jobs.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture enables activation of 37 billion parameters, making it possible for efficient inference by routing inquiries to the most appropriate professional "clusters." This approach enables the model to concentrate on different issue domains while maintaining overall efficiency. 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 circumstances to deploy the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning capabilities of the main R1 model to more efficient 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, more effective designs to imitate the habits and reasoning patterns of the larger DeepSeek-R1 design, utilizing it as a teacher design.

You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend deploying this design with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, avoid damaging material, and evaluate models against crucial security requirements. At the time of composing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create multiple guardrails tailored to various usage cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you need access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas console and pipewiki.org under AWS Services, pick Amazon SageMaker, and verify 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 releasing. To request a limitation increase, create a limit increase demand and reach out to your account group.

Because you will be releasing this design with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) approvals to utilize Amazon Bedrock Guardrails. For instructions, see Establish approvals to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent damaging content, and evaluate models against crucial security criteria. You can implement precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to examine user inputs and model responses 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 flow involves the following actions: 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 higgledy-piggledy.xyz inference. After getting the model's output, another guardrail check is used. If the output passes this final check, it's returned as the final outcome. However, if either the input or output is intervened by the guardrail, a message is returned showing the nature of the intervention and whether it took place at the input or output phase. The examples showcased in the following areas show reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers 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 steps:

1. On the Amazon Bedrock console, select 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 does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a provider and choose the DeepSeek-R1 model.

The model detail page provides necessary details about the design's capabilities, pricing structure, and application standards. You can discover detailed use directions, including sample API calls and code bits for integration. The model supports various text generation jobs, consisting of material creation, code generation, and concern answering, utilizing its support discovering optimization and CoT thinking abilities. The page also consists of release choices and licensing details to help you get going with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, pick 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, enter an endpoint name (between 1-50 alphanumeric characters). 5. For Number of circumstances, get in a variety of circumstances (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 suggested. Optionally, you can set up innovative security and facilities settings, consisting of virtual private cloud (VPC) networking, service function authorizations, and encryption settings. For a lot of utilize cases, disgaeawiki.info the default settings will work well. However, for production releases, you might wish to examine these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start 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 user interface where you can experiment with various prompts and adjust model specifications like temperature level and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimum outcomes. For instance, material for reasoning.

This is an exceptional method to check out the design's reasoning and text generation capabilities before incorporating it into your applications. The play area provides instant feedback, helping you understand how the design reacts to various inputs and letting you tweak your prompts for optimum results.

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

Run inference utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to perform inference using a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. 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. After you have created the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, configures reasoning parameters, and sends a request to create text based upon a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML options that you can release with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your information, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart offers two hassle-free methods: using the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both methods to help you select the technique that finest matches your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

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

4. Look for DeepSeek-R1 to view the DeepSeek-R1 model card. Each model card reveals essential details, including:

- Model name

  • Provider name
  • Task category (for example, Text Generation). Bedrock Ready badge (if applicable), showing that this design can be signed up with Amazon Bedrock, permitting you to utilize Amazon to invoke the design

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

    The model details page consists of the following details:

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

    The About tab includes important details, such as:

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

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

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, use the instantly produced name or produce a custom-made one.
  1. For Instance type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the number of instances (default: 1). Selecting appropriate instance types and counts is crucial for cost and efficiency optimization. Monitor your implementation to adjust 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 setups for precision. For this design, we strongly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to deploy the design.

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

    When deployment is complete, your endpoint status will change to InService. At this moment, the design is prepared to accept reasoning demands 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 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 utilizing the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the required AWS authorizations and environment setup. The following is a detailed code example that demonstrates how to release and utilize DeepSeek-R1 for inference programmatically. The code for releasing the model is offered in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run extra demands 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 shown in the following code:

    Clean up

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

    Delete the Amazon Bedrock Marketplace release

    If you deployed the model using Amazon Bedrock Marketplace, total the following actions:

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

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you released will sustain expenses if you leave it running. Use the following code to delete the endpoint if you wish to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we checked out how you can access and release 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 Starting 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 build ingenious solutions utilizing AWS services and sped up compute. Currently, he is focused on establishing strategies for fine-tuning and optimizing the inference performance of large language models. In his totally free time, Vivek enjoys treking, enjoying movies, 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 Professional Solutions Architect working on 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 building options that assist consumers accelerate their AI journey and unlock company worth.