DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
ronaldjephcott editó esta página hace 1 semana


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 model, DeepSeek-R1, in addition to the distilled versions varying from 1.5 to 70 billion criteria to build, experiment, and responsibly scale your generative AI ideas on AWS.

In this post, we show how to get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to deploy 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 reinforcement finding out to improve thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key differentiating function is its reinforcement knowing (RL) step, which was utilized to improve the model’s reactions beyond the standard pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adapt more effectively to user feedback and objectives, eventually improving both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, implying it’s equipped to break down intricate queries and factor through them in a detailed way. This directed reasoning procedure permits the model to produce more accurate, transparent, and detailed answers. This model integrates RL-based fine-tuning with CoT abilities, aiming to produce structured actions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has captured the market’s attention as a versatile text-generation design that can be incorporated into various workflows such as representatives, sensible reasoning and data interpretation jobs.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion criteria, making it possible for efficient inference by routing questions to the most appropriate expert “clusters.” This technique enables the model to focus on different issue domains while maintaining overall efficiency. DeepSeek-R1 needs a minimum of 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 model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

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

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest releasing this model with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous content, and evaluate designs against essential safety requirements. At the time of composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop multiple guardrails tailored to various use cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

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

Because you will be deploying this design 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 directions, see Establish approvals to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, prevent hazardous content, and examine models against crucial security criteria. You can carry out security procedures for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and design reactions 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 produce 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 out to the model for reasoning. After getting the design’s output, another guardrail check is applied. If the output passes this final check, it’s returned as the result. However, if either the input or output is intervened by the guardrail, a message is returned indicating the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following areas 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 foundation models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following actions:

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

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

    The design detail page supplies essential details about the model’s abilities, rates structure, and implementation standards. You can find detailed usage directions, including sample API calls and code snippets for combination. The design supports numerous text generation tasks, including material development, code generation, and question answering, using its reinforcement discovering optimization and CoT reasoning capabilities. The page also includes deployment choices and licensing details to assist you get going with DeepSeek-R1 in your applications.
  2. To start using DeepSeek-R1, choose Deploy.

    You will be triggered to configure the release details for DeepSeek-R1. The model ID will be pre-populated.
  3. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters).
  4. For Variety of circumstances, enter a variety of instances (between 1-100).
  5. For example type, choose your instance type. For optimum performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and infrastructure settings, including virtual private 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 wish to examine these settings to align with your organization’s security and compliance requirements.
  6. Choose Deploy to begin utilizing the model.

    When the deployment is total, you can check DeepSeek-R1’s capabilities straight in the Amazon Bedrock play area.
  7. Choose Open in playground to access an interactive user interface where you can try out various prompts and adjust design specifications like temperature level and maximum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat design template for optimum outcomes. For example, material for inference.

    This is an outstanding way to explore the design’s thinking and text generation capabilities before integrating it into your applications. The play ground supplies immediate feedback, assisting you comprehend how the model reacts to numerous inputs and letting you tweak your triggers for ideal outcomes.

    You can rapidly evaluate the design in the play ground through the UI. However, to conjure up the released model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

    Run inference using guardrails with the deployed DeepSeek-R1 endpoint

    The following code example shows how to carry out inference utilizing a deployed DeepSeek-R1 model through Amazon Bedrock using 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 client, sets up inference criteria, and sends out a request to generate text based on a user prompt.

    Deploy DeepSeek-R1 with SageMaker JumpStart

    SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML services that you can release with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, and deploy them into production using either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart offers two convenient techniques: using the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s check out both approaches to assist you pick the method that best suits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

    Complete the following actions to release DeepSeek-R1 utilizing SageMaker JumpStart:

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

    The model web browser displays available models, with details like the supplier name and model abilities.

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

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

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

    The design details page includes the following details:

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

    The About tab consists of important details, such as:

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

    Before you deploy the design, it’s advised to evaluate the design details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, utilize the instantly generated name or develop a customized one.
  15. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, go into the number of circumstances (default: 1). Selecting appropriate instance types and counts is vital for expense and performance optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time inference is picked by default. This is optimized for sustained traffic and low latency.
  17. Review all setups for accuracy. For this model, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  18. Choose Deploy to deploy the model.

    The deployment process can take a number of minutes to finish.

    When implementation is total, your endpoint status will alter to InService. At this point, the design is ready to accept inference requests through the endpoint. You can keep an eye on the release progress on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the release is complete, you can conjure up the design utilizing a SageMaker runtime customer and integrate 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 essential AWS permissions and environment setup. The following is a detailed code example that shows how to release and utilize DeepSeek-R1 for reasoning 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 requests against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail utilizing the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Tidy up

    To avoid undesirable charges, complete the actions 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 models in the navigation pane, choose Marketplace implementations.
  19. In the Managed implementations section, find the endpoint you wish to delete.
  20. Select the endpoint, and on the Actions menu, select Delete.
  21. Verify the endpoint details to make certain you’re deleting the right deployment: 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 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, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, 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 assists emerging generative AI companies construct using AWS services and accelerated calculate. Currently, he is concentrated on developing techniques for fine-tuning and enhancing the inference efficiency of big language models. In his leisure time, Vivek enjoys hiking, seeing 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 Specialist Solutions Architect working on generative AI with the Third-Party Model Science group 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 developing options that help customers accelerate their AI journey and unlock company worth.