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


Today, we are excited to announce that DeepSeek R1 distilled Llama and Qwen models are available through Amazon Bedrock Marketplace and yewiki.org Amazon SageMaker JumpStart. With this launch, you can now release DeepSeek AI's first-generation frontier design, DeepSeek-R1, together with the distilled variations varying from 1.5 to 70 billion parameters to construct, experiment, and properly scale your generative AI ideas on AWS.

In this post, we show how to get started with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable steps to deploy the distilled variations of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that uses support learning to boost thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial distinguishing feature is its reinforcement knowing (RL) action, which was used to fine-tune the model's actions beyond the basic pre-training and tweak procedure. By including RL, DeepSeek-R1 can adjust better to user feedback and goals, ultimately enhancing both significance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, indicating it's equipped to break down complicated inquiries and factor through them in a detailed manner. This guided thinking procedure enables the model to produce more accurate, transparent, and detailed responses. This design integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured responses while concentrating on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has captured the market's attention as a versatile text-generation design that can be integrated into numerous workflows such as representatives, logical reasoning and data interpretation tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture allows activation of 37 billion specifications, making it possible for effective reasoning by routing questions to the most pertinent professional "clusters." This technique permits the model to concentrate on various issue domains while maintaining general efficiency. DeepSeek-R1 needs a minimum of 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 supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking 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 refers to a procedure of training smaller, more efficient designs to simulate the behavior and thinking patterns of the larger DeepSeek-R1 design, using it as an instructor design.

You can release 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 place. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, avoid hazardous material, and evaluate designs against key 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 produce numerous guardrails tailored to various usage cases and links.gtanet.com.br apply them to the DeepSeek-R1 model, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, 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 use. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are deploying. To request a limitation increase, develop a limit boost request and connect to your account team.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) consents to use Amazon Bedrock Guardrails. For instructions, see Set up consents to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, prevent harmful content, and assess models against crucial security criteria. You can execute precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to evaluate user inputs and model responses released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create a guardrail utilizing the Amazon Bedrock console or the API. For the example code to create the guardrail, mediawiki.hcah.in see the GitHub repo.

The basic circulation includes the following steps: First, the system receives 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 inference. After receiving the model's output, another guardrail check is used. If the output passes this last check, it's returned as the last result. However, if either the input or output is intervened by the guardrail, a message is returned suggesting the nature of the intervention and whether it happened 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 offers you access to over 100 popular, yewiki.org emerging, and specialized structure 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 catalog under Foundation designs 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 select the DeepSeek-R1 design.

The design detail page provides vital details about the design's abilities, rates structure, and execution standards. You can find detailed usage instructions, including sample API calls and code bits for integration. The model supports different text generation tasks, consisting of content creation, code generation, and concern answering, using its support learning optimization and CoT reasoning abilities. The page also includes implementation choices and licensing details to help you start with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, choose Deploy.

You will be triggered to configure the deployment details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters). 5. For Variety of instances, enter a variety of circumstances (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 recommended. Optionally, you can configure innovative security and facilities settings, consisting of virtual private cloud (VPC) networking, service role permissions, and file encryption settings. For a lot of use cases, the default settings will work well. However, for production releases, you may desire to review these settings to align with your company's security and compliance requirements. 7. Choose Deploy to begin utilizing the design.

When the release is total, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in playground to access an interactive interface where you can experiment with different triggers and adjust model criteria like temperature level and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for ideal outcomes. For example, material for inference.

This is an outstanding way to explore the model's reasoning and text generation abilities before incorporating it into your applications. The play area supplies instant feedback, helping you comprehend how the model reacts to different inputs and letting you fine-tune your triggers for optimal outcomes.

You can quickly evaluate the design in the play ground through the UI. However, to conjure up the released design programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run inference using guardrails with the deployed DeepSeek-R1 endpoint

The following code example shows how to perform inference utilizing a released DeepSeek-R1 model 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 develop the guardrail, see the GitHub repo. After you have produced the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, and sends a demand ratemywifey.com to generate text based upon a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub 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 pre-trained models to your usage case, with your information, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart provides 2 hassle-free techniques: using the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both techniques to assist you pick the technique that finest fits 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, choose Studio in the navigation pane. 2. First-time users will be prompted to a domain. 3. On the SageMaker Studio console, pick JumpStart in the navigation pane.

The model browser shows available models, with details like the company name and model capabilities.

4. Search for DeepSeek-R1 to see the DeepSeek-R1 design card. Each model card reveals essential details, including:

- Model name

  • Provider name
  • Task classification (for example, Text Generation). Bedrock Ready badge (if applicable), suggesting 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 view the design details page.

    The model details page consists of the following details:

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

    The About tab includes essential details, such as:

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

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

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, use the automatically generated name or create a custom-made one.
  1. For example type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the number of instances (default: 1). Selecting suitable 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 inference is selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for precision. For this design, we strongly advise sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to release the design.

    The release process can take several minutes to complete.

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

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get started with DeepSeek-R1 using the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the needed 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 model is supplied in the Github here. You can clone the note pad and run 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 likewise use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail utilizing the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Clean up

    To prevent undesirable charges, finish the actions in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you deployed the model using 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 deployments 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 erasing the correct implementation: 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 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, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and wavedream.wiki 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 business build ingenious options using AWS services and sped up compute. Currently, he is focused on developing techniques for fine-tuning and enhancing the inference performance of large language models. In his downtime, Vivek takes pleasure in hiking, seeing motion pictures, and trying different foods.

    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 team at AWS.

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