1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
adelakellway33 edited this page 2025-02-20 05:24:58 +00: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 delighted 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, in addition to the distilled versions ranging from 1.5 to 70 billion parameters to construct, experiment, and responsibly scale your generative AI concepts on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes support discovering to enhance reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A crucial distinguishing feature is its support knowing (RL) action, which was used to refine the design's reactions beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adapt better to user feedback and goals, ultimately boosting both relevance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, indicating it's geared up to break down intricate questions and reason through them in a detailed way. This directed reasoning procedure allows the design to produce more accurate, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT capabilities, aiming to create structured responses while focusing on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has caught the industry's attention as a flexible text-generation design that can be incorporated into various workflows such as representatives, logical thinking and data analysis tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion criteria, enabling effective reasoning by routing questions to the most relevant expert "clusters." This approach allows the model to concentrate on different issue domains while maintaining overall efficiency. DeepSeek-R1 requires a minimum of 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 comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning capabilities of the main R1 model to more efficient 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 designs to imitate the behavior and thinking patterns of the bigger DeepSeek-R1 design, using it as a teacher model.

You can deploy 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 place. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous material, and examine designs against essential security requirements. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create multiple guardrails tailored to various use cases and use them to the DeepSeek-R1 model, 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 instance. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, select Amazon SageMaker, and validate you're utilizing ml.p5e.48 xlarge for endpoint usage. 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 increase, create a limit boost demand and connect to your account team.

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 guidelines, wiki.whenparked.com see Set up approvals to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, avoid hazardous material, and assess models against key safety requirements. You can carry out safety steps for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to use guardrails to assess user inputs and design responses deployed 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 create the guardrail, wiki.snooze-hotelsoftware.de see the GitHub repo.

The basic circulation 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 to the design for inference. After getting the model's output, another guardrail check is applied. If the output passes this final check, it's returned as the 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 took place at the input or output stage. The examples showcased in the following sections show inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers 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 actions:

1. On the Amazon Bedrock console, pick Model brochure under Foundation designs in the navigation pane. At the time of writing this post, you can use the InvokeModel API to invoke the design. 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 design detail page offers essential details about the design's capabilities, pricing structure, and application standards. You can find detailed use instructions, including sample API calls and code snippets for combination. The design supports different text generation tasks, consisting of content creation, code generation, and concern answering, using its reinforcement learning optimization and CoT reasoning capabilities. The page likewise consists of implementation options and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To start using DeepSeek-R1, choose Deploy.

You will be triggered to configure the implementation details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of instances, get in a variety of circumstances (in between 1-100). 6. For example type, choose your instance type. For optimum performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can configure sophisticated security and facilities settings, including virtual private cloud (VPC) networking, service function consents, and file 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 design.

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 change design specifications like temperature level and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimum outcomes. For example, material for reasoning.

This is an exceptional way to check out the design's thinking and text generation abilities before integrating it into your applications. The playground provides immediate feedback, helping you comprehend how the model reacts to different inputs and letting you fine-tune your prompts for optimum outcomes.

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

Run reasoning utilizing guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to carry out inference using a deployed DeepSeek-R1 model through Amazon Bedrock using 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 created the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime client, trademarketclassifieds.com configures inference parameters, and sends a demand to produce 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 few 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 uses 2 hassle-free techniques: utilizing the instinctive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both techniques to help you pick the technique that best 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, choose Studio in the navigation pane. 2. First-time users will be triggered to develop a domain. 3. On the SageMaker Studio console, select JumpStart in the navigation pane.

The model internet browser displays available designs, with details like the supplier name and model abilities.

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

- Model name

  • Provider name
  • Task classification (for instance, Text Generation). Bedrock Ready badge (if appropriate), showing that this design can be signed up with Amazon Bedrock, allowing you to use Amazon Bedrock APIs to conjure up the design

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

    The model details page consists of the following details:

    - The design name and supplier details. Deploy button to release the design. About and wiki.myamens.com Notebooks tabs with detailed details

    The About tab consists of crucial details, such as:

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

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

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, use the immediately generated name or create a customized one.
  1. For Instance type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the number of circumstances (default: 1). Selecting suitable circumstances 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 selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for precision. For this model, we strongly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to release the design.

    The implementation procedure can take numerous minutes to complete.

    When deployment is complete, your endpoint status will alter to InService. At this point, the model is all set to accept reasoning requests through the endpoint. You can monitor the release development on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the deployment is complete, 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 begin 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 consents and environment setup. The following is a detailed code example that shows 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 notebook and range 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 utilize 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 revealed in the following code:

    Clean up

    To avoid unwanted charges, finish the steps in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace implementation

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace implementations.
  5. In the Managed implementations area, 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 erasing the appropriate deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you released will sustain costs if you leave it running. Use the following code to erase 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 deploy 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 models, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting begun 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 build ingenious services utilizing AWS services and sped up calculate. Currently, he is concentrated on establishing strategies for fine-tuning and enhancing the inference performance of large language models. In his downtime, Vivek enjoys treking, watching movies, and attempting different 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 technology and Bioinformatics.

    Jonathan Evans is an Expert Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about building solutions that assist consumers accelerate their AI journey and unlock service value.