1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
krystlebruntne edited this page 2025-02-13 08:20:26 +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 designs 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, together with the distilled versions ranging from 1.5 to 70 billion specifications to build, 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 deploy the distilled variations of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that utilizes reinforcement finding out to boost thinking abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key identifying function is its support learning (RL) action, which was used to improve the model's responses beyond the basic pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and forum.altaycoins.com goals, eventually enhancing both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, indicating it's geared up to break down complex questions and factor through them in a detailed way. This assisted reasoning procedure allows the design to produce more accurate, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT abilities, aiming to generate structured actions while concentrating on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has actually caught the market's attention as a flexible text-generation model that can be integrated into different workflows such as agents, rational reasoning and data interpretation tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion parameters, allowing efficient inference by routing questions to the most pertinent professional "clusters." This method permits the design to focus on various problem domains while maintaining total performance. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for inference. In this post, we will use an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking abilities 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 describes a process of training smaller, more effective designs to mimic the habits and reasoning patterns of the bigger DeepSeek-R1 model, using it as a teacher model.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend releasing this model with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid damaging content, and assess designs against crucial safety requirements. At the time of composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce multiple guardrails tailored to different use cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you require access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and validate 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 releasing. To ask for a limit boost, develop a limit increase demand 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) authorizations to use Amazon Bedrock Guardrails. For directions, see Establish consents to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent harmful content, and assess designs against key security criteria. You can carry out security procedures for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and model reactions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.

The basic flow includes 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 to the design for reasoning. After receiving the design's output, another guardrail check is applied. If the output passes this final check, it's returned as the last result. 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 happened at the input or output phase. The examples showcased in the following areas show reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, 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, pick 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 does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a service provider and pick the DeepSeek-R1 model.

The model detail page provides essential details about the model's abilities, prices structure, and application guidelines. You can discover detailed usage instructions, consisting of sample API calls and code snippets for integration. The model supports different text generation jobs, consisting of content creation, code generation, and question answering, utilizing its support discovering optimization and CoT thinking abilities. The page also includes deployment choices and licensing details to help you get started with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, select Deploy.

You will be prompted to set up 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 Number of circumstances, enter a variety of circumstances (in between 1-100). 6. For example type, pick your instance type. For ideal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, it-viking.ch you can set up innovative security and infrastructure settings, including virtual private cloud (VPC) networking, service role authorizations, and encryption settings. For most use cases, the default settings will work well. However, for production releases, you might wish to review these settings to line up with your organization's security and compliance requirements. 7. Choose Deploy to start utilizing the model.

When the release is complete, you can evaluate 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 different triggers and adjust model specifications like temperature and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimum outcomes. For example, material for inference.

This is an excellent way to check out the design's thinking and text generation abilities before integrating it into your applications. The play ground supplies instant feedback, assisting you comprehend how the design reacts to different inputs and letting you tweak your triggers for ideal outcomes.

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

Run reasoning utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example demonstrates how to perform reasoning using a released DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can produce a guardrail using 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, utilize the following code to execute guardrails. The script initializes the bedrock_runtime customer, sets up inference parameters, and sends out a request to create text based upon 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 solutions that you can deploy with just a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart provides 2 convenient techniques: utilizing the intuitive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you choose the technique that best matches your needs.

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 triggered to create a domain. 3. On the SageMaker Studio console, choose JumpStart in the navigation pane.

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

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

- Model name

  • Provider name
  • Task category (for instance, Text Generation). Bedrock Ready badge (if suitable), suggesting that this model can be signed up with Amazon Bedrock, allowing you to use Amazon Bedrock APIs to invoke the design

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

    The model details page consists of the following details:

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

    The About tab includes essential details, such as:

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

    Before you release the model, it's recommended to review the model details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to continue with release.

    7. For Endpoint name, pediascape.science utilize the automatically generated name or develop a customized one.
  1. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the variety of circumstances (default: 1). Selecting suitable circumstances types and counts is important for expense and efficiency optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for precision. For this model, we strongly recommend sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to release the design.

    The implementation process can take a number of minutes to finish.

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

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get started with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the essential 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 design is provided in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run additional 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:

    Clean up

    To prevent undesirable charges, finish the actions in this area to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the design using Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace releases.
  5. In the Managed implementations 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 proper implementation: 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 delete the endpoint if you want 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 model using Bedrock Marketplace and bytes-the-dust.com SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get begun. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, 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 business construct ingenious solutions using AWS services and accelerated calculate. Currently, he is focused on establishing methods for fine-tuning and optimizing the inference performance of large language designs. In his downtime, Vivek enjoys hiking, watching motion pictures, it-viking.ch 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 technology and Bioinformatics.

    Jonathan Evans is a Professional Solutions Architect dealing with 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 center. She is passionate about building solutions that assist customers their AI journey and unlock company worth.