1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
rowenak2460409 edited this page 2025-04-05 16:39: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 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 design, DeepSeek-R1, along with the distilled variations varying from 1.5 to 70 billion parameters to construct, experiment, and responsibly scale your generative AI ideas on AWS.

In this post, we demonstrate how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled variations of the models as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that uses support discovering to enhance thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential differentiating function is its reinforcement learning (RL) action, which was utilized to improve the design's responses beyond the basic pre-training and fine-tuning process. By incorporating RL, DeepSeek-R1 can adapt better to user feedback and goals, eventually boosting both importance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, implying it's equipped to break down intricate questions and reason through them in a detailed manner. This directed thinking process permits the design to produce more precise, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT abilities, aiming to create structured reactions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually captured the industry's attention as a versatile text-generation model that can be incorporated into different workflows such as agents, logical thinking and information interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion specifications, making it possible for effective inference by routing inquiries to the most appropriate professional "clusters." This technique permits the design to focus on different issue domains while maintaining general performance. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 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 describes a process of training smaller, more efficient designs to simulate the behavior and reasoning patterns of the bigger DeepSeek-R1 design, utilizing it as a teacher model.

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 location. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous content, and evaluate models against key safety 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 produce several 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 model, pipewiki.org you require access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, select Amazon SageMaker, and confirm you're utilizing 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 limitation increase, produce a limitation increase request and reach out to your account group.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For engel-und-waisen.de directions, see Establish approvals to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, avoid damaging content, and examine models against crucial safety criteria. You can implement precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to evaluate user inputs and design reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo.

The basic circulation includes the following actions: 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 out to the design for inference. After receiving the design's output, another guardrail check is applied. 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 indicating the nature of the intervention and whether it occurred at the input or output stage. 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 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 designs in the navigation pane. At the time of writing this post, you can utilize the InvokeModel API to conjure up the design. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and choose the DeepSeek-R1 model.

The design detail page offers important details about the model's abilities, prices structure, and application standards. You can discover detailed usage guidelines, consisting of sample API calls and code snippets for integration. The design supports different text generation jobs, including material production, code generation, and concern answering, using its reinforcement learning optimization and CoT reasoning capabilities. The page also includes deployment alternatives and licensing details to help you get begun with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, pick Deploy.

You will be prompted to set up the deployment details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (between 1-50 alphanumeric characters). 5. For Number of instances, go into a number of circumstances (between 1-100). 6. For Instance type, choose your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can set up sophisticated security and infrastructure settings, including virtual personal cloud (VPC) networking, service function authorizations, and file encryption settings. For a lot of utilize cases, the default settings will work well. However, for bytes-the-dust.com production releases, you might want to evaluate these settings to line up with your organization's security and compliance requirements. 7. Choose Deploy to start utilizing the model.

When the release is total, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground. 8. Choose Open in play area to access an interactive user interface where you can explore different triggers and adjust model criteria like temperature and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimal outcomes. For instance, content for reasoning.

This is an excellent method to explore the design's reasoning and text generation abilities before incorporating it into your applications. The play ground provides instant feedback, assisting you understand how the model responds to different inputs and letting you tweak your prompts for optimum outcomes.

You can quickly test the model in the playground 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 deployed DeepSeek-R1 endpoint

The following code example shows how to perform inference utilizing a deployed DeepSeek-R1 design 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 actually created the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime client, configures reasoning parameters, and sends out a request to generate 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 services that you can release with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your data, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 convenient methods: utilizing the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both approaches to assist you pick the method that finest suits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following steps to release DeepSeek-R1 utilizing 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, pick JumpStart in the navigation pane.

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

4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card. Each design card shows essential details, larsaluarna.se including:

- Model name - Provider name

  • Task category (for instance, Text Generation). Bedrock Ready badge (if relevant), indicating that this design can be registered with Amazon Bedrock, permitting you to utilize Amazon Bedrock APIs to conjure up the design

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

    The model details page includes the following details:

    - The model name and provider details. Deploy button to release the design. 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 deploy the model, it's recommended to review the design details and license terms to validate compatibility with your use case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the automatically generated name or produce a customized one.
  1. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the number of instances (default: 1). Selecting proper instance types and counts is important for expense and performance optimization. Monitor your implementation to change 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 setups for precision. For this design, we highly recommend adhering to SageMaker JumpStart default settings and pipewiki.org making certain that network seclusion remains in place.
  4. Choose Deploy to release the model.

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

    When implementation is complete, your endpoint status will alter to InService. At this point, the design is prepared to accept reasoning demands through the endpoint. You can keep track of the release development on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the release is total, you can up the model using a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the needed AWS approvals and environment setup. The following is a detailed code example that shows how to deploy and trademarketclassifieds.com utilize DeepSeek-R1 for reasoning programmatically. The code for releasing the design is offered in the Github here. You can clone the notebook and run from SageMaker Studio.

    You can run extra requests against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail using the Amazon Bedrock console or the API, and execute it as shown in the following code:

    Clean up

    To avoid undesirable charges, finish the steps in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace deployments.
  5. In the Managed releases section, locate 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 erasing the correct implementation: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed 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 explored how you can access and release the DeepSeek-R1 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. For higgledy-piggledy.xyz 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 helps emerging generative AI companies develop innovative services utilizing AWS services and sped up compute. Currently, he is concentrated on developing strategies for fine-tuning and optimizing the inference performance of large language designs. In his downtime, Vivek enjoys hiking, seeing movies, and trying different cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group at AWS. His location 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 product, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about developing options that assist clients accelerate their AI journey and unlock service value.