1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Barbara Gairdner edited this page 2025-02-16 17:00:45 +00: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 reveal 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 model, DeepSeek-R1, in addition to the distilled variations ranging from 1.5 to 70 billion specifications to construct, 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 actions to deploy the distilled variations of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that utilizes support finding out to boost thinking abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial identifying feature is its reinforcement learning (RL) action, which was utilized to improve the design's actions beyond the basic pre-training and tweak process. By including RL, DeepSeek-R1 can adjust more efficiently to user feedback and goals, eventually enhancing both importance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, suggesting it's equipped to break down complex questions and factor through them in a detailed manner. This guided reasoning procedure enables the design to produce more accurate, transparent, and detailed responses. This design combines RL-based fine-tuning with CoT abilities, aiming to generate structured reactions while focusing on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has actually recorded the market's attention as a versatile text-generation model that can be integrated into different workflows such as representatives, sensible reasoning and information analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion specifications, wiki.lafabriquedelalogistique.fr allowing effective inference by routing inquiries to the most pertinent expert "clusters." This method enables the design to focus on different issue domains while maintaining total efficiency. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances to deploy the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning 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 procedure of training smaller sized, more effective models to simulate the behavior and reasoning patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise deploying this design with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, prevent damaging material, and assess designs against crucial security requirements. At the time of writing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce several guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, wiki.myamens.com you need access to an ml.p5e instance. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose 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 instance in the AWS Region you are releasing. To request a limitation boost, create a limitation boost demand and reach out 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) approvals to utilize Amazon Bedrock Guardrails. For guidelines, see Set up authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, prevent harmful content, and assess models against crucial safety criteria. You can execute security procedures for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to examine user inputs and model actions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail using the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo.

The basic flow involves the following actions: First, the system gets 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 model for inference. After receiving the design's output, another guardrail check is used. If the output passes this last check, it's returned as the final result. 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 happened at the input or output stage. The examples showcased in the following sections show inference 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, pick Model brochure under Foundation designs in the navigation pane. At the time of writing this post, you can utilize the InvokeModel API to conjure up the model. It doesn't 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 supplies vital details about the model's abilities, rates structure, and execution standards. You can discover use guidelines, consisting of sample API calls and code bits for 89u89.com combination. The design supports numerous text generation jobs, consisting of content creation, code generation, and concern answering, utilizing its reinforcement learning optimization and CoT reasoning capabilities. The page likewise includes implementation alternatives and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, pick Deploy.

You will be triggered to configure the release details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters). 5. For setiathome.berkeley.edu Variety of instances, get in a number of instances (in between 1-100). 6. For example type, choose your instance type. For optimum efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can set up sophisticated security and facilities settings, consisting of virtual private cloud (VPC) networking, service role authorizations, and encryption settings. For most utilize cases, the default settings will work well. However, for production releases, you might desire to evaluate these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to start using the design.

When the implementation is total, you can check DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in play area to access an interactive interface where you can try out different triggers and adjust design parameters like temperature level and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimal outcomes. For example, content for inference.

This is an excellent way to check out the design's reasoning and text generation abilities before integrating it into your applications. The play area provides instant feedback, helping you comprehend how the model responds to numerous inputs and letting you fine-tune your triggers for optimum outcomes.

You can rapidly check the model in the play area through the UI. However, to conjure up the released model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run inference using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to carry out reasoning using a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can produce a guardrail using the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo. After you have actually produced the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime client, configures reasoning criteria, and sends out a demand to produce text based upon a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in algorithms, and prebuilt ML solutions that you can release with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your data, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart offers two practical approaches: using the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both techniques to assist you pick the approach that finest fits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions to deploy 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 internet browser displays available models, with details like the supplier name and model abilities.

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

- Model name

  • Provider name
  • Task classification (for example, Text Generation). Bedrock Ready badge (if applicable), suggesting that this design can be registered with Amazon Bedrock, allowing you to use Amazon Bedrock APIs 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 company details. Deploy button to release the model. About and Notebooks tabs with detailed details

    The About tab consists of important details, such as:

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

    Before you deploy the design, it's suggested to examine the design details and license terms to verify compatibility with your use case.

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, use the instantly created name or produce a custom one.
  1. For example type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the number of instances (default: 1). Selecting suitable circumstances types and counts is important 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 accuracy. For this design, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to release the model.

    The release procedure can take numerous minutes to complete.

    When deployment is total, your endpoint status will change to InService. At this moment, the model is all set to accept reasoning demands through the endpoint. You can keep track of the release progress on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the deployment is total, you can conjure up the design utilizing a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get started with DeepSeek-R1 using the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the essential 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 offered in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run additional demands 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 using the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Tidy up

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

    Delete the Amazon Bedrock Marketplace implementation

    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, choose Marketplace releases.
  5. In the Managed releases section, find the endpoint you desire to erase.
  6. Select the endpoint, and on the Actions menu, choose Delete.
  7. Verify the endpoint details to make certain you're erasing the correct release: 1. Endpoint name.
  8. Model name.
  9. 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 erase the endpoint if you wish 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 design utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, 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 solutions utilizing AWS services and sped up calculate. Currently, he is focused on developing strategies for fine-tuning and enhancing the inference performance of big language designs. In his leisure time, Vivek delights in treking, viewing motion pictures, and trying various cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group 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 Professional Solutions Architect working on 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 center. She is enthusiastic about constructing solutions that help consumers accelerate their AI journey and unlock organization worth.