3 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Annett Kinchela edited this page 2 months ago


Today, we are delighted to reveal that DeepSeek R1 distilled Llama and Qwen models are available through Amazon Bedrock Marketplace and Amazon SageMaker JumpStart. With this launch, you can now release DeepSeek AI's first-generation frontier model, DeepSeek-R1, in addition to the distilled variations ranging 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 get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to deploy the distilled variations of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes reinforcement discovering to enhance thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base structure. An essential identifying feature is its support learning (RL) step, which was used to refine the model's reactions beyond the basic pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adjust better to user feedback and goals, ultimately enhancing both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, indicating it's geared up to break down complex questions and factor through them in a detailed way. This directed thinking process permits the design to produce more precise, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT abilities, aiming to create structured responses while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has captured the market's attention as a flexible text-generation design that can be incorporated into numerous workflows such as agents, rational thinking and data analysis tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion parameters, making it possible for effective reasoning by routing questions to the most pertinent specialist "clusters." This method permits the design to specialize in various problem domains while maintaining overall efficiency. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for reasoning. 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 supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs 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 70B). Distillation refers to a process of training smaller sized, more effective models to simulate the habits and thinking patterns of the bigger DeepSeek-R1 design, utilizing 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 suggest deploying this design with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, avoid harmful material, and assess designs against key safety criteria. At the time of composing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce numerous guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, 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 examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose Amazon SageMaker, and verify 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 deploying. To ask for a limitation boost, develop a limit increase demand and connect to your account group.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) authorizations to utilize Amazon Bedrock Guardrails. For guidelines, see Establish authorizations to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid harmful material, and evaluate designs against key safety criteria. You can execute security measures for wavedream.wiki the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows 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 produce the guardrail, see the GitHub repo.

The general flow involves 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 to the design for reasoning. After receiving 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 stepped in by the guardrail, a message is returned suggesting the nature of the intervention and whether it occurred at the input or output stage. The examples showcased in the following sections show reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides you access to over 100 popular, emerging, and specialized foundation designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:

1. On the Amazon Bedrock console, select 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 doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a supplier and choose the DeepSeek-R1 design.

The model detail page offers necessary details about the model's abilities, prices structure, and implementation guidelines. You can discover detailed use instructions, consisting of sample API calls and code snippets for . The model supports various text generation tasks, including material development, code generation, and question answering, using its support discovering optimization and CoT thinking abilities. The page likewise includes release alternatives and licensing details to assist you start with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, choose Deploy.

You will be prompted to configure the release details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of instances, go into a variety of circumstances (in between 1-100). 6. For example type, pick your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can configure advanced security and facilities settings, consisting of virtual personal cloud (VPC) networking, service role permissions, and encryption settings. For a lot of use cases, the default settings will work well. However, for production releases, you may wish to review these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to start utilizing the design.

When the implementation is complete, you can test DeepSeek-R1's abilities straight in the Amazon Bedrock playground. 8. Choose Open in play ground to access an interactive interface where you can experiment with different triggers and adjust design criteria like temperature level and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimal results. For example, content for inference.

This is an excellent way to explore the design's reasoning and text generation abilities before integrating it into your applications. The playground supplies immediate feedback, helping you understand how the design reacts to numerous inputs and letting you fine-tune your triggers for optimum results.

You can quickly check the design in the playground through the UI. However, to conjure up the deployed design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run reasoning utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example demonstrates how to perform inference using a released DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can produce a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo. After you have produced the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, sets up inference parameters, and larsaluarna.se sends out a request to create text based on 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 deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, it-viking.ch with your information, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 convenient methods: using the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both methods to help you choose the method that finest suits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

1. On the SageMaker console, choose Studio in the navigation pane. 2. First-time users will be triggered to develop a domain. 3. On the SageMaker Studio console, pick JumpStart in the navigation pane.

The model internet browser displays available models, with details like the company name and systemcheck-wiki.de design abilities.

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

- Model name

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

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

    The design details page consists of the following details:

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

    The About tab consists of essential details, such as:

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

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

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, use the immediately created name or create a custom one.
  1. For example type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the number of instances (default: 1). Selecting suitable circumstances types and counts is essential for expense and performance optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time inference is selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for accuracy. For this design, we highly suggest adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to release the design.

    The implementation process can take several minutes to complete.

    When release is complete, your endpoint status will alter to InService. At this moment, the design is ready to accept inference demands through the endpoint. You can keep track of the deployment development on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the release is total, you can invoke the design utilizing a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get started 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 authorizations and environment setup. The following is a detailed code example that demonstrates how to release and use DeepSeek-R1 for reasoning programmatically. The code for deploying the design is offered in the Github here. You can clone the notebook and run from SageMaker Studio.

    You can run extra demands 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 create a guardrail utilizing the Amazon Bedrock console or the API, and execute it as revealed in the following code:

    Tidy up

    To prevent unwanted charges, finish the actions in this area to clean up your resources.

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace releases.
  5. In the Managed deployments area, locate the endpoint you wish to delete.
  6. Select the endpoint, and hb9lc.org on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're erasing the proper deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you released will sustain costs if you leave it running. Use the following code to erase the endpoint if you want 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 begin. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained models, 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 helps emerging generative AI companies construct ingenious solutions utilizing AWS services and sped up compute. Currently, he is focused on developing strategies for fine-tuning and optimizing the inference performance of large language designs. In his spare time, Vivek enjoys treking, enjoying motion pictures, and trying various cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team 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 an Expert Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads product, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about building services that help customers accelerate their AI journey and unlock business worth.