1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Jackson Welsh edited this page 1 month ago


Today, we are delighted 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 release DeepSeek AI’s first-generation frontier design, DeepSeek-R1, in addition to the distilled variations varying from 1.5 to 70 billion specifications to construct, experiment, and properly scale your generative AI ideas on AWS.

In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled versions of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that uses reinforcement finding out to boost reasoning abilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential identifying feature is its support knowing (RL) step, which was used to refine the design’s reactions beyond the standard pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adjust more effectively to user feedback and objectives, ultimately boosting both significance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, indicating it’s geared up to break down complicated inquiries and factor through them in a detailed manner. This assisted reasoning procedure enables the design to produce more precise, transparent, and detailed responses. This design combines RL-based fine-tuning with CoT abilities, aiming to create structured responses while focusing on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has captured the market’s attention as a flexible text-generation model that can be incorporated into different workflows such as representatives, sensible thinking and information analysis tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture allows activation of 37 billion criteria, allowing effective reasoning by routing questions to the most pertinent specialist “clusters.” This method permits the design to concentrate on different 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 features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking capabilities 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, more effective designs to imitate the behavior and thinking patterns of the bigger DeepSeek-R1 model, 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 deploying 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 key security requirements. At the time of composing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop multiple guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, you need access to an ml.p5e instance. To inspect 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 circumstances in the AWS Region you are releasing. To ask for a limitation boost, produce a limitation boost request and reach out to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, avoid harmful content, and evaluate models against safety requirements. You can execute precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and model responses released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail using the Amazon Bedrock console or wiki.dulovic.tech 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 to the design for inference. After getting the design’s output, another guardrail check is used. If the output passes this final check, it’s returned as the last 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 occurred at the input or output phase. The examples showcased in the following sections show inference utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized foundation models (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 utilize the InvokeModel API to invoke the design. It does not support Converse APIs and other Amazon Bedrock tooling.

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

    The model detail page offers essential details about the design’s capabilities, engel-und-waisen.de pricing structure, and execution guidelines. You can discover detailed usage guidelines, consisting of sample API calls and code bits for combination. The design supports various text generation jobs, including content production, code generation, and concern answering, using its support finding out optimization and CoT thinking abilities. The page likewise consists of deployment options and licensing details to help you get begun with DeepSeek-R1 in your applications.
  2. To start utilizing DeepSeek-R1, choose Deploy.

    You will be prompted to set up the implementation details for DeepSeek-R1. The design ID will be pre-populated.
  3. For bytes-the-dust.com Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters).
  4. For Number of circumstances, go into a number of instances (between 1-100).
  5. For Instance type, pick your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is recommended. Optionally, you can configure innovative security and facilities settings, including virtual personal cloud (VPC) networking, service function permissions, and encryption settings. For a lot of utilize cases, the default settings will work well. However, for production releases, you might want to examine these settings to align with your organization’s security and compliance requirements.
  6. Choose Deploy to begin using the design.

    When the release is total, you can check DeepSeek-R1’s capabilities straight in the Amazon Bedrock play area.
  7. Choose Open in play ground to access an interactive user interface where you can explore various prompts and adjust model specifications like temperature and maximum length. When using R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat template for optimal outcomes. For example, material for reasoning.

    This is an outstanding way to explore the design’s thinking and text generation capabilities before integrating it into your applications. The playground offers immediate feedback, helping you comprehend how the model reacts to numerous inputs and letting you fine-tune your prompts for optimal results.

    You can rapidly check the model in the playground through the UI. However, to conjure up the released model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

    Run inference using guardrails with the deployed DeepSeek-R1 endpoint

    The following code example shows how to carry out reasoning utilizing a deployed DeepSeek-R1 design 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 carry out guardrails. The script initializes the bedrock_runtime customer, configures inference specifications, and sends a request to produce text based upon 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 deploy 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 utilizing either the UI or SDK.

    Deploying DeepSeek-R1 design through SageMaker JumpStart offers two hassle-free techniques: utilizing the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let’s check out both approaches to help you select the method that best fits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

    1. On the SageMaker console, choose 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 design browser shows available designs, with details like the provider name and model capabilities.

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

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

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

    The model details page consists of the following details:

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

    The About tab includes important details, such as:

    - Model description.
  12. License details.
  13. Technical requirements. - Usage guidelines

    Before you deploy 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 deployment.

    7. For Endpoint name, use the automatically created name or develop a custom-made one.
  14. For Instance type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  15. For Initial instance count, enter the variety of instances (default: 1). Selecting appropriate circumstances types and counts is crucial for cost and performance optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is optimized for sustained traffic and low latency.
  16. Review all setups for precision. For this model, we highly advise sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  17. Choose Deploy to deploy the model.

    The implementation procedure can take a number of minutes to complete.

    When deployment is total, gratisafhalen.be your endpoint status will alter to InService. At this moment, the design is prepared to accept inference demands through the endpoint. You can keep track of the deployment development on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the release is total, you can conjure up the model using a SageMaker runtime customer and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To begin with DeepSeek-R1 using the SageMaker Python SDK, gratisafhalen.be you will require to install the SageMaker Python SDK and make certain you have the required AWS approvals 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 releasing the design is offered 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 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 actions in this area to clean 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 designs in the navigation pane, choose Marketplace implementations.
  18. In the Managed implementations area, find the endpoint you wish to delete.
  19. Select the endpoint, and on the Actions menu, choose Delete.
  20. Verify the endpoint details to make certain you’re erasing the correct implementation: 1. Endpoint name.
  21. Model name.
  22. 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 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 release the DeepSeek-R1 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to begin. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, 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 solutions utilizing AWS services and accelerated calculate. Currently, he is concentrated on establishing strategies for fine-tuning and enhancing the inference performance of large language models. In his complimentary time, bytes-the-dust.com Vivek delights in treking, watching motion pictures, and trying various foods.

    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 technology and Bioinformatics.

    Jonathan Evans is an Expert Solutions Architect working on generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads product, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI center. She is enthusiastic about developing options that help clients accelerate their AI journey and unlock organization worth.
上海开阖软件有限公司 沪ICP备12045867号-1