1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
lincolndyr952 edited this page 2025-02-06 22:12:26 +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 delighted to announce 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 design, DeepSeek-R1, together with the distilled variations varying from 1.5 to 70 billion parameters to build, experiment, and responsibly scale your generative AI concepts on AWS.

In this post, we demonstrate how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to deploy the distilled variations of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that uses 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) action, which was utilized to improve the design's actions beyond the standard pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adapt better to user feedback and goals, ultimately boosting both importance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, meaning it's equipped to break down intricate inquiries and factor through them in a detailed manner. This directed reasoning process allows the model to produce more precise, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT abilities, aiming to create structured actions while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has captured the market's attention as a flexible text-generation model that can be incorporated into various workflows such as representatives, logical reasoning and data analysis tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and bytes-the-dust.com is 671 billion parameters in size. The MoE architecture enables activation of 37 billion parameters, allowing effective inference by routing queries to the most pertinent specialist "clusters." This technique permits the model to specialize in various problem domains while maintaining total effectiveness. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for inference. In this post, we will use an ml.p5e.48 xlarge circumstances to release the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

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

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise releasing this model with guardrails in location. In this blog, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent harmful content, and assess models against key security criteria. At the time of composing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce several guardrails tailored to various use cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you require access to an ml.p5e instance. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and validate you're using 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 limit increase, create a limit boost request and connect to your account team.

Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) to utilize Amazon Bedrock Guardrails. For guidelines, see Establish consents to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, prevent damaging material, and examine designs against essential safety criteria. You can carry out safety steps for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and design responses deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create 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 gets 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 model for inference. After receiving the design's output, another guardrail check is used. If the output passes this final check, it's returned as the outcome. However, if either the input or output is stepped in by the guardrail, a message is returned indicating the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following sections demonstrate inference using 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 actions:

1. On the Amazon Bedrock console, pick Model catalog under Foundation models in the navigation pane. At the time of composing this post, you can use the InvokeModel API to invoke the design. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and choose the DeepSeek-R1 model.

The model detail page offers vital details about the model's abilities, prices structure, and application guidelines. You can discover detailed use instructions, including sample API calls and code bits for integration. The model supports various text generation jobs, including material production, code generation, and concern answering, utilizing its reinforcement learning optimization and CoT thinking capabilities. The page likewise includes implementation alternatives and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To start using DeepSeek-R1, select Deploy.

You will be prompted to set up the deployment details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of circumstances, enter a number of instances (in between 1-100). 6. For example type, pick your circumstances type. For ideal performance 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, including virtual personal cloud (VPC) networking, service function permissions, and encryption settings. For many use cases, the default settings will work well. However, for production releases, you may want to review these settings to align with your company's security and compliance requirements. 7. Choose Deploy to start using the design.

When the deployment is complete, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock play area. 8. Choose Open in playground to access an interactive interface where you can explore various triggers and adjust model criteria like temperature and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimal outcomes. For example, material for inference.

This is an outstanding method to check out the model's thinking and text generation abilities before integrating it into your applications. The playground supplies immediate feedback, assisting you comprehend how the design reacts to numerous inputs and letting you fine-tune your triggers for ideal results.

You can rapidly test the design in the play area through the UI. However, to invoke the deployed design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run inference using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to perform reasoning using a deployed DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can create a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo. After you have produced the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime customer, configures reasoning criteria, and sends a demand to produce text based upon a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML solutions 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 using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 practical methods: larsaluarna.se using the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you select the approach that finest matches 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. 2. First-time users will be prompted to produce a domain. 3. On the SageMaker Studio console, pick JumpStart in the navigation pane.

The design browser displays available designs, with details like the company name and design capabilities.

4. Look for DeepSeek-R1 to see the DeepSeek-R1 model card. Each design card reveals essential details, consisting of:

- Model name

  • Provider name
  • Task category (for example, Text Generation). Bedrock Ready badge (if applicable), gratisafhalen.be indicating that this model can be signed up with Amazon Bedrock, permitting you to utilize Amazon Bedrock APIs to invoke the model

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

    The design details page consists of the following details:

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

    The About tab consists of crucial details, such as:

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

    Before you release the model, it's recommended to examine the design details and license terms to validate compatibility with your use case.

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, use the instantly created name or develop a custom one.
  1. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, enter the variety of circumstances (default: 1). Selecting proper instance types and counts is vital for expense and efficiency optimization. Monitor your release 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.
  3. Review all setups for precision. For this model, we highly recommend adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to deploy the model.

    The implementation process can take several minutes to finish.

    When release is total, your endpoint status will change to InService. At this moment, the model is all set to accept reasoning requests 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 total, you can invoke the model utilizing a SageMaker runtime customer 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 need to install the SageMaker Python SDK and make certain you have the required 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 design is offered in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run extra demands against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also utilize 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 prevent unwanted charges, finish the actions in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you released the model using Amazon Bedrock Marketplace, total the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace implementations.
  5. In the Managed implementations area, locate the endpoint you desire to delete.
  6. Select the endpoint, and on the Actions menu, choose 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 released will sustain expenses 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 more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Beginning 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 ingenious options using AWS services and sped up calculate. Currently, he is focused on establishing strategies for fine-tuning and optimizing the reasoning efficiency of big language designs. In his leisure time, Vivek enjoys treking, viewing films, 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 an Expert Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about developing solutions that help consumers accelerate their AI journey and unlock company worth.