DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
lavinaparham33 が 3ヶ月前 にこのページを編集


Today, we are excited to announce 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, along with the distilled versions ranging from 1.5 to 70 billion specifications to build, experiment, and responsibly scale your generative AI concepts on AWS.

In this post, we show how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled versions of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that utilizes support finding out to enhance reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential identifying feature is its reinforcement knowing (RL) action, which was utilized to refine the design’s responses beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adapt more efficiently to user feedback and objectives, eventually enhancing both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, implying it’s geared up to break down complex inquiries and factor through them in a detailed way. This assisted reasoning process permits the design to produce more accurate, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT capabilities, aiming to create structured actions while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has caught the industry’s attention as a versatile text-generation design that can be incorporated into various workflows such as representatives, rational thinking and information analysis tasks.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, allowing efficient inference by routing questions to the most pertinent expert “clusters.” This technique allows the design to focus on different problem domains while maintaining overall performance. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking capabilities 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 refers to a procedure of training smaller, more effective designs to mimic the behavior and thinking patterns of the larger DeepSeek-R1 model, using it as a teacher design.

You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest releasing this design with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent damaging material, and assess models against key security criteria. At the time of writing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and systemcheck-wiki.de Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop numerous guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you need access to an ml.p5e circumstances. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and confirm you’re utilizing ml.p5e.48 xlarge for endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are deploying. To ask for a limitation increase, create a limit boost request and connect to your account team.

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 utilize Amazon Bedrock Guardrails. For directions, see Set up permissions to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, prevent hazardous material, and examine models against essential safety criteria. You can implement precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and design reactions deployed 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 create the guardrail, see the GitHub repo.

The general flow 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 design for inference. After receiving the model’s output, another guardrail check is applied. If the output passes this last check, it’s returned as the last 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 happened at the input or output phase. The examples showcased in the following areas 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 structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following steps:

1. On the Amazon Bedrock console, select Model catalog under Foundation models in the . At the time of writing this post, you can use the InvokeModel API to conjure up the design. It doesn’t support Converse APIs and other Amazon Bedrock tooling.

  1. Filter for DeepSeek as a service provider and choose the DeepSeek-R1 model.

    The model detail page provides important details about the model’s capabilities, prices structure, and execution guidelines. You can discover detailed usage instructions, consisting of sample API calls and code snippets for combination. The model supports different text generation tasks, consisting of content development, code generation, and question answering, utilizing its reinforcement finding out optimization and CoT thinking abilities. The page likewise consists of deployment alternatives and licensing details to assist you get started with DeepSeek-R1 in your applications.
  2. To start utilizing DeepSeek-R1, choose Deploy.

    You will be prompted to configure the implementation details for DeepSeek-R1. The model ID will be pre-populated.
  3. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters).
  4. For Number of instances, enter a variety of circumstances (in between 1-100).
  5. For Instance type, choose your circumstances type. For optimum performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can configure sophisticated security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role permissions, and encryption settings. For the majority of utilize cases, the default settings will work well. However, for production releases, you may desire to examine these settings to line up with your organization’s security and compliance requirements.
  6. Choose Deploy to start using the model.

    When the implementation is complete, you can check DeepSeek-R1’s capabilities straight in the Amazon Bedrock playground.
  7. Choose Open in play area to access an interactive user interface where you can explore different 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 design template for optimum outcomes. For instance, material for inference.

    This is an excellent method to check out the design’s thinking and text generation abilities before integrating it into your applications. The play ground offers immediate feedback, helping you understand how the design responds to numerous inputs and letting you tweak your prompts for optimum outcomes.

    You can rapidly evaluate the design 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 reasoning utilizing guardrails with the released DeepSeek-R1 endpoint

    The following code example demonstrates how to perform reasoning utilizing a released DeepSeek-R1 design through Amazon Bedrock utilizing 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 produced the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures inference parameters, and sends out a demand to create text based on a user timely.

    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 deploy with just a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and release them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 convenient approaches: utilizing the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let’s explore both approaches to help you pick the technique that finest suits 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, select Studio in the navigation pane.
  8. First-time users will be prompted to develop a domain.
  9. On the SageMaker Studio console, pick JumpStart in the navigation pane.

    The design 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 design card shows essential details, including:

    - Model name
  10. Provider name
  11. Task category (for example, Text Generation). Bedrock Ready badge (if applicable), indicating that this model can be signed up 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 design details page consists of 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 essential details, such as:

    - Model description.
  12. License details.
  13. Technical requirements.
  14. Usage guidelines

    Before you deploy the model, it’s suggested to review the design details and license terms to confirm compatibility with your usage case.

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, use the instantly created name or develop a customized one.
  15. For Instance type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial circumstances count, get in the number of instances (default: 1). Selecting proper instance types and counts is essential for cost and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is enhanced for sustained traffic and low latency.
  17. Review all configurations for precision. For this model, we strongly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  18. Choose Deploy to deploy the model.

    The release process can take several minutes to complete.

    When deployment is complete, your endpoint status will alter to InService. At this moment, the design is all set to accept inference requests through the endpoint. You can keep an eye on the release development on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the release is complete, you can invoke the model using a SageMaker runtime customer and incorporate 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 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 release and use DeepSeek-R1 for inference programmatically. The code for deploying the design is provided in the Github here. You can clone the note pad and run 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 use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail utilizing the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Tidy up

    To prevent undesirable charges, complete the steps in this area to clean up your resources.

    Delete the Amazon Bedrock Marketplace implementation

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace releases.
  19. In the Managed deployments area, find the endpoint you wish to delete.
  20. Select the endpoint, and on the Actions menu, pick Delete.
  21. Verify the endpoint details to make certain you’re erasing the appropriate implementation: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed will sustain expenses 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 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 models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting started with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI business build innovative options using AWS services and accelerated compute. Currently, he is concentrated on developing strategies for fine-tuning and optimizing the reasoning performance of big language models. In his spare time, Vivek delights in hiking, 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 area 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 team at AWS.

    Banu Nagasundaram leads item, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is enthusiastic about building services that assist clients accelerate their AI journey and unlock service value.