DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
christenweisz editó esta página hace 6 meses


Today, we are excited 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 model, DeepSeek-R1, along with the distilled variations ranging from 1.5 to 70 billion parameters to build, experiment, and properly 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 comparable steps to deploy the distilled variations of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that uses reinforcement learning to enhance thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential identifying feature is its support knowing (RL) action, which was utilized to fine-tune the model’s actions beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adjust better to user feedback and goals, eventually enhancing both relevance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, implying it’s geared up to break down complicated queries and factor through them in a detailed manner. This guided reasoning procedure permits the design to produce more precise, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT abilities, aiming to generate structured actions while concentrating on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has actually caught the industry’s attention as a flexible text-generation design that can be incorporated into various workflows such as agents, rational thinking and information analysis tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture allows activation of 37 billion parameters, allowing effective inference by routing questions to the most pertinent specialist “clusters.” This technique enables the design to specialize in various issue domains while maintaining total effectiveness. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances to release the model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs supplying 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 refers to a process of training smaller, more effective models to mimic the habits and reasoning patterns of the larger DeepSeek-R1 design, using it as an instructor design.

You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest deploying this design with guardrails in place. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent damaging material, and assess models against key security criteria. At the time of composing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce multiple guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing safety controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you need access to an ml.p5e instance. To check if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and confirm you’re utilizing 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 limit increase, develop a limitation increase request and connect to your account group.

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) authorizations to utilize Amazon Bedrock Guardrails. For instructions, see Establish permissions to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid damaging content, and evaluate models against crucial safety criteria. You can carry out precaution for photorum.eclat-mauve.fr the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to evaluate user inputs and design actions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo.

The basic circulation 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 out to the model for inference. After getting the design’s output, another guardrail check is used. 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 happened at the input or wiki.eqoarevival.com output phase. The examples showcased in the following sections show reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following actions:

1. On the Amazon Bedrock console, pick Model brochure under Foundation designs in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to conjure up the design. It doesn’t support Converse APIs and other Amazon Bedrock tooling.

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

    The model detail page offers essential details about the design’s capabilities, prices structure, wiki.myamens.com and implementation guidelines. You can find detailed use guidelines, consisting of sample API calls and code snippets for combination. The model supports numerous text generation tasks, consisting of content production, code generation, and concern answering, utilizing its support discovering optimization and CoT reasoning capabilities. The page also includes implementation options and licensing details to help you get started with DeepSeek-R1 in your applications.
  2. To begin utilizing DeepSeek-R1, pick Deploy.

    You will be prompted to set up 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 Number of circumstances, enter a number of circumstances (between 1-100).
  5. For example type, pick your circumstances type. For ideal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can configure innovative security and facilities settings, consisting of virtual personal cloud (VPC) networking, service role approvals, and file encryption settings. For many use cases, the default settings will work well. However, for production deployments, you might desire to evaluate these settings to align with your company’s security and compliance requirements.
  6. Choose Deploy to start using the model.

    When the implementation is total, you can evaluate DeepSeek-R1’s capabilities straight in the Amazon Bedrock play ground.
  7. Choose Open in playground to access an interactive user interface where you can experiment with various prompts and change model specifications like temperature level and optimum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat template for ideal outcomes. For instance, content for inference.

    This is an exceptional way to check out the design’s thinking and text generation capabilities before integrating it into your applications. The play area provides immediate feedback, assisting you understand wiki.snooze-hotelsoftware.de how the model reacts to various inputs and higgledy-piggledy.xyz letting you tweak your triggers for optimal outcomes.

    You can rapidly evaluate the design in the playground through the UI. However, to invoke the released design programmatically with any Amazon Bedrock APIs, wiki.snooze-hotelsoftware.de 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 reasoning utilizing a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can develop 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 created the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up reasoning parameters, and sends a request to produce text based on a user prompt.

    Deploy DeepSeek-R1 with SageMaker JumpStart

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

    Deploying DeepSeek-R1 design through SageMaker JumpStart offers two hassle-free approaches: utilizing the instinctive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s check out both approaches to assist you pick the approach that finest suits your needs.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

    Complete the following steps to deploy 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 console, choose JumpStart in the navigation pane.

    The model web browser shows available models, with details like the supplier name and design capabilities.

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

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

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

    The model details page includes 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 requirements.
  14. Usage standards

    Before you deploy the design, it’s suggested to review the design details and license terms to validate compatibility with your usage case.

    6. Choose Deploy to proceed with deployment.

    7. For Endpoint name, utilize the instantly produced name or develop a customized one.
  15. For Instance type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, go into the number of instances (default: 1). Selecting proper instance types and wiki.snooze-hotelsoftware.de counts is essential for cost and performance optimization. Monitor your release to change 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 setups for precision. For this model, we strongly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  18. Choose Deploy to deploy the design.

    The release process can take several minutes to finish.

    When deployment is complete, your endpoint status will alter to InService. At this moment, the model is ready to accept reasoning requests through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the implementation 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 begin with DeepSeek-R1 using 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 deploy and use DeepSeek-R1 for reasoning 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 reasoning with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can produce a guardrail utilizing the Amazon Bedrock console or the API, and execute it as shown in the following code:

    Clean up

    To avoid unwanted charges, complete the steps in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the design using 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 deployments section, locate the endpoint you wish to erase.
  20. Select the endpoint, and on the Actions menu, select Delete.
  21. Verify the endpoint details to make certain you’re erasing the right release: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you deployed will sustain costs if you leave it running. Use the following code to delete 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 get begun. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Beginning with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI companies develop ingenious options using AWS services and sped up compute. Currently, he is concentrated on developing methods for fine-tuning and optimizing the inference performance of large language designs. In his totally free time, Vivek enjoys treking, viewing motion pictures, and attempting various cuisines.

    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 a Specialist Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads item, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI center. She is enthusiastic about building options that help consumers accelerate their AI journey and unlock service worth.