DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
theoconstant01 редагував цю сторінку 3 тижднів тому


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 model, DeepSeek-R1, together with the distilled versions ranging from 1.5 to 70 billion specifications to construct, experiment, and responsibly 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 comparable steps to deploy the distilled versions of the models as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that utilizes reinforcement learning to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential identifying function is its reinforcement knowing (RL) step, which was used to improve the design’s reactions beyond the basic pre-training and tweak process. By integrating RL, DeepSeek-R1 can adjust better to user feedback and goals, eventually improving both significance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, implying it’s geared up to break down intricate questions and reason through them in a detailed way. This assisted thinking procedure allows the design to produce more accurate, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT capabilities, aiming to create structured reactions while concentrating on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has actually caught the industry’s attention as a flexible text-generation design that can be integrated into different workflows such as agents, rational reasoning and information interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion criteria, making it possible for efficient reasoning by routing queries to the most relevant specialist “clusters.” This technique allows the design to concentrate on various problem domains while maintaining total efficiency. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge instance to deploy 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 design to more effective architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and hb9lc.org 32B) and Llama (8B and 70B). Distillation describes a process of training smaller, more efficient models to imitate the habits and thinking patterns of the bigger DeepSeek-R1 model, 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 advise releasing this design with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent harmful content, and evaluate designs against essential safety criteria. At the time of writing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop several guardrails tailored to different use cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, you need access to an ml.p5e instance. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, select Amazon SageMaker, and verify 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 deploying. To request a limit boost, produce a limit increase request and reach out to your account team.

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) permissions to utilize Amazon Bedrock Guardrails. For guidelines, see Set up approvals to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

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

The general circulation includes 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 reasoning. After receiving the design’s output, another guardrail check is used. 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 stage. The examples showcased in the following sections demonstrate reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides you access to over 100 popular, emerging, and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following actions:

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

  1. Filter for DeepSeek as a company and pick the DeepSeek-R1 design.

    The model detail page provides vital details about the model’s capabilities, pricing structure, and execution standards. You can discover detailed use directions, including sample API calls and code snippets for integration. The model supports different text generation tasks, consisting of content creation, code generation, and question answering, using its reinforcement discovering optimization and CoT thinking capabilities. The page also consists of release options and licensing details to assist you start with DeepSeek-R1 in your applications.
  2. To begin utilizing DeepSeek-R1, choose Deploy.

    You will be triggered to set up the release details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters).
  4. For Number of circumstances, go into a variety of instances (in between 1-100).
  5. For Instance type, pick your instance type. For ideal efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is suggested. Optionally, you can set up sophisticated security and facilities settings, including virtual private cloud (VPC) networking, service function permissions, and file encryption settings. For a lot of use cases, the default settings will work well. However, for production deployments, you might want to examine these settings to align with your organization’s security and compliance requirements.
  6. Choose Deploy to start utilizing the design.

    When the implementation is total, you can evaluate DeepSeek-R1’s abilities straight in the Amazon Bedrock play ground.
  7. Choose Open in play area to access an interactive user interface where you can experiment with different triggers and change model specifications like temperature and optimum length. When using R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat design template for optimum results. For example, material for inference.

    This is an excellent method to check out the model’s reasoning and text generation abilities before incorporating it into your applications. The play ground immediate feedback, helping you comprehend how the model reacts to numerous inputs and letting you fine-tune your triggers for optimal results.

    You can rapidly test the design in the playground through the UI. However, to invoke the released design 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 carry out reasoning using a released DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. 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. After you have developed the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime customer, configures reasoning criteria, and sends a demand to generate text based upon 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 options that you can deploy with just a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your data, and deploy them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart offers two practical techniques: utilizing the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let’s check out both approaches to assist you choose the method that best fits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

    1. On the SageMaker console, pick Studio in the navigation pane.
  8. First-time users will be triggered to develop a domain.
  9. On the SageMaker Studio console, select JumpStart in the navigation pane.

    The model browser shows available models, with details like the service provider name and design abilities.

    4. Search for DeepSeek-R1 to view the DeepSeek-R1 design card. Each model card shows crucial 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 use Amazon Bedrock APIs to conjure up the design

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

    The model details page consists of the following details:

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

    The About tab includes essential details, such as:

    - Model description.
  12. License details.
  13. Technical specifications.
  14. Usage standards

    Before you deploy the model, it’s recommended to review the model details and license terms to verify compatibility with your use case.

    6. Choose Deploy to proceed with deployment.

    7. For Endpoint name, utilize the immediately produced name or create a custom-made one.
  15. For Instance type ¸ pick 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 crucial for expense and performance optimization. Monitor your deployment 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.
  17. Review all configurations for precision. For this model, we strongly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  18. Choose Deploy to release the design.

    The implementation process can take a number of minutes to complete.

    When release is total, your endpoint status will alter to InService. At this moment, the design is prepared to accept reasoning requests through the endpoint. You can keep an eye on the release progress on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the implementation is complete, you can invoke the design utilizing a SageMaker runtime customer and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get going with DeepSeek-R1 using the SageMaker Python SDK, you will require 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 demonstrates how to deploy and utilize DeepSeek-R1 for inference programmatically. The code for releasing the model is supplied 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 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 using the Amazon Bedrock console or the API, and implement it as displayed 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 release

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace implementations.
  19. In the Managed releases area, find the endpoint you want to erase.
  20. Select the endpoint, and on the Actions menu, pick Delete.
  21. Verify the endpoint details to make certain you’re deleting the correct implementation: 1. Endpoint name.
  22. Model name.
  23. 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 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 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. For more details, refer to 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 assists emerging generative AI companies develop ingenious options utilizing AWS services and accelerated calculate. Currently, he is focused on establishing methods for fine-tuning and optimizing the inference efficiency of big language models. In his downtime, Vivek delights in treking, viewing motion pictures, and attempting various 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 Science and Bioinformatics.

    Jonathan Evans is a Professional Solutions Architect dealing with 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 hub. She is passionate about constructing options that help customers accelerate their AI journey and unlock company worth.