1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Felicia Ronald edited this page 2 months ago


Today, we are excited to reveal that DeepSeek R1 distilled Llama and Qwen designs are available through Amazon Bedrock Marketplace and wiki.dulovic.tech Amazon SageMaker JumpStart. With this launch, you can now deploy DeepSeek AI's first-generation frontier design, DeepSeek-R1, together with the distilled versions 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 steps to release the distilled versions of the designs too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that utilizes support learning to improve thinking through a multi-stage training process from a DeepSeek-V3-Base foundation. A key identifying feature is its support knowing (RL) action, which was used to improve the design's actions beyond the standard pre-training and fine-tuning process. By incorporating RL, DeepSeek-R1 can adapt better to user feedback and goals, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, suggesting it's geared up to break down intricate inquiries and factor through them in a detailed manner. This guided reasoning process allows the model to produce more precise, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT abilities, aiming to create structured reactions while concentrating on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has captured the market's attention as a flexible text-generation model that can be incorporated into numerous workflows such as representatives, rational reasoning and information analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion specifications, making it possible for effective inference by routing queries to the most pertinent specialist "clusters." This approach allows the design to specialize in different issue domains while maintaining general performance. 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 deploy the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking abilities 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 70B). Distillation refers to a procedure of training smaller, more effective models to simulate the behavior and reasoning patterns of the bigger DeepSeek-R1 design, using 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 advise deploying this model with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, prevent harmful material, and evaluate models against essential security criteria. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce multiple guardrails tailored to various usage cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you require access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose 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, develop a limitation boost demand and connect to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent hazardous material, and assess designs against essential safety criteria. You can implement precaution for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to evaluate user inputs and model reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo.

The basic circulation includes 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 out to the design for inference. After getting the model's output, another guardrail check is used. If the output passes this last check, it's returned as the outcome. However, if either the input or output is intervened 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 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, complete the following actions:

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 use 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 supplies important details about the model's abilities, pricing structure, and application standards. You can discover detailed usage directions, consisting of sample API calls and code bits for combination. The model supports various text generation tasks, including content production, code generation, and concern answering, utilizing its reinforcement learning optimization and CoT thinking capabilities. The page likewise consists of deployment choices and licensing details to help you get going with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, pick 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 Variety of instances, get in a variety of circumstances (in between 1-100). 6. For example type, select your circumstances type. For optimal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure advanced security and facilities settings, including virtual private cloud (VPC) networking, service role authorizations, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production deployments, you may wish to review these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to begin using the model.

When the deployment is complete, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in playground to access an interactive user interface where you can explore different triggers and adjust design parameters like temperature level and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimal results. For example, material for reasoning.

This is an excellent method to check out the model's thinking and text generation capabilities before incorporating it into your applications. The play ground supplies immediate feedback, helping you comprehend how the design reacts to numerous inputs and letting you tweak your prompts for optimal results.

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

Run inference using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to carry out inference utilizing a released DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can create 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 implement guardrails. The script initializes the bedrock_runtime client, sets up reasoning parameters, and sends a request to generate text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, integrated algorithms, and prebuilt ML options that you can deploy with just a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your usage case, with your data, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart uses two convenient techniques: utilizing the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both methods to assist you pick the technique that best matches your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following steps to deploy DeepSeek-R1 utilizing SageMaker JumpStart:

1. On the SageMaker console, select 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 shows available designs, with details like the company name and design abilities.

4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card. Each design card reveals key details, consisting of:

- Model name

  • Provider name
  • Task classification (for example, Text Generation). Bedrock Ready badge (if appropriate), showing that this design can be signed up with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to conjure up the design

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

    The model details page consists of the following details:

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

    The About tab consists of essential details, such as:

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

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

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, use the automatically produced name or develop a custom-made one.
  1. For Instance type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, go into the variety of instances (default: 1). Selecting proper instance types and counts is vital for expense and efficiency optimization. Monitor your implementation to change 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 configurations for precision. For this model, we highly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to deploy the model.

    The deployment procedure can take several minutes to complete.

    When implementation is total, your endpoint status will alter to InService. At this point, the model is all set to accept inference requests through the endpoint. You can keep an eye on the release progress on the SageMaker console Endpoints page, wavedream.wiki which will display pertinent metrics and status details. When the deployment is total, you can conjure up the model using a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing 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 necessary AWS permissions 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 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 inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise use 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 revealed in the following code:

    Tidy up

    To prevent unwanted charges, complete the steps in this area to clean up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you released the design utilizing Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace implementations.
  5. In the Managed releases section, pipewiki.org find the endpoint you wish 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 right deployment: 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 desire to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we checked out 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 started. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting begun 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 utilizing AWS services and accelerated compute. Currently, he is concentrated on establishing methods for fine-tuning and enhancing the reasoning efficiency of big language designs. In his free time, Vivek takes pleasure in treking, viewing motion pictures, and attempting 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 an Expert Solutions Architect working on generative AI with the Third-Party Model Science group at AWS.

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