1 DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
njocortez12984 edited this page 2025-04-08 12:43:21 +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 excited to reveal that DeepSeek R1 distilled Llama and Qwen designs are available through Amazon Bedrock Marketplace and Amazon SageMaker JumpStart. With this launch, you can now deploy DeepSeek AI's first-generation frontier design, DeepSeek-R1, along with the distilled variations ranging from 1.5 to 70 billion parameters to develop, experiment, and properly scale your generative AI concepts on AWS.

In this post, we demonstrate how to get begun 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 large language design (LLM) established by DeepSeek AI that uses support discovering to enhance reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A crucial distinguishing function is its support learning (RL) action, which was used to refine the model's actions beyond the standard pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adjust better to user feedback and objectives, ultimately boosting both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) approach, suggesting it's equipped to break down complex inquiries and factor through them in a detailed way. This assisted reasoning process permits the model to produce more precise, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to create structured responses while concentrating on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has caught the market's attention as a versatile text-generation design that can be incorporated into different 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 parameters, allowing efficient reasoning by routing questions to the most relevant professional "clusters." This approach enables the model to specialize in different problem domains while maintaining overall efficiency. 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 model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking capabilities of the main R1 model 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, more effective designs to mimic the behavior and reasoning patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor model.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise deploying this model with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to present safeguards, avoid damaging content, and examine models against crucial safety criteria. At the time of writing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create several guardrails tailored to various use cases and apply them to the DeepSeek-R1 design, improving user experiences and standardizing safety 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, pick Amazon SageMaker, and verify you're using 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 request a limitation boost, produce a limitation increase demand and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid harmful content, and examine designs against crucial security criteria. You can implement security steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to evaluate user inputs and design actions released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.

The general circulation includes 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 reasoning. After getting the design's output, another guardrail check is used. If the output passes this last check, it's returned as the 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 stage. The examples showcased in the following sections demonstrate reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, pediascape.science 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 brochure under Foundation models in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to conjure up the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a supplier and pick the DeepSeek-R1 model.

The model detail page provides important details about the design's capabilities, prices structure, and execution standards. You can discover detailed usage guidelines, consisting of sample API calls and code snippets for integration. The design supports different text generation tasks, consisting of content creation, code generation, and question answering, using its reinforcement discovering optimization and CoT reasoning capabilities. The page likewise consists of deployment options and licensing details to assist you get going with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, pick Deploy.

You will be prompted to configure the deployment details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters). 5. For Variety of circumstances, enter a number of instances (in between 1-100). 6. For Instance type, choose your instance type. For ideal efficiency with DeepSeek-R1, forum.pinoo.com.tr a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can configure advanced security and infrastructure settings, consisting of virtual personal cloud (VPC) networking, service function authorizations, and file 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 company's security and compliance requirements. 7. Choose Deploy to begin using the model.

When the implementation is complete, you can check DeepSeek-R1's capabilities straight in the Amazon Bedrock play area. 8. Choose Open in play area to access an interactive user interface where you can experiment with various triggers and change model criteria like temperature level and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat template for optimum results. For instance, content for reasoning.

This is an outstanding way to explore the design's thinking and text generation capabilities before incorporating it into your applications. The playground provides instant feedback, helping you understand how the model reacts to numerous inputs and letting you fine-tune your prompts for ideal outcomes.

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

Run reasoning using guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to perform reasoning using a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can produce 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 actually created the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime customer, configures inference specifications, hb9lc.org and sends out a request to create 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 options that you can release with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your data, and release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses two practical techniques: utilizing the instinctive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you pick the method that finest suits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

1. On the SageMaker console, select 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 model browser displays available models, with details like the company name and model capabilities.

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

- Model name

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

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

    The design details page includes the following details:

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

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

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, use the instantly generated name or create a custom-made one.
  1. For example type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, wiki.dulovic.tech go into the variety of circumstances (default: 1). Selecting suitable circumstances types and counts is important for cost and efficiency optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time inference is chosen by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations for precision. For this model, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to deploy the model.

    The deployment process can take several minutes to finish.

    When implementation is total, your endpoint status will alter to InService. At this point, the model is ready to accept inference requests through the endpoint. You can keep track of the release progress on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the implementation is total, you can conjure up the design using a SageMaker runtime client and incorporate 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 install 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 deploy and utilize DeepSeek-R1 for inference 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 requests 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 using the Amazon Bedrock console or the API, and implement it as shown in the following code:

    Clean up

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

    Delete the Amazon Bedrock Marketplace deployment

    If you released the model utilizing Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace deployments.
  5. In the Managed releases 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 correct 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 delete 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 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 business construct innovative solutions utilizing AWS services and accelerated compute. Currently, he is concentrated on developing strategies for fine-tuning and enhancing the reasoning efficiency of large language models. In his downtime, Vivek enjoys hiking, seeing films, and trying various foods.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team at AWS. His location 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 team at AWS.

    Banu Nagasundaram leads item, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial and generative AI center. She is passionate about developing solutions that help customers accelerate their AI journey and unlock organization worth.