1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
klaragonzalez9 редактировал эту страницу 3 месяцев назад


Today, we are thrilled to reveal 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 design, DeepSeek-R1, in addition to the distilled variations varying from 1.5 to 70 billion criteria to build, experiment, and properly scale your generative AI ideas on AWS.

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

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that utilizes support finding out to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential distinguishing feature is its reinforcement knowing (RL) step, which was used to refine the model’s actions beyond the basic pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adapt more efficiently to user feedback and goals, ultimately improving both importance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, indicating it’s equipped to break down complicated questions and factor through them in a detailed way. This directed thinking procedure allows the design to produce more precise, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT capabilities, aiming to generate structured responses while concentrating on interpretability and wiki.snooze-hotelsoftware.de user interaction. With its extensive capabilities DeepSeek-R1 has recorded the industry’s attention as a versatile text-generation model that can be integrated into numerous workflows such as representatives, sensible thinking and data analysis jobs.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion criteria, making it possible for efficient inference by routing questions to the most pertinent specialist “clusters.” This method permits the model to focus on various issue domains while maintaining overall effectiveness. DeepSeek-R1 requires a minimum of 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 model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking capabilities of the main R1 model 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 procedure of training smaller, more efficient models to mimic the habits and thinking patterns of the bigger DeepSeek-R1 model, using 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, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent hazardous material, and assess models against crucial safety criteria. At the time of writing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create multiple guardrails tailored to different use cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, wiki.snooze-hotelsoftware.de you need access to an ml.p5e circumstances. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, select 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 limit increase request and reach out to your account team.

Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For directions, see Set up permissions to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid damaging content, and evaluate designs against crucial safety requirements. You can implement precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to assess user inputs and design reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.

The general flow includes the following steps: 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 getting the model’s output, another guardrail check is applied. If the output passes this final 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 took place at the input or output stage. The examples showcased in the following sections show reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized foundation designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following actions:

1. On the Amazon Bedrock console, pick Model catalog under Foundation designs in the navigation pane. At the time of writing this post, you can utilize the InvokeModel API to invoke the design. It doesn’t support Converse APIs and other Amazon Bedrock tooling.

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

    The model detail page offers essential details about the design’s capabilities, prices structure, and execution standards. You can discover detailed use instructions, consisting of sample API calls and code snippets for integration. The design supports various text generation jobs, including material production, code generation, and concern answering, using its support finding out optimization and CoT reasoning abilities. The page likewise includes implementation options and licensing details to help you get started with DeepSeek-R1 in your applications.
  2. To begin utilizing DeepSeek-R1, choose Deploy.

    You will be triggered to configure the release details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters).
  4. For Variety of circumstances, go into a number of instances (in between 1-100).
  5. For example type, pick your instance type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can set up advanced security and infrastructure settings, consisting of virtual personal cloud (VPC) networking, service function approvals, and encryption settings. For most utilize cases, the default settings will work well. However, for production deployments, you may wish to examine these settings to line up with your company’s security and compliance requirements.
  6. Choose Deploy to start using the design.

    When the implementation is complete, you can test DeepSeek-R1’s capabilities straight in the Amazon Bedrock play area.
  7. Choose Open in playground to access an interactive user interface where you can explore various prompts and adjust model criteria like temperature and maximum length. When using R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat design template for optimum outcomes. For instance, content for reasoning.

    This is an exceptional method to check out the model’s reasoning and text generation abilities before incorporating it into your applications. The playground offers instant feedback, assisting you understand how the design reacts to different inputs and letting you fine-tune your prompts for optimum results.

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

    Run inference using guardrails with the released DeepSeek-R1 endpoint

    The following code example demonstrates how to perform reasoning utilizing a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo. After you have actually produced the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime customer, configures reasoning criteria, and larsaluarna.se sends out a request to create 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 services that you can deploy with just 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 utilizing either the UI or SDK.

    Deploying DeepSeek-R1 design through SageMaker JumpStart provides two practical approaches: using the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let’s check out both techniques to assist you select the method that finest matches 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, pick Studio in the navigation pane.
  8. First-time users will be prompted to produce a domain.
  9. On the SageMaker Studio console, select JumpStart in the navigation pane.

    The model browser displays available models, with details like the provider name and model abilities.

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

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

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

    The design details page includes the following details:

    - The design name and company details. Deploy button to deploy the design. 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 advised to examine the design details and license terms to verify compatibility with your use case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, use the instantly generated name or produce a customized one.
  15. For example type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, go into the number of circumstances (default: 1). Selecting suitable instance types and counts is vital for expense and efficiency optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is optimized for sustained traffic and low latency.
  17. Review all configurations for precision. For this design, we strongly suggest sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  18. Choose Deploy to deploy the model.

    The implementation process can take a number of minutes to finish.

    When deployment is complete, your endpoint status will change to InService. At this point, the model is ready to accept inference demands through the endpoint. You can monitor the implementation progress on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the implementation is total, you can invoke the design using a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get going with DeepSeek-R1 using the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the necessary 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 extra requests against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail using the Amazon Bedrock console or the API, and execute it as displayed 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 deployed the design utilizing Amazon Bedrock Marketplace, complete the following steps:

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

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you released will sustain expenses 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 out how you can access and release 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 designs, SageMaker JumpStart pretrained designs, 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 business construct ingenious services using AWS services and sped up calculate. Currently, he is focused on developing strategies for fine-tuning and enhancing the inference efficiency of large language designs. In his downtime, Vivek takes pleasure in hiking, viewing motion pictures, and attempting different cuisines.

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

    Banu Nagasundaram leads product, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI center. She is enthusiastic about developing services that assist customers accelerate their AI journey and unlock business value.