1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
hermelindaneel edited this page 2025-03-13 05:45:39 +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 announce 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 design, DeepSeek-R1, along with the distilled versions varying from 1.5 to 70 billion parameters to construct, experiment, and properly scale your generative AI concepts 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 variations of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that uses reinforcement finding out to improve reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A crucial differentiating function is its support knowing (RL) step, which was utilized to refine the design's reactions beyond the standard pre-training and tweak process. By integrating RL, DeepSeek-R1 can adjust more successfully to user feedback and objectives, ultimately improving both relevance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, suggesting it's equipped to break down complicated inquiries and factor through them in a detailed way. This directed thinking process permits the model to produce more accurate, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT capabilities, aiming to generate structured responses while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually caught the industry's attention as a flexible text-generation design that can be integrated into various workflows such as agents, rational thinking and information analysis jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture enables activation of 37 billion criteria, enabling effective reasoning by routing inquiries to the most appropriate specialist "clusters." This technique permits the model to concentrate on various problem domains while maintaining total effectiveness. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge circumstances to deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking abilities of the main R1 design to more effective architectures based on popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller sized, more efficient models to mimic the behavior and reasoning patterns of the larger 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 model, we suggest deploying this design with guardrails in location. In this blog, we will utilize Amazon Bedrock Guardrails to present safeguards, gratisafhalen.be avoid harmful content, and assess designs against key safety criteria. At the time of writing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce multiple guardrails tailored to different use cases and apply them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, setiathome.berkeley.edu you require access to an ml.p5e instance. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, select Amazon SageMaker, and verify 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 request a limitation increase, produce a limit boost request and reach out to your account group.

Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For directions, see Set up authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid damaging content, and examine models against crucial safety criteria. You can implement safety steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to examine user inputs and design 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 develop the guardrail, see the GitHub repo.

The general circulation 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 model for inference. After getting the model's output, another guardrail check is used. If the output passes this final check, it's returned as the last 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 stage. The examples showcased in the following sections show reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized foundation models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following actions:

1. On the Amazon Bedrock console, select Model catalog under Foundation models in the navigation pane. At the time of writing this post, you can use the InvokeModel API to conjure up the model. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and select the DeepSeek-R1 design.

The design detail page supplies important details about the model's abilities, rates structure, and application guidelines. You can find detailed usage instructions, consisting of sample API calls and code snippets for combination. The model supports various text generation tasks, consisting of material production, code generation, and concern answering, utilizing its support finding out optimization and CoT reasoning abilities. The page also consists of release choices and licensing details to assist you start with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, select Deploy.

You will be prompted to configure 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 circumstances, get in a variety of instances (in between 1-100). 6. For Instance type, select your instance type. For ideal efficiency 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 permissions, and file encryption settings. For many utilize cases, the default settings will work well. However, for production implementations, you might wish to evaluate these settings to align with your company's security and compliance requirements. 7. Choose Deploy to start utilizing the design.

When the release is total, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock play area. 8. Choose Open in play area to access an interactive interface where you can try out various prompts and change design criteria like temperature level and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for ideal outcomes. For example, content for reasoning.

This is an excellent method to explore the model's thinking and text generation capabilities before incorporating it into your applications. The play area offers instant feedback, assisting you comprehend how the model reacts to various inputs and letting you fine-tune your prompts for optimum outcomes.

You can quickly evaluate the design in the playground through the UI. However, to invoke the released design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run inference utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to carry out reasoning utilizing a deployed DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to create 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 customer, configures reasoning specifications, 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 solutions 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 data, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart uses two practical methods: utilizing the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both methods to help you select the technique that finest matches your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The design browser displays available designs, with details like the provider name and model capabilities.

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

- Model name

  • Provider name
  • Task classification (for instance, Text Generation). Bedrock Ready badge (if appropriate), suggesting 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 see the model details page.

    The design details page consists of the following details:

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

    The About tab consists of important details, such as:

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

    Before you deploy the design, it's advised to examine the model details and license terms to validate compatibility with your usage case.

    6. Choose Deploy to proceed with deployment.

    7. For Endpoint name, utilize the instantly produced name or produce a custom-made one.
  1. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the number of instances (default: 1). Selecting proper circumstances types and counts is crucial for cost and performance 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 model, we strongly suggest adhering 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 finish.

    When release is total, your endpoint status will alter to InService. At this moment, the model is ready to accept inference requests through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the deployment is total, you can conjure up the design utilizing a SageMaker runtime customer and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To begin with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the required AWS authorizations and environment setup. The following is a detailed code example that demonstrates how to deploy and utilize 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 additional demands against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also use 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 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 deployment

    If you deployed the design using Amazon Bedrock Marketplace, complete the following steps:

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

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you released will sustain expenses if you leave it running. Use the following code to erase the endpoint if you wish to stop sustaining charges. For more details, see Delete Endpoints and wiki.asexuality.org 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 Amazon Bedrock Marketplace now to get started. 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 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 develop innovative services using AWS services and sped up compute. Currently, he is concentrated on establishing methods for fine-tuning and enhancing the inference efficiency of large language designs. In his downtime, Vivek takes pleasure in treking, seeing movies, and attempting various cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group 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 Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science group 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 developing solutions that help clients accelerate their AI journey and unlock organization value.