1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
francesca8231 edited this page 2025-02-09 05:08:26 +08:00
This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.


Today, we are thrilled 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 model, DeepSeek-R1, along with the distilled versions varying from 1.5 to 70 billion parameters to build, experiment, and properly scale your generative AI concepts on AWS.

In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to release the distilled versions of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) established by DeepSeek AI that utilizes support learning to enhance thinking abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial distinguishing feature is its reinforcement knowing (RL) step, which was used to refine the design's actions beyond the standard pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adjust more effectively to user feedback and goals, eventually improving both importance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, indicating it's equipped to break down intricate queries and reason through them in a detailed way. This guided reasoning procedure enables the design to produce more precise, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT capabilities, aiming to generate structured responses while concentrating on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has captured the market's attention as a flexible text-generation model that can be integrated into various workflows such as agents, logical reasoning and information analysis jobs.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, making it possible for effective reasoning by routing queries to the most pertinent professional "clusters." This technique enables the model to focus on various problem domains while maintaining overall 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 instance to release the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking abilities of the main R1 design to more effective architectures based upon popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a process of training smaller sized, more effective models to imitate the habits and thinking patterns of the larger DeepSeek-R1 design, utilizing it as a teacher design.

You can release DeepSeek-R1 model 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 use Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous content, and assess models against key security requirements. At the time of composing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create several guardrails tailored to various usage cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls throughout your AI applications.

Prerequisites

To release the DeepSeek-R1 design, 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, pick Amazon SageMaker, and validate you're utilizing ml.p5e.48 xlarge for raovatonline.org 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, develop a limitation boost request and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, avoid damaging content, and examine models against key safety criteria. You can carry out safety measures for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to assess user inputs and model responses released 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 develop the guardrail, see the GitHub repo.

The general flow includes the following actions: First, the system receives an input for the design. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent out to the model for reasoning. After receiving the design's output, another guardrail check is used. If the output passes this last check, it's returned as the outcome. However, if either the input or output is stepped in by the guardrail, a message is returned indicating the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following sections show inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, higgledy-piggledy.xyz and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following actions:

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

The model detail page provides important details about the design's capabilities, prices structure, and application standards. You can find detailed use guidelines, consisting of sample API calls and code snippets for combination. The design supports various text generation jobs, including content production, code generation, and concern answering, utilizing its reinforcement discovering optimization and CoT thinking abilities. The page also consists of deployment options and licensing details to help you start with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, select Deploy.

You will be prompted to set up the implementation 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, go into a number of circumstances (between 1-100). 6. For Instance type, pick your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can set up advanced security and facilities settings, including virtual personal cloud (VPC) networking, service role approvals, and encryption settings. For most use cases, the default settings will work well. However, for production deployments, you may wish to review these settings to align with your company's security and compliance requirements. 7. Choose Deploy to begin using the model.

When the deployment is total, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock play ground. 8. Choose Open in play area to access an interactive interface where you can try out different prompts and adjust model specifications like temperature level and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimal results. For example, content for reasoning.

This is an exceptional method to check out the model's reasoning and text generation capabilities before incorporating it into your applications. The play area supplies immediate feedback, wiki.vst.hs-furtwangen.de assisting you comprehend how the model responds to different inputs and letting you fine-tune your triggers for ideal outcomes.

You can quickly check the model in the play area 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 shows how to perform inference utilizing a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo. After you have actually developed the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, sets up inference criteria, and sends out a request to generate text based on a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center 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 designs to your usage case, with your information, and deploy them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart offers 2 convenient methods: using the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both techniques to help you choose the technique that finest fits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions to deploy DeepSeek-R1 using SageMaker JumpStart:

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

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

4. Look for DeepSeek-R1 to see the DeepSeek-R1 design card. Each model card shows key details, including:

- Model name

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

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

    The model details page consists of the following details:

    - The model name and company 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 specs.
  • Usage guidelines

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

    6. Choose Deploy to continue with release.

    7. For Endpoint name, use the automatically generated name or produce a custom one.
  1. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the variety of circumstances (default: 1). Selecting suitable instance types and counts is vital for cost and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time reasoning is chosen by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for accuracy. For this model, we strongly 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 a number of minutes to finish.

    When deployment is total, your endpoint status will alter to InService. At this moment, the model is ready to accept reasoning demands through the endpoint. You can keep an eye on the release progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the release is total, you can invoke the model utilizing a SageMaker runtime customer and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 using the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the essential AWS authorizations and environment setup. The following is a detailed code example that shows how to release 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 produce a guardrail using the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Clean up

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

    Delete the Amazon Bedrock Marketplace release

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, trademarketclassifieds.com choose Marketplace releases.
  5. In the Managed implementations section, locate the endpoint you wish to erase.
  6. Select the endpoint, and on the Actions menu, choose Delete.
  7. Verify the endpoint details to make certain you're deleting the appropriate implementation: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed will sustain expenses if you leave it running. Use the following code to delete 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 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, refer to 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 build ingenious solutions using AWS services and sped up calculate. Currently, he is focused on establishing methods for fine-tuning and optimizing the reasoning performance of large language designs. In his complimentary time, Vivek takes pleasure in hiking, seeing motion pictures, 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 a Specialist Solutions Architect working on generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads product, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about constructing services that assist consumers accelerate their AI journey and unlock company value.