1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
lovie81o503315 edited this page 3 weeks ago


Today, we are thrilled to reveal 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 design, DeepSeek-R1, together with the distilled versions ranging from 1.5 to 70 billion specifications to develop, experiment, and properly 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 deploy the distilled versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that uses support discovering to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A crucial differentiating feature is its reinforcement learning (RL) action, which was utilized to improve the design’s responses beyond the standard pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adjust more successfully to user feedback and objectives, eventually boosting both relevance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) technique, suggesting it’s equipped to break down complex queries and reason through them in a detailed manner. This guided thinking process permits the design to produce more accurate, transparent, and detailed answers. This model integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured responses while focusing on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has actually recorded the market’s attention as a flexible text-generation design that can be integrated into various workflows such as representatives, logical reasoning and data interpretation jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion specifications, allowing effective reasoning by routing questions to the most appropriate expert “clusters.” This technique enables the model to specialize in various issue domains while maintaining general efficiency. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking abilities of the main R1 design to more efficient architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a procedure of training smaller sized, more effective models to imitate the habits and thinking patterns of the bigger DeepSeek-R1 design, using it as a teacher design.

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 utilize Amazon Bedrock Guardrails to present safeguards, avoid damaging content, and evaluate designs 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 produce numerous guardrails tailored to various use cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, 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, choose Amazon SageMaker, and confirm you’re using ml.p5e.48 xlarge for endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are releasing. To ask for a limitation boost, create a limit boost request and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, avoid harmful content, and assess models against key security criteria. You can implement precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to assess user inputs and design reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create 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 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 inference. After receiving the design’s output, another guardrail check is applied. If the output passes this last check, it’s returned as the outcome. However, if either the input or output is intervened by the guardrail, a message is returned indicating the nature of the intervention and whether it took place at the input or output phase. The examples showcased in the following areas 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, choose Model catalog under Foundation models in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to invoke the model. It does not 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 supplies vital details about the design’s capabilities, prices structure, and application guidelines. You can find detailed use guidelines, consisting of sample API calls and code snippets for combination. The design supports various text generation tasks, consisting of content production, code generation, and question answering, using its support discovering optimization and CoT thinking capabilities. The page likewise consists of release options and licensing details to help you start with DeepSeek-R1 in your applications.
  2. To begin using DeepSeek-R1, select Deploy.

    You will be triggered to configure the implementation details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters).
  4. For Number of instances, enter a variety of instances (in between 1-100).
  5. For Instance type, select your instance type. For optimum efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and facilities settings, consisting of virtual personal cloud (VPC) networking, service function consents, and encryption settings. For a lot of utilize cases, the default settings will work well. However, for production deployments, you might wish to evaluate these settings to align with your company’s security and compliance requirements.
  6. Choose Deploy to begin utilizing the model.

    When the implementation is total, you can check DeepSeek-R1’s abilities straight in the Amazon Bedrock play area.
  7. Choose Open in play area to access an interactive interface where you can try out various prompts and change model parameters like temperature and optimum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat template for optimum outcomes. For example, material for inference.

    This is an exceptional way to check out the model’s reasoning and text generation capabilities before integrating it into your applications. The playground offers instant feedback, assisting you understand how the model responds to various inputs and letting you tweak your prompts for optimum outcomes.

    You can quickly test the model in the play ground 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 deployed DeepSeek-R1 endpoint

    The following code example shows how to carry out reasoning utilizing a released DeepSeek-R1 design through Amazon Bedrock utilizing the invokemodel and ApplyGuardrail API. You can create a guardrail utilizing 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, utilize the following code to carry out guardrails. The script initializes the bedrockruntime customer, sets up inference specifications, and sends a request to produce text based on a user timely.

    Deploy DeepSeek-R1 with SageMaker JumpStart

    SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in algorithms, and prebuilt ML solutions that you can deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and deploy them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart uses two convenient methods: utilizing the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let’s check out both techniques to help you pick the technique 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 prompted to create a domain.
  9. 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 design capabilities.

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

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

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

    The model details page consists of the following details:

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

    The About tab includes important details, such as:

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

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

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, utilize the instantly produced name or develop a custom-made one.
  15. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial circumstances count, go into the variety of instances (default: 1). Selecting suitable instance types and counts is important for expense and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time reasoning is chosen by default. This is enhanced for sustained traffic and low latency.
  17. Review all configurations for precision. For this design, we strongly suggest adhering 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 several minutes to finish.

    When release is total, your endpoint status will change to InService. At this moment, the model is ready to accept inference requests through the endpoint. You can keep an eye on the implementation progress on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the deployment is complete, you can invoke the model using a SageMaker runtime customer 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 set up 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 releasing the model is offered in the Github here. You can clone the note pad and run from SageMaker Studio.

    You can run extra demands against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail using the Amazon Bedrock console or the API, and implement it as displayed in the following code:

    Clean up

    To prevent unwanted charges, complete the actions in this area to clean up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you deployed the design utilizing Amazon Bedrock Marketplace, total the following actions:

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

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed will sustain costs if you leave it running. Use the following code to erase the endpoint if you desire to stop sustaining charges. For more details, wiki.dulovic.tech see Delete Endpoints and Resources.

    Conclusion

    In this post, we explored how you can access and release the DeepSeek-R1 design utilizing Bedrock Marketplace and SageMaker JumpStart. Visit in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained designs, 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 assists emerging generative AI business construct innovative services utilizing AWS services and accelerated compute. Currently, he is focused on developing techniques for fine-tuning and optimizing the inference efficiency of large language designs. In his leisure time, Vivek takes pleasure in hiking, viewing films, and attempting various foods.

    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 Science 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 item, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI center. She is passionate about developing solutions that help clients accelerate their AI journey and unlock business value.