DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
shiela82q37914 於 3 天之前 修改了此頁面


Today, we are excited 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, together with the distilled versions ranging from 1.5 to 70 billion parameters to develop, experiment, and responsibly scale your generative AI ideas on AWS.

In this post, we demonstrate how to get started with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to release 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 uses support learning to boost reasoning 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 utilized to fine-tune the design’s actions beyond the basic pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adapt more effectively to user feedback and goals, ultimately boosting both significance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, indicating it’s equipped to break down intricate questions and factor through them in a detailed way. This guided thinking process enables the model to produce more accurate, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT capabilities, aiming to produce structured actions while on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has caught the market’s attention as a flexible text-generation design that can be incorporated into different workflows such as agents, rational reasoning and data analysis tasks.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion parameters, making it possible for efficient reasoning by routing questions to the most relevant expert “clusters.” This technique permits the model to specialize in different problem domains while maintaining general performance. DeepSeek-R1 requires at least 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 features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning abilities of the main R1 model to more effective architectures based upon 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 imitate the habits and thinking patterns of the bigger DeepSeek-R1 design, utilizing it as a teacher model.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise deploying this model with guardrails in place. In this blog, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent hazardous content, and assess designs against crucial security requirements. At the time of writing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop numerous guardrails tailored to various use cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you need access to an ml.p5e circumstances. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, choose 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 circumstances in the AWS Region you are deploying. To request a limit boost, develop a limitation boost request and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent harmful material, and gratisafhalen.be examine models against key safety criteria. You can carry out precaution for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to evaluate user inputs and design actions 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 develop 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 getting the model’s output, another guardrail check is applied. If the output passes this last check, it’s returned as the result. 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 took place at the input or output phase. The examples showcased in the following sections demonstrate reasoning 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, complete the following steps:

1. On the Amazon Bedrock console, choose Model brochure under Foundation designs in the navigation pane. At the time of composing this post, you can use the InvokeModel API to conjure up the model. It does not support Converse APIs and other Amazon Bedrock tooling.

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

    The design detail page provides vital details about the design’s capabilities, prices structure, and execution guidelines. You can find detailed usage directions, consisting of sample API calls and code bits for combination. The model supports various text generation jobs, including content production, code generation, and question answering, using its support learning optimization and CoT reasoning abilities. The page also includes implementation alternatives and licensing details to help you begin with DeepSeek-R1 in your applications.
  2. To begin utilizing DeepSeek-R1, select Deploy.

    You will be prompted to configure the deployment details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters).
  4. For Variety of circumstances, go into a number of circumstances (in between 1-100).
  5. For example type, pick your instance type. For ideal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up sophisticated security and facilities 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 might desire to evaluate these settings to line up with your company’s security and compliance requirements.
  6. Choose Deploy to start using the model.

    When the deployment is total, you can test DeepSeek-R1’s capabilities straight in the Amazon Bedrock play ground.
  7. Choose Open in play area to access an interactive interface where you can experiment with various prompts and adjust design specifications like temperature and maximum length. When using R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat design template for optimum results. For instance, content for inference.

    This is an outstanding way to explore the design’s thinking and text generation abilities before incorporating it into your applications. The playground supplies instant feedback, assisting you understand how the design reacts to various inputs and letting you fine-tune your triggers for optimum outcomes.

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

    Run reasoning using guardrails with the deployed DeepSeek-R1 endpoint

    The following code example shows how to perform inference utilizing a released DeepSeek-R1 design 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 create the guardrail, see the GitHub repo. After you have produced the guardrail, use the following code to carry out guardrails. The script initializes the bedrock_runtime customer, configures reasoning specifications, and sends out a demand to create text based upon a user timely.

    Deploy DeepSeek-R1 with SageMaker JumpStart

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

    Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 practical methods: using the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let’s check out both techniques to help you pick the technique that best suits 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, pick JumpStart in the navigation pane.

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

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

    - Model name
  10. Provider name
  11. Task category (for example, Text Generation). Bedrock Ready badge (if applicable), suggesting that this model can be signed up with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to invoke the model

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

    The design details page includes the following details:

    - The design name and company details. Deploy button to release the design. 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 design, it’s suggested to examine the model details and license terms to validate compatibility with your usage case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, use the instantly generated name or produce a custom one.
  15. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  16. For Initial circumstances count, go into the number of instances (default: 1). Selecting suitable circumstances types and counts is crucial for cost and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time inference is picked 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 deployment procedure can take several minutes to complete.

    When release is total, your endpoint status will change to InService. At this point, the design is ready to accept reasoning demands through the endpoint. You can keep track of the deployment development on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the release is complete, you can invoke the design using a SageMaker runtime client 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 set up the SageMaker Python SDK and make certain you have the necessary AWS authorizations and environment setup. The following is a detailed code example that shows how to release and use DeepSeek-R1 for inference programmatically. The code for deploying the design is supplied in the Github here. You can clone the notebook 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 likewise utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail utilizing the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Clean up

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

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace releases.
  19. In the Managed deployments section, locate the endpoint you desire to erase.
  20. Select the endpoint, and on the Actions menu, choose Delete.
  21. Verify the endpoint details to make certain you’re deleting the appropriate release: 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 desire to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we checked 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 begun. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained models, 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 helps emerging generative AI companies build ingenious options utilizing AWS services and sped up calculate. Currently, he is concentrated on establishing strategies for fine-tuning and enhancing the inference efficiency of big language models. In his spare time, Vivek delights in hiking, viewing movies, and trying different cuisines.

    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 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 center. She is enthusiastic about building services that help clients accelerate their AI journey and unlock service worth.