DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
effiehildebran 于 2 周前 修改了此页面


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 deploy DeepSeek AI’s first-generation frontier model, DeepSeek-R1, in addition to the distilled versions varying from 1.5 to 70 billion specifications to build, experiment, and properly scale your generative AI ideas on AWS.

In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar 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 utilizes reinforcement finding out to improve thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential distinguishing feature is its reinforcement learning (RL) step, which was used to improve the design’s actions beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adapt more successfully to user feedback and objectives, eventually boosting both significance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, implying it’s geared up to break down intricate inquiries and reason through them in a detailed way. This guided thinking procedure allows the model to produce more precise, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT abilities, aiming to generate structured actions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually caught the industry’s attention as a versatile text-generation design that can be integrated into various workflows such as representatives, rational reasoning and information interpretation jobs.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion specifications, enabling efficient reasoning by routing queries to the most relevant specialist “clusters.” This approach enables the model to concentrate on various problem domains while maintaining overall efficiency. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge circumstances to deploy the model. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking capabilities of the main R1 design to more efficient architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller sized, more effective models to imitate the habits and thinking patterns of the bigger DeepSeek-R1 model, using it as a teacher design.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we recommend deploying this design with guardrails in location. 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 composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop several guardrails tailored to various usage cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, you require access to an ml.p5e circumstances. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose 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 circumstances in the AWS Region you are releasing. To ask for a limit increase, develop a limitation boost request and connect to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, prevent damaging content, and assess models against essential security requirements. You can carry out safety procedures for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to assess user inputs and model actions 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 develop the guardrail, see the GitHub repo.

The basic circulation involves the following steps: 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 out to the model for reasoning. After receiving the design’s output, another guardrail check is used. If the output passes this last check, it’s returned as the outcome. However, if either the input or output is stepped in by the guardrail, a message is returned suggesting 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 using 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 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.

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

    The model detail page provides important details about the design’s abilities, pricing structure, and application guidelines. You can find detailed usage instructions, consisting of sample API calls and code snippets for combination. The model supports various text generation tasks, consisting of content creation, code generation, and question answering, utilizing its support finding out optimization and CoT thinking capabilities. The page likewise includes deployment options and licensing details to assist you get going with DeepSeek-R1 in your applications.
  2. To begin utilizing DeepSeek-R1, select Deploy.

    You will be prompted to set up the implementation details for DeepSeek-R1. The model ID will be pre-populated.
  3. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters).
  4. For Variety of circumstances, go into a variety of circumstances (in between 1-100).
  5. For Instance type, pick your circumstances type. For ideal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can set up sophisticated security and facilities settings, including virtual personal cloud (VPC) networking, service function permissions, and encryption settings. For many utilize cases, the default settings will work well. However, for production implementations, you might want to review these settings to align with your organization’s security and compliance requirements.
  6. Choose Deploy to start using the design.

    When the implementation is complete, you can check DeepSeek-R1’s capabilities straight in the Amazon Bedrock playground.
  7. Choose Open in playground to access an interactive interface where you can explore various triggers and change model specifications like temperature and optimum length. When using R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat template for ideal outcomes. For instance, material for inference.

    This is an exceptional method to check out the model’s thinking and text generation abilities before integrating it into your applications. The play area supplies instant feedback, helping you comprehend how the model reacts to different inputs and letting you fine-tune your triggers for ideal results.

    You can quickly evaluate the model in the playground through the UI. However, to invoke the released 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 shows how to carry out inference utilizing a released DeepSeek-R1 model 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 produce 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 customer, configures inference criteria, and sends out a demand to create text based upon 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 deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, and deploy them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 design through SageMaker JumpStart provides two convenient techniques: utilizing the intuitive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s check out both techniques to assist you select the technique that finest suits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

    Complete the following steps 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 create a domain.
  9. On the SageMaker Studio console, choose JumpStart in the navigation pane.

    The design internet browser displays available models, with details like the service provider name and design capabilities.

    4. Search for DeepSeek-R1 to view the DeepSeek-R1 model card. Each design card shows essential details, including:

    - Model name
  10. Provider name
  11. Task classification (for instance, Text Generation). Bedrock Ready badge (if appropriate), indicating that this design can be signed up with Amazon Bedrock, allowing you to utilize Amazon Bedrock APIs to conjure up the model

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

    The model details page consists of the following details:

    - The design name and service provider details. Deploy button to release the design. About and Notebooks tabs with detailed details

    The About tab includes important details, such as:

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

    Before you deploy the design, it’s advised to review the design details and license terms to validate compatibility with your use case.

    6. Choose Deploy to continue with release.

    7. For Endpoint name, use the automatically created name or produce a custom one.
  15. For Instance type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, enter the number of instances (default: 1). Selecting appropriate 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 selected by default. This is enhanced for sustained traffic and low latency.
  17. Review all setups for accuracy. For this model, we strongly advise adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  18. Choose Deploy to release the model.

    The deployment process can take numerous minutes to finish.

    When implementation is complete, your endpoint status will change to InService. At this moment, the model is prepared to accept reasoning through the endpoint. You can keep track of the implementation development on the SageMaker console Endpoints page, which will show appropriate 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 start 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 approvals and environment setup. The following is a detailed code example that shows how to deploy and utilize DeepSeek-R1 for inference programmatically. The code for releasing the design 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 utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail utilizing the Amazon Bedrock console or setiathome.berkeley.edu the API, and execute it as revealed in the following code:

    Tidy up

    To avoid undesirable charges, complete the actions in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace deployments.
  19. In the Managed deployments section, find the endpoint you desire to delete.
  20. Select the endpoint, and on the Actions menu, choose Delete.
  21. Verify the endpoint details to make certain you’re erasing the proper implementation: 1. Endpoint name.
  22. Model name.
  23. 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 delete 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 utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get started. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting going with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI business build innovative services utilizing AWS services and accelerated calculate. Currently, he is focused on developing strategies for fine-tuning and enhancing the inference performance of large language designs. In his leisure time, Vivek takes pleasure in hiking, viewing films, and attempting various foods.

    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 Science and Bioinformatics.

    Jonathan Evans is a Professional Solutions Architect working on generative AI with the Third-Party Model Science team at AWS.

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