1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Bradly Tuttle edited this page 2025-02-07 10:30:38 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.


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, together with the distilled variations ranging from 1.5 to 70 billion specifications to develop, experiment, and properly scale your generative AI ideas on AWS.

In this post, we demonstrate how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to release the distilled versions of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) established by DeepSeek AI that uses support finding out to improve thinking capabilities through a multi-stage training from a DeepSeek-V3-Base foundation. A crucial identifying function is its support learning (RL) step, which was used to fine-tune the design's actions beyond the standard pre-training and fine-tuning process. By incorporating RL, DeepSeek-R1 can adjust more efficiently to user feedback and goals, eventually enhancing both significance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, meaning it's equipped to break down complex questions and reason through them in a detailed way. This guided reasoning procedure permits the design to produce more precise, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, forum.pinoo.com.tr aiming to produce structured actions while concentrating on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has captured the market's attention as a flexible text-generation design that can be integrated into different workflows such as representatives, logical thinking and data interpretation tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion specifications, enabling effective reasoning by routing queries to the most appropriate professional "clusters." This method enables the model to concentrate on different issue domains while maintaining total effectiveness. DeepSeek-R1 needs at least 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 model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning abilities of the main R1 design 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 efficient designs to mimic the habits and thinking patterns of the bigger DeepSeek-R1 design, utilizing it as a teacher model.

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, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent harmful content, and assess models against essential security criteria. At the time of composing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create several guardrails tailored to various usage cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, wiki.dulovic.tech 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, pick 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 instance in the AWS Region you are deploying. To ask for a limitation increase, create a limit boost request and reach out to your account team.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) permissions 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 allows you to introduce safeguards, prevent harmful content, and examine designs against crucial security requirements. You can carry out precaution for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to examine user inputs and model actions 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 create the guardrail, see the GitHub repo.

The general flow includes the following steps: First, the system receives 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 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 indicating the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following sections demonstrate 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 models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:

1. On the Amazon Bedrock console, pick Model catalog under Foundation models in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to invoke the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and select the DeepSeek-R1 design.

The model detail page offers vital details about the design's abilities, pricing structure, and implementation standards. You can find detailed usage guidelines, including sample API calls and code bits for integration. The design supports different text generation jobs, consisting of material development, code generation, wiki.rolandradio.net and concern answering, using its support discovering optimization and CoT reasoning capabilities. The page also consists of deployment choices and licensing details to help you get going with DeepSeek-R1 in your applications. 3. To start utilizing 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 Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of instances, get in a number of instances (between 1-100). 6. For Instance type, choose your instance type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can set up sophisticated security and facilities settings, consisting of virtual personal cloud (VPC) networking, service role permissions, and encryption settings. For the majority of utilize cases, the default settings will work well. However, for production deployments, you may want to evaluate these settings to align with your company's security and compliance requirements. 7. Choose Deploy to start using the model.

When the implementation is complete, you can test DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in playground to access an interactive interface where you can try out various triggers and adjust design parameters like temperature and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimal outcomes. For instance, material for inference.

This is an excellent way to explore the model's reasoning and text generation capabilities before integrating it into your applications. The playground offers immediate feedback, helping you comprehend how the model responds to numerous inputs and letting you tweak your triggers for optimum results.

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

Run reasoning using guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to carry out inference utilizing a released DeepSeek-R1 design 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 produce the guardrail, see the GitHub repo. After you have developed the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up reasoning criteria, and sends out a request to create text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in algorithms, and prebuilt ML services that you can deploy with simply a couple of clicks. With SageMaker JumpStart, you can tailor yewiki.org pre-trained designs to your use case, with your data, and release them into production utilizing either the UI or forum.altaycoins.com SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart provides two hassle-free methods: utilizing the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's explore both methods to assist you choose the approach that finest fits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The design web browser shows available designs, with details like the provider name and design capabilities.

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

- Model name

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

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

    The design details page consists of the following details:

    - The model name and service provider details. Deploy button to deploy the model. 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 release the model, it's recommended to review the model details and license terms to verify compatibility with your use case.

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, utilize the instantly created name or produce a custom one.
  1. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the number of instances (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 selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for precision. For this design, we highly recommend adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to deploy the design.

    The deployment process can take several minutes to finish.

    When deployment is total, your endpoint status will alter to InService. At this point, the model is all set to accept reasoning requests 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 deployment is complete, you can invoke the design utilizing a SageMaker runtime customer and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing 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 consents and environment setup. The following is a detailed code example that demonstrates how to deploy and use DeepSeek-R1 for inference programmatically. The code for deploying the model is provided in the Github here. You can clone the note pad 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 utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail using the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Tidy up

    To prevent unwanted charges, finish the steps in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the model utilizing Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace implementations.
  5. In the Managed releases section, locate the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, pick Delete.
  7. Verify the endpoint details to make certain you're deleting the right release: 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 release the DeepSeek-R1 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or raovatonline.org Amazon Bedrock Marketplace now to begin. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Beginning 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 develop innovative solutions using AWS services and sped up compute. Currently, he is concentrated on establishing techniques for wavedream.wiki fine-tuning and optimizing the reasoning efficiency of big language designs. In his spare time, Vivek takes pleasure in treking, seeing motion pictures, and trying different 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 Science and Bioinformatics.

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

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