DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
jorjaduarte659 heeft deze pagina aangepast 4 maanden geleden


Today, we are thrilled 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, together with the distilled variations varying 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 begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to deploy the distilled variations of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that uses reinforcement finding out to enhance thinking abilities through a multi-stage training process from a DeepSeek-V3-Base structure. A crucial distinguishing function is its support learning (RL) step, which was utilized to refine the design’s actions beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adjust more successfully to user feedback and goals, ultimately boosting both relevance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, suggesting it’s geared up to break down and reason through them in a detailed manner. This guided reasoning procedure enables the model to produce more accurate, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT capabilities, aiming to generate structured reactions while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has captured the market’s attention as a versatile text-generation design that can be integrated into various workflows such as agents, sensible reasoning and data interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion criteria, allowing effective reasoning by routing questions to the most appropriate expert “clusters.” This technique allows the design to concentrate on various issue domains while maintaining general effectiveness. DeepSeek-R1 requires 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 models bring the reasoning capabilities 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 sized, more efficient designs to imitate the habits and reasoning patterns of the larger DeepSeek-R1 model, utilizing it as a teacher design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest releasing this model with guardrails in location. In this blog, it-viking.ch we will use Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous material, and evaluate models against crucial safety criteria. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, wiki.dulovic.tech Bedrock Guardrails supports just the ApplyGuardrail API. You can produce numerous guardrails tailored to various use cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you require access to an ml.p5e circumstances. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and validate 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 boost, produce a limitation boost request and 89u89.com reach out 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) approvals to use Amazon Bedrock Guardrails. For directions, see Establish approvals to utilize guardrails for setiathome.berkeley.edu content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, avoid damaging content, and evaluate models against key safety criteria. You can implement safety steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to evaluate user inputs and model responses deployed 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 create the guardrail, see the GitHub repo.

The general flow involves the following actions: 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 model for inference. After receiving the design’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 showing the nature of the intervention and whether it took place at the input or output stage. The examples showcased in the following areas show reasoning 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, total the following steps:

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

  1. Filter for DeepSeek as a supplier and select the DeepSeek-R1 model.

    The design detail page supplies essential details about the design’s abilities, prices structure, and application standards. You can find detailed use directions, consisting of sample API calls and code bits for integration. The model supports numerous text generation jobs, consisting of material production, code generation, and concern answering, using its reinforcement learning optimization and CoT thinking abilities. The page likewise includes release options and licensing details to help you get going 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 design ID will be pre-populated.
  3. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters).
  4. For Number of instances, go into a number of circumstances (in between 1-100).
  5. For example type, choose your circumstances type. For optimal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is advised. Optionally, you can set up advanced security and infrastructure settings, including virtual personal cloud (VPC) networking, service function approvals, and file encryption settings. For the majority of use cases, the default settings will work well. However, for production deployments, you might wish to evaluate these settings to align with your company’s security and compliance requirements.
  6. Choose Deploy to begin utilizing the design.

    When the release is total, you can evaluate DeepSeek-R1’s abilities straight in the Amazon Bedrock play ground.
  7. Choose Open in play ground to access an interactive user interface where you can experiment with different prompts and change design parameters like temperature level and optimum length. When using R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat design template for optimal outcomes. For example, content for reasoning.

    This is an outstanding way to check out the model’s thinking and text generation abilities before integrating it into your applications. The play ground supplies immediate feedback, assisting you understand how the model reacts to various inputs and letting you fine-tune your triggers for optimal outcomes.

    You can quickly test the design in the playground through the UI. However, to conjure up the released 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 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 developed the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, sets up inference specifications, and sends a demand it-viking.ch to create text based upon a user timely.

    Deploy DeepSeek-R1 with SageMaker JumpStart

    SageMaker JumpStart is an artificial intelligence (ML) hub 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 using either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart offers two convenient techniques: using the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s check out both methods to assist you select the approach that best matches your needs.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

    1. On the SageMaker console, pick 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 design web browser displays available models, with details like the company name and design abilities.

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

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

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

    The model details page consists of the following details:

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

    The About tab includes crucial details, such as:

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

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

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, utilize the instantly produced name or develop a custom one.
  15. For Instance type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial circumstances count, enter the number of instances (default: 1). Selecting appropriate circumstances types and counts is essential for expense and efficiency optimization. Monitor your release 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 configurations for precision. For this design, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  18. Choose Deploy to deploy the design.

    The release procedure can take a number of minutes to finish.

    When implementation is total, your endpoint status will change to InService. At this moment, the design is ready to accept inference demands through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will show relevant metrics and status details. When the implementation is total, you can invoke the design utilizing a SageMaker runtime client 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 install the SageMaker Python SDK and make certain you have the necessary AWS approvals 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 note pad and run from SageMaker Studio.

    You can run extra demands against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail using the Amazon Bedrock console or the API, and implement it as shown in the following code:

    Clean up

    To avoid undesirable charges, finish the actions in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace implementation

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace deployments.
  19. In the Managed implementations area, find the endpoint you desire to delete.
  20. Select the endpoint, and on the Actions menu, select Delete.
  21. Verify the endpoint details to make certain you’re erasing the correct implementation: 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 explored how you can access and deploy the DeepSeek-R1 model using Bedrock Marketplace and oeclub.org SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. 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 going 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 develop ingenious options utilizing AWS services and accelerated compute. Currently, he is focused on developing methods for fine-tuning and optimizing the reasoning efficiency of big language designs. In his spare time, Vivek delights in treking, enjoying films, and attempting 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 Specialist Solutions Architect working on generative AI with the Third-Party Model Science team at AWS.

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