DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Adelaida Atencio upravil tuto stránku před 1 měsícem


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, along with the distilled versions varying from 1.5 to 70 billion parameters to develop, experiment, and responsibly scale your generative AI concepts on AWS.

In this post, we show how to get started with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that uses reinforcement finding out to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential distinguishing feature is its support learning (RL) step, which was used to improve the design’s actions beyond the basic pre-training and tweak procedure. By incorporating RL, DeepSeek-R1 can adjust more effectively to user feedback and goals, eventually boosting both importance and clarity. In addition, pipewiki.org DeepSeek-R1 uses a chain-of-thought (CoT) method, meaning it’s geared up to break down complicated questions and factor through them in a detailed way. This guided thinking process permits the design to produce more accurate, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT capabilities, aiming to produce structured reactions while concentrating on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has caught the industry’s attention as a flexible text-generation model that can be incorporated into different workflows such as agents, logical reasoning and data analysis tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, allowing efficient reasoning by routing questions to the most appropriate expert “clusters.” This technique allows the design to focus on various problem domains while maintaining total efficiency. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, bytes-the-dust.com we will utilize an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

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

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we recommend deploying this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, prevent hazardous material, and examine designs against key security criteria. At the time of writing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce several guardrails tailored to various use cases and apply them to the DeepSeek-R1 model, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you require 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 utilizing 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 deploying. To ask for a limit boost, develop a limit boost demand and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, avoid hazardous content, and evaluate designs against essential security requirements. You can implement safety measures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to assess user inputs and model responses released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo.

The basic flow involves the following steps: 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 to the model for inference. After getting the model’s output, another guardrail check is used. If the output passes this last 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 stage. The examples showcased in the following sections show inference utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers 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, pick 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 model. It does not support Converse APIs and other Amazon Bedrock tooling.

  1. Filter for DeepSeek as a company and choose the DeepSeek-R1 model.

    The model detail page supplies important details about the design’s abilities, prices structure, and implementation guidelines. You can discover detailed use instructions, including sample API calls and code bits for integration. The model supports numerous text generation tasks, consisting of material production, code generation, and question answering, using its support discovering optimization and CoT reasoning abilities. The page also includes deployment options and licensing details to assist you begin with DeepSeek-R1 in your applications.
  2. To begin using DeepSeek-R1, select Deploy.

    You will be prompted to set up the implementation details for DeepSeek-R1. The model ID will be pre-populated.
  3. For Endpoint name, get in an endpoint name (in between 1-50 alphanumeric characters).
  4. For Variety of instances, go into a number of circumstances (in between 1-100).
  5. For example type, choose your instance type. For optimum 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 personal cloud (VPC) networking, service function consents, and file encryption settings. For a lot 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 model.

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

    This is an exceptional method to check out the model’s reasoning and text generation abilities before incorporating it into your applications. The playground provides immediate feedback, helping you understand how the design reacts to different inputs and letting you tweak your triggers for optimum results.

    You can quickly test the design in the play area 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 demonstrates how to perform inference using a deployed 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 develop the guardrail, see the GitHub repo. After you have actually produced the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures inference specifications, and sends out a demand to produce text based upon 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 services 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 data, and deploy them into production using either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart uses two practical methods: using the intuitive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s check out both methods to help you choose the technique that best suits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

    Complete the following actions to deploy DeepSeek-R1 using SageMaker JumpStart:

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

    The model internet browser shows available designs, with details like the service provider name and design abilities.

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

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

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

    The model details page consists of the following details:

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

    The About tab consists of crucial details, such as:

    - Model description.
  11. License details.
  12. Technical specifications.
  13. Usage standards

    Before you deploy the design, it’s advised to evaluate the model details and license terms to validate compatibility with your use case.

    6. Choose Deploy to proceed with deployment.

    7. For Endpoint name, utilize the immediately generated name or produce a custom one.
  14. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  15. For Initial instance count, go into the variety of circumstances (default: 1). Selecting proper instance types and counts is important for expense and performance optimization. Monitor your implementation to change these settings as needed.Under Inference type, Real-time inference is picked by default. This is enhanced for sustained traffic and low latency.
  16. Review all configurations for accuracy. For this design, we highly suggest adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  17. Choose Deploy to deploy the design.

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

    When release is complete, your endpoint status will change to InService. At this moment, the model is all set to accept inference requests through the endpoint. You can monitor it-viking.ch the release development on the SageMaker console Endpoints page, which will show relevant 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 begun with DeepSeek-R1 using the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the required AWS consents and environment setup. The following is a detailed code example that shows how to deploy and use DeepSeek-R1 for reasoning programmatically. The code for releasing the model 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 inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail utilizing 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 section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace implementation

    If you deployed the design using Amazon Bedrock Marketplace, complete the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace releases.
  18. In the Managed implementations section, find the endpoint you want 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 proper release: 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 want 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 design using 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 designs, SageMaker JumpStart designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting started 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 develop ingenious services utilizing AWS services and accelerated compute. Currently, he is focused on developing strategies for fine-tuning and optimizing the reasoning performance of big language models. In his totally free time, Vivek takes pleasure in hiking, viewing films, 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 a Professional Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is passionate about building services that help clients accelerate their AI journey and unlock company worth.