1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
caridadlogsdon edited this page 2025-02-07 04:54:05 +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 excited to reveal that DeepSeek R1 distilled Llama and Qwen designs 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 versions varying from 1.5 to 70 billion parameters to build, experiment, and responsibly 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 similar steps to release the distilled versions of the designs too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that uses reinforcement learning to enhance thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A key differentiating feature is its reinforcement learning (RL) step, which was utilized to refine the model's responses beyond the standard pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and goals, ultimately enhancing both relevance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, indicating it's equipped to break down intricate questions and factor through them in a detailed way. This assisted thinking process allows the design to produce more accurate, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT capabilities, aiming to create structured responses while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually captured the industry's attention as a versatile text-generation model that can be incorporated into different workflows such as agents, rational thinking and information analysis tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion criteria, making it possible for effective inference by routing queries to the most relevant specialist "clusters." This technique allows the design to concentrate on different problem domains while maintaining total performance. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge circumstances to deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning abilities of the main R1 design to more effective architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). to a procedure of training smaller sized, more efficient designs 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 advise deploying this design with guardrails in place. In this blog site, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent hazardous material, and examine designs against key safety requirements. 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 create numerous guardrails tailored to various usage cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security 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, pick Amazon SageMaker, and verify you're using 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 ask for a limitation increase, create a limit increase request and connect to your account group.

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) authorizations to use Amazon Bedrock Guardrails. For directions, see Establish approvals to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, wiki.whenparked.com avoid harmful material, and evaluate models against essential safety requirements. You can execute safety measures for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and model actions 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 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 getting the design's output, another guardrail check is applied. If the output passes this final check, it's returned as the final outcome. 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 occurred at the input or output stage. The examples showcased in the following areas 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 actions:

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

The design detail page supplies essential details about the design's abilities, pricing structure, and implementation standards. You can find detailed usage instructions, including sample API calls and code bits for integration. The model supports various text generation tasks, consisting of material production, code generation, and concern answering, utilizing its reinforcement discovering optimization and CoT reasoning abilities. The page also includes release options and licensing details to help you start with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, choose Deploy.

You will be prompted to configure the release details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters). 5. For Variety of instances, go into a variety of instances (between 1-100). 6. For Instance type, choose your instance type. For optimal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and infrastructure settings, including virtual personal cloud (VPC) networking, service role consents, and encryption settings. For a lot of use cases, the default settings will work well. However, for production releases, you may wish to examine these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to start utilizing the design.

When the deployment is complete, 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 experiment with various triggers and adjust model specifications like temperature and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for optimal results. For instance, content for reasoning.

This is an exceptional method to explore the design's reasoning and text generation abilities before incorporating it into your applications. The play ground provides instant feedback, assisting you understand how the model reacts to numerous inputs and letting you fine-tune your prompts for optimum outcomes.

You can quickly check the model in the play ground through the UI. However, to invoke the released 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 demonstrates how to carry out reasoning utilizing a deployed DeepSeek-R1 model 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 actually created the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime customer, configures reasoning criteria, and sends a request to generate text based upon a user timely.

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 release with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your data, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses two hassle-free approaches: utilizing the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both methods to assist you select the method that best matches 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, choose JumpStart in the navigation pane.

The model internet browser displays available models, with details like the provider name and design abilities.

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

- Model name

  • Provider name
  • Task category (for example, Text Generation). Bedrock Ready badge (if appropriate), suggesting that this design can be signed up with Amazon Bedrock, permitting you to utilize 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 design name and service provider details. Deploy button to release the model. About and Notebooks tabs with detailed details

    The About tab includes crucial details, such as:

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

    Before you deploy the model, it's advised to examine the model 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 a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the number of circumstances (default: 1). Selecting proper circumstances types and counts is crucial for expense and efficiency optimization. Monitor your release 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 setups for accuracy. For this design, we strongly recommend sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to deploy the model.

    The release procedure can take several minutes to complete.

    When release is total, your endpoint status will alter to InService. At this point, the design is prepared to accept reasoning requests through the endpoint. You can keep an eye on the release development on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the implementation is complete, you can conjure up the design using a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 using the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the needed 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 deploying the model is supplied in the Github here. You can clone the note pad and disgaeawiki.info run from SageMaker Studio.

    You can run extra demands against the predictor:

    Implement guardrails and pediascape.science 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 produce a guardrail utilizing the Amazon Bedrock console or the API, and execute it as shown in the following code:

    Tidy up

    To avoid undesirable charges, complete the actions in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you deployed the design utilizing Amazon Bedrock Marketplace, complete the following actions:

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

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed will sustain costs if you leave it running. Use the following code to delete the endpoint if you want 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 wavedream.wiki 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 raovatonline.org 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 construct ingenious solutions using AWS services and sped up calculate. Currently, he is concentrated on establishing techniques for fine-tuning and optimizing the inference performance of big language designs. In his spare time, Vivek enjoys treking, watching movies, and attempting various foods.

    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 item, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about constructing solutions that assist customers accelerate their AI journey and unlock organization worth.