1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
arlenehoffnung 於 6 天之前 修改了此頁面


Today, we are delighted 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 release DeepSeek AI‘s first-generation frontier design, DeepSeek-R1, in addition to the distilled versions ranging from 1.5 to 70 billion criteria to construct, experiment, and responsibly 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 models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes support learning to improve reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial differentiating function is its support knowing (RL) action, which was used to improve the design’s reactions beyond the basic pre-training and fine-tuning procedure. By integrating RL, DeepSeek-R1 can adjust more effectively 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 equipped to break down complicated queries and factor through them in a detailed manner. This directed thinking procedure permits the model to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT abilities, aiming to produce structured actions while focusing on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has captured the market’s attention as a versatile text-generation design that can be integrated into numerous workflows such as agents, sensible reasoning and information interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion specifications, enabling effective reasoning by routing inquiries to the most appropriate expert “clusters.” This method permits the model to concentrate 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 use 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 abilities of the main R1 model to more effective 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 efficient designs to mimic the habits and reasoning patterns of the larger DeepSeek-R1 model, using it as a teacher model.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend deploying this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous material, and assess designs against crucial safety requirements. At the time of writing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop several guardrails tailored to different use cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you need access to an ml.p5e instance. To examine 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 instance in the AWS Region you are deploying. To ask for a limit increase, develop a limitation increase request and connect to your account group.

Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and higgledy-piggledy.xyz Gain Access To Management (IAM) permissions to utilize Amazon Bedrock Guardrails. For instructions, see Set up authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

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

The general flow involves 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 out to the model for inference. After receiving the model’s output, another guardrail check is applied. If the output passes this final check, it’s returned as the result. However, wiki.whenparked.com if either the input or output is intervened by the guardrail, a message is returned showing the nature of the intervention and whether it took place at the input or output stage. 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 foundation 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 catalog under Foundation designs 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 choose the DeepSeek-R1 model.

The model detail page offers necessary details about the model’s abilities, prices structure, and application standards. You can discover detailed usage instructions, including sample API calls and code snippets for integration. The design supports various text generation tasks, consisting of material creation, code generation, and question answering, utilizing its support learning optimization and CoT reasoning capabilities. The page also consists of release alternatives and licensing details to help you start with DeepSeek-R1 in your applications. 3. To start using DeepSeek-R1, select Deploy.

You will be triggered to configure the release details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of circumstances, go into a number of instances (between 1-100). 6. For example type, choose your instance type. For optimal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure advanced security and infrastructure settings, including virtual personal cloud (VPC) networking, service role authorizations, and file encryption settings. For most utilize cases, the default settings will work well. However, for production deployments, you might desire to examine these settings to align with your company’s security and compliance requirements. 7. Choose Deploy to begin using the design.

When the release is total, you can evaluate DeepSeek-R1’s abilities 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 prompts and adjust model criteria like temperature level and maximum length. When using R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat design template for optimal results. For example, material for inference.

This is an exceptional way to explore the model’s reasoning and text generation abilities before incorporating it into your applications. The play area provides instant feedback, helping you understand how the design reacts to numerous inputs and letting you fine-tune your triggers for optimum outcomes.

You can rapidly evaluate the design in the play ground through the UI. However, to invoke the released model 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 inference using a deployed DeepSeek-R1 model 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 created the guardrail, use the following code to carry out guardrails. The the bedrock_runtime client, configures reasoning criteria, and sends out a request to generate text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

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

Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 practical techniques: using the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let’s check out both methods to help you pick the technique that finest fits 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, 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 web browser shows available designs, with details like the provider name and model capabilities.

4. Look for DeepSeek-R1 to view the DeepSeek-R1 model card. Each design card reveals crucial details, including:

- Model name

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

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

    The design details page includes the following details:

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

    The About tab includes important details, such as:

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

    Before you release the model, it’s advised to evaluate the design details and license terms to validate compatibility with your use case.

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, use the automatically produced name or produce a customized one.
  1. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the variety of instances (default: 1). Selecting proper circumstances types and counts is essential for cost and performance optimization. Monitor your release to change these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all configurations for precision. For this design, we highly advise adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to deploy the design.

    The release process can take a number of minutes to complete.

    When deployment is total, your endpoint status will change to InService. At this moment, the design is prepared to accept reasoning requests 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 total, you can conjure up the design utilizing a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start 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 permissions and environment setup. The following is a detailed code example that demonstrates how to release and use DeepSeek-R1 for reasoning programmatically. The code for deploying the model is offered 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 reasoning with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail utilizing the Amazon Bedrock console or the API, and execute it as revealed in the following code:

    Tidy up

    To prevent unwanted charges, finish the steps in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace release

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace releases.
  5. In the Managed implementations area, find the endpoint you wish to delete.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you’re deleting the proper release: 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 wish 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 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. 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 assists emerging generative AI business construct innovative services using AWS services and accelerated calculate. Currently, he is concentrated on establishing techniques for fine-tuning and optimizing the reasoning efficiency of big language designs. In his downtime, Vivek takes pleasure in treking, enjoying movies, and attempting 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 technology 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 product, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is enthusiastic about developing solutions that help consumers accelerate their AI journey and unlock service value.