DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
yaniragooch739 editou esta página 2 meses atrás


Today, we are thrilled 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 deploy DeepSeek AI’s first-generation frontier model, DeepSeek-R1, in addition to the distilled versions ranging from 1.5 to 70 billion criteria to build, experiment, and responsibly 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 comparable actions to release the distilled versions of the designs also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that uses reinforcement discovering to enhance reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base foundation. An essential distinguishing function is its reinforcement learning (RL) action, which was used to improve the model’s responses beyond the basic pre-training and tweak process. By integrating RL, DeepSeek-R1 can adjust better to user feedback and objectives, eventually enhancing both significance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, implying it’s equipped to break down complex queries and factor through them in a detailed manner. This guided thinking procedure enables the model to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT abilities, aiming to produce structured reactions while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has caught the industry’s attention as a versatile text-generation model that can be incorporated into different workflows such as agents, sensible thinking and information analysis jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture allows activation of 37 billion criteria, making it possible for effective inference by routing queries to the most relevant specialist “clusters.” This approach permits the model to specialize in different problem domains while maintaining total efficiency. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

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

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise releasing this design with guardrails in location. In this blog site, we will utilize Amazon Bedrock Guardrails to present safeguards, avoid harmful material, bytes-the-dust.com and assess designs against essential safety requirements. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create multiple guardrails tailored to various use cases and apply them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, you need access to an ml.p5e instance. To inspect if you have quotas for P5e, open the Service Quotas and under AWS Services, pick Amazon SageMaker, and confirm 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 increase, create a limitation increase demand and reach out to your account team.

Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) consents to use Amazon Bedrock Guardrails. For instructions, see Set up consents to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent harmful content, and evaluate designs against key security requirements. You can execute security measures for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and model responses 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 produce the guardrail, see the GitHub repo.

The basic flow includes the following steps: 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 design for reasoning. After receiving the design’s output, another guardrail check is applied. If the output passes this last check, it’s returned as the final 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 demonstrate inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized foundation models (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 composing this post, you can utilize the InvokeModel API to conjure up the design. It does not support Converse APIs and other Amazon Bedrock tooling.

  1. Filter for DeepSeek as a provider and choose the DeepSeek-R1 model.

    The design detail page offers essential details about the model’s capabilities, prices structure, and application guidelines. You can discover detailed usage guidelines, consisting of sample API calls and code bits for integration. The model supports numerous text generation jobs, including material creation, code generation, and concern answering, utilizing its support discovering optimization and CoT reasoning abilities. The page likewise includes deployment choices and licensing details to assist you start with DeepSeek-R1 in your applications.
  2. To begin utilizing DeepSeek-R1, choose Deploy.

    You will be prompted to set up the release details for DeepSeek-R1. The model ID will be pre-populated.
  3. For Endpoint name, go into an endpoint name (between 1-50 alphanumeric characters).
  4. For Number of circumstances, go into a variety of circumstances (in between 1-100).
  5. For example type, pick your instance type. For ideal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure innovative security and infrastructure settings, including virtual personal cloud (VPC) networking, service role authorizations, and encryption settings. For a lot of utilize cases, the default settings will work well. However, for production implementations, you might wish to evaluate these settings to line up with your company’s security and compliance requirements.
  6. Choose Deploy to start using the design.

    When the release is complete, you can test DeepSeek-R1’s abilities straight in the Amazon Bedrock play ground.
  7. Choose Open in playground to access an interactive interface where you can try out different triggers and adjust model specifications like temperature level and maximum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat template for optimal outcomes. For instance, material for reasoning.

    This is an outstanding way to check out the design’s reasoning and text generation abilities before integrating it into your applications. The play area provides instant feedback, assisting you comprehend how the design reacts to different inputs and letting you fine-tune your triggers for optimal results.

    You can quickly evaluate the model in the playground through the UI. However, to conjure up the deployed model programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

    Run inference utilizing guardrails with the released DeepSeek-R1 endpoint

    The following code example demonstrates how to carry out reasoning utilizing a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can create a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo. After you have actually developed the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures reasoning criteria, and sends out a demand to generate text based upon a user prompt.

    Deploy DeepSeek-R1 with SageMaker JumpStart

    SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML options 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 data, and release them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 design through SageMaker JumpStart uses two hassle-free methods: using the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let’s explore both methods to help you select the approach that best suits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

    The model web browser shows available designs, with details like the supplier name and model capabilities.

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

    - Model name
  10. Provider name
  11. Task category (for instance, Text Generation). Bedrock Ready badge (if appropriate), indicating that this model can be registered with Amazon Bedrock, allowing you to utilize Amazon Bedrock APIs to conjure up the design

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

    The model details page consists of the following details:

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

    The About tab consists of important details, such as:

    - Model description.
  12. License details.
  13. Technical specifications.
  14. Usage standards

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

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, use the immediately created name or create a customized one.
  15. For example type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, enter the number of instances (default: 1). Selecting proper circumstances types and counts is vital for cost and performance optimization. Monitor your release 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.
  17. Review all configurations for precision. For this model, we highly advise adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  18. Choose Deploy to release the model.

    The implementation process can take numerous minutes to complete.

    When deployment is total, your endpoint status will alter to InService. At this moment, the design is all set to accept reasoning demands through the endpoint. You can keep track of the release progress on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the release is total, you can invoke the model using a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get begun with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the necessary AWS permissions and environment setup. The following is a detailed code example that shows how to release and utilize DeepSeek-R1 for inference programmatically. The code for releasing the model is offered in the Github here. You can clone the note pad and run from SageMaker Studio.

    You can run extra 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 create 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, complete the actions in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you released the model using Amazon Bedrock Marketplace, total the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace implementations.
  19. In the Managed deployments area, locate the endpoint you want to delete.
  20. Select the endpoint, and on the Actions menu, pick Delete.
  21. Verify the endpoint details to make certain you’re deleting the proper release: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed 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 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get begun. 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 going 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 innovative options using AWS services and sped up compute. Currently, he is concentrated on establishing techniques for fine-tuning and enhancing the reasoning efficiency of big language designs. In his downtime, Vivek enjoys treking, seeing motion pictures, and attempting various 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 Science and Bioinformatics.

    Jonathan Evans is an Expert Solutions Architect dealing with 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 intelligence and generative AI center. She is passionate about constructing solutions that help consumers accelerate their AI journey and unlock company worth.