DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Amelie Galway editó esta página hace 3 meses


Today, we are excited to announce 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 model, DeepSeek-R1, in addition to the distilled variations ranging from 1.5 to 70 billion parameters to construct, experiment, and properly scale your generative AI ideas on AWS.

In this post, we demonstrate how to begin 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 large language model (LLM) established by DeepSeek AI that uses reinforcement discovering to improve reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A key distinguishing feature is its reinforcement learning (RL) action, which was used to refine the design’s actions beyond the basic pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adjust better to user feedback and goals, ultimately improving both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, suggesting it’s equipped to break down complicated inquiries and reason through them in a detailed way. This procedure enables the design to produce more precise, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT capabilities, aiming to generate structured actions while focusing on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has caught the industry’s attention as a versatile text-generation model that can be integrated into various workflows such as agents, logical thinking and data analysis jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture allows activation of 37 billion criteria, enabling effective reasoning by routing queries to the most relevant professional “clusters.” This technique permits the model to specialize in various issue domains while maintaining total performance. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge circumstances to deploy the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning abilities 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 describes a process of training smaller, more efficient designs to simulate the habits and reasoning patterns of the bigger DeepSeek-R1 design, utilizing it as an instructor model.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise releasing this model with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, avoid harmful content, and assess designs against essential safety criteria. At the time of composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can create several guardrails tailored to different usage cases and apply them to the DeepSeek-R1 model, improving user experiences and raovatonline.org standardizing safety 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 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 request a limit increase, create a limitation increase demand and reach out to your account group.

Because you will be deploying this model with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) permissions to utilize Amazon Bedrock Guardrails. For instructions, larsaluarna.se see Establish approvals to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, prevent harmful content, and yewiki.org evaluate designs against crucial security criteria. You can execute precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to evaluate user inputs and design actions 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 develop the guardrail, see the GitHub repo.

The basic circulation 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 getting the model’s output, another guardrail check is applied. If the output passes this last check, it’s returned as the last result. However, if either the input or output is stepped in 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 gives you access to over 100 popular, emerging, and specialized structure models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following steps:

1. On the Amazon Bedrock console, select Model brochure under Foundation models in the navigation pane. At the time of composing 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 provider and select the DeepSeek-R1 design.

    The design detail page provides necessary details about the design’s capabilities, rates structure, and execution guidelines. You can discover detailed usage directions, including sample API calls and code snippets for combination. The model supports numerous text generation jobs, consisting of material creation, code generation, and concern answering, utilizing its support learning optimization and CoT thinking abilities. The page also 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 configure the deployment details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters).
  4. For Number of circumstances, get in a variety of instances (between 1-100).
  5. For Instance type, select your instance 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, including virtual private cloud (VPC) networking, service role authorizations, larsaluarna.se and encryption settings. For the majority of use cases, the default settings will work well. However, for production releases, you might desire to evaluate these settings to align with your company’s security and compliance requirements.
  6. Choose Deploy to start utilizing the design.

    When the implementation is total, you can check DeepSeek-R1’s abilities straight in the Amazon Bedrock playground.
  7. Choose Open in play area to access an interactive user interface where you can try out different prompts and adjust design specifications like temperature level and maximum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat template for optimum outcomes. For instance, material for inference.

    This is an outstanding way to explore the design’s reasoning and text generation capabilities before integrating it into your applications. The play area supplies immediate feedback, assisting you comprehend how the model reacts to various inputs and letting you fine-tune your triggers for ideal results.

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

    Run inference using guardrails with the released DeepSeek-R1 endpoint

    The following code example shows how to perform reasoning utilizing a deployed DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can produce a guardrail utilizing the Amazon Bedrock console or archmageriseswiki.com 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 execute guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, and sends a demand to produce 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 just a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and deploy them into production using either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart uses two convenient techniques: using the instinctive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s explore both approaches to assist you choose the technique that best matches your needs.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

    The design browser displays available designs, with details like the service provider name and design capabilities.

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

    - Model name
  10. Provider name
  11. Task category (for instance, Text Generation). Bedrock Ready badge (if relevant), showing that this model can be signed up with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to conjure up the model

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

    The model details page includes the following details:

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

    The About tab includes essential details, such as:

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

    Before you deploy the model, it’s recommended to examine the model details and license terms to validate compatibility with your usage case.

    6. Choose Deploy to continue with release.

    7. For Endpoint name, utilize the immediately generated name or produce a custom one.
  15. For forum.pinoo.com.tr Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, pipewiki.org enter the number of instances (default: 1). Selecting appropriate instance types and counts is important for cost and efficiency optimization. Monitor your release to change these settings as needed.Under Inference type, Real-time reasoning is chosen by default. This is optimized for sustained traffic and low latency.
  17. Review all setups for accuracy. For this model, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  18. Choose Deploy to release the model.

    The release process can take numerous minutes to complete.

    When release is complete, your endpoint status will alter to InService. At this point, the model is ready to accept inference requests through the endpoint. You can keep an eye on the release development on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the deployment is total, you can conjure up the design utilizing a SageMaker runtime customer and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require 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 shows how to release and use DeepSeek-R1 for reasoning programmatically. The code for releasing the design is offered in the Github here. You can clone the note pad and run 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 also use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail utilizing the Amazon Bedrock console or the API, and implement it as shown in the following code:

    Tidy up

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

    Delete the Amazon Bedrock Marketplace deployment

    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.
  19. In the Managed implementations area, locate the endpoint you wish to erase.
  20. Select the endpoint, and on the Actions menu, pick Delete.
  21. Verify the endpoint details to make certain you’re erasing the correct deployment: 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 explored 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 start. 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 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 companies develop ingenious services utilizing AWS services and accelerated compute. Currently, he is concentrated on developing techniques for fine-tuning and enhancing the reasoning performance of large language models. In his leisure time, Vivek delights in hiking, enjoying films, and trying 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 group at AWS.

    Banu Nagasundaram leads product, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is passionate about building solutions that assist consumers accelerate their AI journey and unlock business value.