1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Alphonse Tousignant edited this page 2025-02-09 18:59:42 +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 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 deploy DeepSeek AI's first-generation frontier model, DeepSeek-R1, in addition to the distilled versions varying from 1.5 to 70 billion specifications to construct, experiment, and properly scale your generative AI ideas on AWS.

In this post, hb9lc.org we demonstrate how to get started with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to release the distilled variations of the designs also.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that utilizes reinforcement finding out to enhance reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base structure. An essential identifying feature is its support knowing (RL) action, which was utilized to refine the design's responses beyond the standard pre-training and tweak procedure. By including RL, DeepSeek-R1 can adapt better to user feedback and objectives, eventually boosting both importance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, implying it's geared up to break down complex questions and factor through them in a detailed way. This assisted reasoning procedure allows the model to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to create structured actions while focusing on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has actually caught the market's attention as a versatile text-generation design that can be integrated into various workflows such as agents, logical reasoning and data analysis jobs.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion parameters, making it possible for efficient inference by routing questions to the most appropriate expert "clusters." This approach enables the model to focus on various problem domains while maintaining total performance. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize 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 models bring the reasoning capabilities 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 refers to a process of training smaller, more effective models to mimic the habits and thinking patterns of the larger DeepSeek-R1 model, utilizing it as an instructor design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest deploying this design with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous content, and examine designs against key security criteria. At the time of writing this blog site, wiki.vst.hs-furtwangen.de 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 use 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 model, you require access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and validate you're using 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 releasing. To ask for a limitation boost, develop a limitation boost request and connect to your account group.

Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) authorizations to utilize Amazon Bedrock Guardrails. For directions, see Establish consents to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, prevent harmful material, and examine designs against essential safety requirements. You can implement precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to examine user inputs and design 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 develop the guardrail, see the GitHub repo.

The general flow involves the following actions: 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 out to the design for inference. After receiving the design's output, another guardrail check is used. If the output passes this last check, it's returned as the final outcome. 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 phase. The examples showcased in the following sections demonstrate reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides you access to over 100 popular, emerging, and specialized structure 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 brochure under Foundation models in the navigation pane. At the time of composing this post, you can use the InvokeModel API to conjure up the design. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and choose the DeepSeek-R1 model.

The model detail page supplies vital details about the model's capabilities, pricing structure, and execution standards. You can discover detailed usage directions, including sample API calls and code snippets for combination. The design supports different text generation tasks, larsaluarna.se including material creation, code generation, and question answering, using its support discovering optimization and CoT reasoning capabilities. The page also includes release choices and licensing details to assist you get going with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, choose Deploy.

You will be prompted to set up the implementation details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters). 5. For Variety of instances, get in a number of instances (between 1-100). 6. For example type, choose your instance type. For optimum efficiency with DeepSeek-R1, garagesale.es a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can set up sophisticated security and facilities settings, including virtual personal cloud (VPC) networking, service role authorizations, and encryption settings. For many utilize cases, the default settings will work well. However, for production implementations, you may want to evaluate these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to begin utilizing the model.

When the release is complete, you can evaluate 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 various triggers and adjust design parameters like temperature level and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for ideal results. For example, content for reasoning.

This is an exceptional way to explore the design's reasoning and text generation capabilities before incorporating it into your applications. The play ground supplies immediate feedback, assisting you understand how the model responds to various inputs and letting you fine-tune your prompts for optimum outcomes.

You can rapidly check the model in the playground through the UI. However, to invoke the deployed model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run reasoning using guardrails with the released DeepSeek-R1 endpoint

The following code example demonstrates how to carry out reasoning using a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can create a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo. After you have actually produced the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, and sends out a demand to create text based on a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML options that you can release with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 convenient methods: using the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both approaches to help you select the method that your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

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

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

- Model name

  • Provider name
  • Task category (for example, Text Generation). Bedrock Ready badge (if appropriate), suggesting that this design can be registered with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to invoke the model

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

    The model details page includes the following details:

    - The design name and wiki.vst.hs-furtwangen.de provider details. Deploy button to release the design. About and Notebooks tabs with detailed details

    The About tab includes crucial details, such as:

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

    Before you release the model, it's recommended to examine the design details and license terms to validate compatibility with your use case.

    6. Choose Deploy to continue with release.

    7. For Endpoint name, use the immediately created name or develop a custom-made one.
  1. For example type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, go into the number of circumstances (default: 1). Selecting suitable circumstances types and counts is crucial for expense and performance optimization. Monitor your release 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 advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to release the design.

    The release procedure can take numerous minutes to complete.

    When implementation is complete, your endpoint status will alter to InService. At this moment, the design is all set to accept inference demands through the endpoint. You can keep an eye on the deployment progress on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the release is complete, you can invoke the design utilizing a SageMaker runtime customer and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get started 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 approvals and environment setup. The following is a detailed code example that demonstrates how to deploy and use DeepSeek-R1 for reasoning programmatically. The code for releasing the model is provided in the Github here. You can clone the notebook and range from SageMaker Studio.

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

    Tidy up

    To avoid unwanted charges, complete the steps in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace release

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace releases.
  5. In the Managed releases section, locate the endpoint you want 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 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 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 designs, 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 assists emerging generative AI companies develop ingenious options using AWS services and accelerated compute. Currently, he is focused on establishing techniques for fine-tuning and enhancing the reasoning efficiency of big language models. In his downtime, Vivek enjoys hiking, watching movies, and attempting different 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 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 strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about developing solutions that assist clients accelerate their AI journey and unlock organization worth.