1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
malindagamble2 heeft deze pagina aangepast 4 maanden geleden


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, along with the distilled variations varying from 1.5 to 70 billion specifications to construct, experiment, and responsibly scale your generative AI ideas on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that utilizes reinforcement learning to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential identifying feature is its reinforcement learning (RL) action, which was used to refine the design’s responses beyond the standard pre-training and fine-tuning process. By incorporating RL, DeepSeek-R1 can adapt better to user feedback and goals, ultimately boosting both importance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, suggesting it’s equipped to break down complex questions and factor through them in a detailed way. This directed reasoning procedure enables the model to produce more accurate, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured actions while focusing on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has captured the market’s attention as a versatile text-generation model that can be integrated into various workflows such as representatives, sensible reasoning and data interpretation tasks.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion criteria, making it possible for effective inference by routing queries to the most appropriate professional “clusters.” This technique allows the model to specialize in various 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 use an ml.p5e.48 xlarge circumstances to deploy the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning abilities of the main R1 design to more efficient 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 imitate the habits and reasoning patterns of the larger DeepSeek-R1 model, utilizing it as an instructor design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend releasing this design with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent harmful content, and evaluate designs against essential safety requirements. At the time of writing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create several guardrails tailored to different use cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you require access to an ml.p5e instance. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and confirm 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 limitation increase, produce a limitation increase request and reach out to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent hazardous material, and evaluate models against crucial safety criteria. You can carry out precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This enables 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 basic flow involves the following actions: First, the system gets 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 applied. If the output passes this final check, it’s returned as the final outcome. 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 took place at the input or output stage. 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 designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:

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 use the InvokeModel API to conjure up the model. It doesn’t support Converse APIs and other Amazon Bedrock tooling.

  1. Filter for DeepSeek as a provider and pick the DeepSeek-R1 design.

    The model detail page supplies essential details about the design’s capabilities, pricing structure, and application guidelines. You can discover detailed usage instructions, consisting of sample API calls and code snippets for integration. The model supports numerous text generation jobs, consisting of content development, code generation, and concern answering, utilizing its support finding out optimization and CoT reasoning capabilities. The page also includes deployment choices and licensing details to help you start with DeepSeek-R1 in your applications.
  2. To start utilizing DeepSeek-R1, choose Deploy.

    You will be prompted to configure the release details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, enter an endpoint name (in between 1-50 alphanumeric characters).
  4. For Number of instances, get in a variety of circumstances (in between 1-100).
  5. For example type, choose your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up advanced security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role permissions, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production deployments, you might want to evaluate these settings to line up with your company’s security and compliance requirements.
  6. Choose Deploy to start utilizing the design.

    When the release is complete, you can test DeepSeek-R1’s capabilities straight in the Amazon Bedrock playground.
  7. Choose Open in play area to access an interactive user interface where you can experiment with different triggers and change design parameters like temperature and optimum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat design template for ideal outcomes. For instance, material for inference.

    This is an excellent method to check out the design’s reasoning and text generation abilities before incorporating it into your applications. The playground offers instant feedback, helping you understand how the design reacts to numerous inputs and letting you tweak your triggers for optimum outcomes.

    You can rapidly check the design in the playground 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 deployed DeepSeek-R1 endpoint

    The following code example demonstrates how to perform inference utilizing a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop 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 customer, sets up inference specifications, and sends out a demand to create text based upon a user prompt.

    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 deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your information, and deploy them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 design through SageMaker JumpStart provides 2 hassle-free methods: using the intuitive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s explore both methods to assist you pick the approach that best fits your needs.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

    The model internet browser shows available designs, with details like the company name and design capabilities.

    4. Look for DeepSeek-R1 to view the DeepSeek-R1 design card. Each model card reveals essential details, consisting of:

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

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

    The design details page consists of the following details:

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

    The About tab consists of essential details, such as:

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

    Before you deploy the design, it’s suggested to evaluate the model details and license terms to verify compatibility with your use case.

    6. Choose Deploy to proceed with deployment.

    7. For Endpoint name, use the immediately created name or create a customized one.
  15. For Instance type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, go into the variety of circumstances (default: 1). Selecting appropriate circumstances types and counts is essential for expense and performance optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time inference is chosen by default. This is enhanced for sustained traffic and low .
  17. Review all setups for accuracy. For this design, we highly suggest adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  18. Choose Deploy to deploy the model.

    The release process can take several minutes to complete.

    When release is complete, your endpoint status will alter to InService. At this point, the model is all set to accept inference requests through the endpoint. You can monitor the implementation progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the implementation is total, you can conjure up the model using a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the required AWS consents 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 deploying the model is supplied 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 inference 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 utilizing the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Clean up

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

    Delete the Amazon Bedrock Marketplace implementation

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace implementations.
  19. In the Managed releases section, locate the endpoint you want to delete.
  20. Select the endpoint, and on the Actions menu, choose Delete.
  21. Verify the endpoint details to make certain you’re erasing the correct implementation: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you released will sustain costs if you leave it running. Use the following code to erase 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 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 Beginning 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 develop ingenious options using AWS services and sped up calculate. Currently, he is focused on establishing strategies for fine-tuning and optimizing the inference efficiency of large language models. In his spare time, Vivek delights in hiking, enjoying films, and attempting various foods.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group 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 an Expert Solutions Architect working on generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads product, engineering, setiathome.berkeley.edu and tactical partnerships for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is passionate about building options that assist clients accelerate their AI journey and unlock business worth.