DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
hudsong896366 ha modificato questa pagina 1 mese fa


Today, we are delighted to reveal that DeepSeek R1 and Qwen designs 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 versions ranging from 1.5 to 70 billion criteria to build, experiment, and responsibly scale your generative AI ideas on AWS.

In this post, we show how to get begun with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to deploy the distilled variations of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) established by DeepSeek AI that utilizes reinforcement discovering to enhance reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential differentiating function is its support knowing (RL) step, which was used to improve the model’s actions beyond the basic pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and goals, ultimately enhancing both relevance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, meaning it’s geared up to break down complex questions and factor through them in a detailed way. This guided reasoning procedure permits the model to produce more precise, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT abilities, aiming to generate structured actions while focusing on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually captured the market’s attention as a flexible text-generation model that can be incorporated into different workflows such as representatives, sensible thinking and data interpretation tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion parameters, making it possible for efficient reasoning by routing inquiries to the most appropriate specialist “clusters.” This method enables the model to concentrate on different problem domains while maintaining overall effectiveness. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for wiki.vst.hs-furtwangen.de reasoning. In this post, we will use an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking abilities of the main R1 design to more effective architectures based upon 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 efficient designs to imitate the behavior and thinking patterns of the larger DeepSeek-R1 model, 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 design, we recommend deploying this design with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid harmful material, and assess models against crucial security requirements. At the time of writing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce several guardrails tailored to different 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 require access to an ml.p5e circumstances. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and validate 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 releasing. To ask for a limitation boost, develop a limit boost demand and connect to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, prevent harmful material, and evaluate models against crucial safety criteria. You can implement safety steps for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to assess user inputs and design actions deployed 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 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 inference. After receiving the design’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 stepped in by the guardrail, a message is returned suggesting the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following areas show inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers 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 models 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 supplier and pick the DeepSeek-R1 design.

    The model detail page provides important details about the model’s abilities, pricing structure, and application guidelines. You can discover detailed use directions, including sample API calls and code bits for combination. The model supports various text generation tasks, including material production, code generation, and question answering, using its reinforcement learning optimization and CoT thinking abilities. The page likewise consists of deployment choices and licensing details to help you get begun with DeepSeek-R1 in your applications.
  2. To start utilizing DeepSeek-R1, pick Deploy.

    You will be triggered to configure the deployment 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 Number of circumstances, enter a variety of circumstances (in between 1-100).
  5. For example type, choose your instance type. For ideal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and infrastructure settings, consisting of virtual personal cloud (VPC) networking, service role approvals, and file 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 start using the design.

    When the release is total, you can evaluate DeepSeek-R1’s abilities straight in the Amazon Bedrock playground.
  7. Choose Open in playground to access an interactive interface where you can experiment with various prompts and adjust design parameters like temperature and maximum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat design template for optimum outcomes. For instance, content for inference.

    This is an outstanding method to check out the design’s thinking and text generation capabilities before incorporating it into your applications. The play area provides instant feedback, helping you understand how the design reacts to various inputs and letting you tweak your prompts for optimum outcomes.

    You can rapidly check the design in the play area through the UI. However, to invoke the released model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

    Run reasoning using guardrails with the released DeepSeek-R1 endpoint

    The following code example shows how to carry out reasoning using a deployed DeepSeek-R1 design through Amazon Bedrock utilizing 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 created the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime client, configures inference parameters, and sends a request to generate text based on a user timely.

    Deploy DeepSeek-R1 with SageMaker JumpStart

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

    Deploying DeepSeek-R1 design through SageMaker JumpStart offers 2 convenient methods: utilizing the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let’s check out both approaches to assist you select the method that finest matches your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

    Complete the following actions to release DeepSeek-R1 utilizing SageMaker JumpStart:

    1. On the SageMaker console, pick 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 model browser shows available designs, with details like the company name and model abilities.

    4. Look for DeepSeek-R1 to see the DeepSeek-R1 design card. Each design card reveals key details, including:

    - Model name
  10. Provider name
  11. Task classification (for instance, Text Generation). Bedrock Ready badge (if suitable), showing that this model can be registered with Amazon Bedrock, enabling 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 design name and service provider details. Deploy button to release the design. About and Notebooks tabs with detailed details

    The About tab consists of important details, such as:

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

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

    6. Choose Deploy to continue with release.

    7. For Endpoint name, use the immediately generated name or create a customized one.
  15. For example type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, get in the variety of instances (default: 1). Selecting proper circumstances 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 optimized for sustained traffic and low latency.
  17. Review all setups for accuracy. For this model, we strongly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  18. Choose Deploy to deploy the model.

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

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

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To begin 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 consents 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 model is supplied 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 inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also use 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 revealed in the following code:

    Tidy up

    To prevent undesirable charges, complete the steps in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace implementations.
  19. In the Managed implementations area, locate the endpoint you want 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 right deployment: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed will sustain expenses 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 going. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained models, 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 develop innovative services utilizing AWS services and sped up compute. Currently, he is focused on developing techniques for fine-tuning and enhancing the inference performance of large language models. In his downtime, Vivek delights in hiking, watching films, and trying different 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 technology and Bioinformatics.

    Jonathan Evans is a Professional Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is enthusiastic about developing services that assist consumers accelerate their AI journey and unlock company worth.