1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
halleylipscomb edited this page 3 months ago


Today, we are excited 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 release DeepSeek AI's first-generation frontier design, DeepSeek-R1, in addition to the distilled versions varying from 1.5 to 70 billion parameters to construct, experiment, and responsibly scale your generative AI ideas on AWS.

In this post, we show how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable steps to release the distilled versions of the models as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that uses reinforcement discovering to boost thinking abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial differentiating feature is its support learning (RL) action, which was utilized to refine the design's reactions beyond the standard pre-training and tweak procedure. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and objectives, ultimately improving both importance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, implying it's equipped to break down complex inquiries and factor through them in a detailed manner. This directed reasoning process enables the model to produce more precise, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT abilities, aiming to create structured responses while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has caught the market's attention as a flexible text-generation design that can be incorporated into various workflows such as representatives, logical thinking and data interpretation tasks.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion criteria, making it possible for efficient inference by routing inquiries to the most appropriate expert "clusters." This technique allows the design to concentrate on various issue domains while maintaining total performance. DeepSeek-R1 requires a minimum of 800 GB of in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge instance to deploy the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

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

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest deploying this design with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid damaging content, and examine models against key security criteria. At the time of writing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create several guardrails tailored to various use cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you require access to an ml.p5e circumstances. To inspect 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 instance in the AWS Region you are releasing. To request a limit increase, create a limit increase demand and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, avoid hazardous material, and examine designs against essential safety criteria. You can carry out safety steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and design reactions 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 general flow includes the following steps: 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 reasoning. After receiving the model'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 showing the nature of the intervention and whether it took place at the input or output phase. The examples showcased in the following sections show 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 steps:

1. On the Amazon Bedrock console, choose Model brochure under Foundation designs in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to conjure up the design. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a supplier and select the DeepSeek-R1 model.

The model detail page offers important details about the model's abilities, rates structure, and implementation standards. You can discover detailed use guidelines, including sample API calls and code bits for combination. The design supports various text generation jobs, consisting of material creation, code generation, and concern answering, utilizing its reinforcement discovering optimization and CoT reasoning capabilities. The page also includes implementation choices 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 configure the deployment details for DeepSeek-R1. The design ID will be pre-populated. 4. For pediascape.science Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters). 5. For Variety of instances, get in a number of circumstances (between 1-100). 6. For example 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 infrastructure settings, including virtual private cloud (VPC) networking, service function approvals, and encryption settings. For many utilize cases, the default settings will work well. However, for production implementations, you may desire to evaluate these settings to align with your company's security and larsaluarna.se compliance requirements. 7. Choose Deploy to start utilizing the design.

When the release is complete, you can test DeepSeek-R1's abilities straight in the Amazon Bedrock playground. 8. Choose Open in playground to access an interactive user interface where you can try out different prompts and change design criteria like temperature and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for ideal results. For example, material for reasoning.

This is an excellent method to check out the design's reasoning and text generation capabilities before incorporating it into your applications. The playground offers instant feedback, assisting you comprehend how the design reacts to various inputs and letting you fine-tune your triggers for ideal outcomes.

You can rapidly test the model in the playground through the UI. However, to invoke 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 demonstrates how to perform reasoning utilizing a released 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 actually developed the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime client, configures reasoning parameters, and sends out a demand to generate text based upon 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 deploy 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 utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart uses two practical approaches: using the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both approaches to help you choose the technique 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, select Studio in the navigation pane. 2. First-time users will be triggered to develop a domain. 3. On the SageMaker Studio console, select JumpStart in the navigation pane.

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

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

- Model name

  • Provider name
  • Task category (for example, Text Generation). Bedrock Ready badge (if suitable), suggesting that this model can be registered with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to conjure up the design

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

    The design details page consists of the following details:

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

    The About tab includes crucial details, such as:

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

    Before you release the model, it's suggested to review the model details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the instantly generated name or create a custom one.
  1. For example type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the variety of instances (default: 1). Selecting suitable instance types and counts is important for expense and performance optimization. Monitor your release to change these settings as needed.Under Inference type, Real-time inference is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations 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 procedure can take numerous minutes to complete.

    When implementation is complete, your endpoint status will change to InService. At this moment, the design is prepared to accept reasoning demands through the endpoint. You can keep track of the deployment development on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the implementation is complete, you can invoke the model using a SageMaker runtime customer and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To begin with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the required AWS approvals and environment setup. The following is a detailed code example that demonstrates how to release and use DeepSeek-R1 for inference programmatically. The code for deploying the design is provided 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 produce a guardrail utilizing the Amazon Bedrock console or the API, and execute it as shown in the following code:

    Clean up

    To prevent unwanted charges, complete the actions in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you deployed the model utilizing Amazon Bedrock Marketplace, systemcheck-wiki.de total the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace releases.
  5. In the Managed implementations area, find the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're deleting the proper implementation: 1. Endpoint name.
  8. Model name.
  9. 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 delete the endpoint if you desire to stop sustaining charges. For more details, see Delete Endpoints and engel-und-waisen.de Resources.

    Conclusion

    In this post, we explored how you can access and release the DeepSeek-R1 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, larsaluarna.se and Starting with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for setiathome.berkeley.edu Inference at AWS. He assists emerging generative AI companies develop ingenious solutions using AWS services and accelerated compute. Currently, he is concentrated on establishing strategies for fine-tuning and enhancing the inference performance of big language designs. In his spare time, Vivek delights in hiking, watching motion pictures, links.gtanet.com.br and trying 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 Specialist Solutions Architect dealing with 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 passionate about constructing solutions that assist consumers accelerate their AI journey and unlock service worth.