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


Today, we are thrilled to announce 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 design, DeepSeek-R1, along with the distilled variations varying from 1.5 to 70 billion parameters to develop, experiment, and properly 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 actions to release the distilled versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that uses support discovering to enhance thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial identifying function is its support knowing (RL) step, which was used to fine-tune the design's actions beyond the basic pre-training and tweak process. By incorporating RL, DeepSeek-R1 can adapt more effectively to user feedback and objectives, ultimately improving both significance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, meaning it's equipped to break down intricate queries and reason through them in a detailed manner. This assisted reasoning procedure allows the design to produce more precise, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured responses while focusing on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has actually captured the industry's attention as a versatile text-generation design that can be incorporated into numerous workflows such as representatives, rational thinking and data analysis 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, enabling efficient inference by routing queries to the most appropriate specialist "clusters." This approach allows the design to focus on various issue domains while maintaining general performance. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge instance to release the model. 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 model to more efficient architectures based on popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a procedure of training smaller, more effective designs to mimic the behavior and thinking patterns of the larger DeepSeek-R1 model, using it as an instructor design.

You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise deploying this model with guardrails in place. In this blog site, we will utilize Amazon Bedrock Guardrails to present safeguards, avoid hazardous material, and evaluate designs against key security 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 apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you require 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 confirm you're utilizing ml.p5e.48 xlarge for endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are deploying. To ask for a limit increase, create a limitation increase demand and reach out to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, prevent damaging material, and assess models against key security requirements. You can implement precaution for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to examine user inputs and model actions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail utilizing the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo.

The general circulation includes 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 out to the design for reasoning. After receiving the model's output, another guardrail check is applied. If the output passes this final 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 indicating the nature of the intervention and whether it took place 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 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, 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 does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and pick the DeepSeek-R1 design.

The model detail page provides necessary details about the design's capabilities, pricing structure, and implementation standards. You can discover detailed use instructions, consisting of sample API calls and code bits for integration. The model supports different text generation tasks, including material production, code generation, and question answering, utilizing its support discovering optimization and CoT thinking abilities. The page likewise consists of deployment choices and licensing details to help you get going with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, select Deploy.

You will be prompted to set up the deployment details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (between 1-50 alphanumeric characters). 5. For Number of circumstances, enter a number of instances (in between 1-100). 6. For Instance type, select your instance type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances 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 role permissions, and file encryption settings. For many utilize cases, the default settings will work well. However, for production implementations, you might desire to examine these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start using the model.

When the release is total, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in play ground to access an interactive user interface where you can try out various triggers and change design criteria like temperature and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimal outcomes. For instance, content for inference.

This is an excellent way to explore the design's reasoning and text generation capabilities before incorporating it into your applications. The play area supplies instant feedback, assisting you comprehend how the design responds to different inputs and letting you tweak your triggers for optimal outcomes.

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

Run inference utilizing guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to carry out inference using a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can develop 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 actually produced the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime customer, configures inference parameters, and wiki.dulovic.tech sends out a request to produce 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 release with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your data, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart offers two convenient techniques: utilizing the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both methods to assist you select the method that best suits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions to release 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 model web browser displays available designs, with details like the provider name and .

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

- Model name

  • Provider name
  • Task category (for instance, Text Generation). Bedrock Ready badge (if relevant), showing that this model can be registered with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to conjure up the design

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

    The design details page includes 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 consists of crucial details, such as:

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

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

    6. Choose Deploy to proceed with deployment.

    7. For Endpoint name, use the instantly generated name or develop a custom one.
  1. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, go into the variety of instances (default: 1). Selecting appropriate instance types and counts is vital for cost and performance optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this model, we strongly advise sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to release the design.

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

    When implementation 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 monitor the release progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the release is total, you can invoke the model utilizing a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get begun with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the needed AWS authorizations and environment setup. The following is a detailed code example that demonstrates how to release and utilize DeepSeek-R1 for inference programmatically. The code for deploying the model is supplied in the Github here. You can clone the note pad 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 use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail using the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Tidy up

    To prevent undesirable charges, finish the actions in this area to tidy 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, pick Marketplace releases.
  5. In the Managed deployments section, locate the endpoint you wish to erase.
  6. Select the endpoint, and on the Actions menu, pick Delete.
  7. Verify the endpoint details to make certain you're erasing the right deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you released will sustain expenses if you leave it running. Use the following code to delete 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 deploy the DeepSeek-R1 design utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get begun. 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 Getting started with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI business build ingenious services using AWS services and sped up calculate. Currently, he is concentrated on establishing techniques for fine-tuning and enhancing the inference performance of big language designs. In his downtime, Vivek enjoys hiking, seeing motion pictures, and attempting various foods.

    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 technology and Bioinformatics.

    Jonathan Evans is a Professional Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads product, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about developing solutions that assist consumers accelerate their AI journey and unlock business value.