1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
reed08l5494488 bu sayfayı düzenledi 1 hafta önce


Today, we are delighted to announce 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 ranging from 1.5 to 70 billion parameters 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 comparable steps to release the distilled variations of the designs also.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that utilizes reinforcement learning to improve thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. A crucial identifying feature is its support learning (RL) step, which was utilized to refine the design’s responses beyond the basic pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adjust more effectively to user feedback and goals, eventually improving both significance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, implying it’s equipped to break down complex inquiries and reason through them in a detailed manner. This assisted thinking procedure enables the design to produce more precise, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT abilities, aiming to generate structured reactions while focusing on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has recorded the industry’s attention as a versatile text-generation model that can be integrated into various workflows such as representatives, rational thinking and information interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture enables activation of 37 billion specifications, allowing effective inference by routing queries to the most pertinent specialist “clusters.” This method allows the design to specialize in different problem domains while maintaining overall performance. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will utilize an ml.p5e.48 xlarge circumstances to release the design. ml.p5e.48 xlarge comes with 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 efficient architectures based on popular open designs like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a process of training smaller, more effective models to imitate the behavior and thinking patterns of the larger DeepSeek-R1 design, using it as an instructor design.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise deploying this design with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, avoid damaging content, and bytes-the-dust.com examine models against key safety requirements. At the time of writing this blog, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce multiple guardrails tailored to various usage cases and apply them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls throughout 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, choose Amazon SageMaker, and verify 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 deploying. To request a limitation boost, develop a limit boost demand and connect to your account team.

Because you will be deploying this model 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 authorizations to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, prevent damaging material, and examine models against key safety criteria. You can carry out safety measures for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to examine user inputs and model reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail using the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo.

The general circulation involves the following actions: 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 receiving the design’s output, another guardrail check is applied. If the output passes this final check, it’s returned as the final outcome. However, if either the input or output is intervened by the guardrail, a message is returned indicating the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following sections demonstrate 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, total the following actions:

1. On the Amazon Bedrock console, pick Model brochure under Foundation designs in the navigation pane. At the time of writing this post, you can use 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 supplier and choose the DeepSeek-R1 model.

    The design detail page provides essential details about the design’s capabilities, pricing structure, and implementation standards. You can find detailed use instructions, including sample API calls and code bits for integration. The model supports numerous text generation jobs, including material development, code generation, and question answering, using its reinforcement finding out optimization and CoT reasoning abilities. The page likewise consists of release alternatives and licensing details to help you start with DeepSeek-R1 in your applications.
  2. To begin utilizing DeepSeek-R1, choose Deploy.

    You will be prompted to configure the release 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 Variety of circumstances, enter a number of circumstances (in between 1-100).
  5. For Instance type, select your instance type. For optimal performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up advanced security and facilities settings, consisting of virtual private cloud (VPC) networking, service role approvals, and encryption settings. For the majority of utilize cases, the default settings will work well. However, for production implementations, you may wish to evaluate these settings to align with your organization’s security and compliance requirements.
  6. Choose Deploy to start using the model.

    When the deployment is complete, you can test DeepSeek-R1’s capabilities straight in the Amazon Bedrock play ground.
  7. Choose Open in play area to access an interactive user interface where you can try out different triggers and change model criteria like temperature level and optimum length. When using R1 with Bedrock’s InvokeModel and Playground Console, utilize DeepSeek’s chat design template for ideal results. For instance, content for reasoning.

    This is an exceptional method to explore the design’s thinking and text generation capabilities before incorporating it into your applications. The play ground offers immediate feedback, helping you understand how the design reacts to numerous inputs and letting you fine-tune your triggers for optimal results.

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

    Run inference 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 develop a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo. After you have developed the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime client, configures reasoning criteria, and sends a demand to create text based upon a user prompt.

    Deploy DeepSeek-R1 with SageMaker JumpStart

    SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML services that you can release with simply 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 model through SageMaker JumpStart provides two hassle-free approaches: utilizing the instinctive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s check out both methods to help you select the method that best fits your needs.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

    Complete the following steps 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 design internet browser displays available designs, with details like the supplier name and design capabilities.

    4. Look for DeepSeek-R1 to see the DeepSeek-R1 design card. Each model card reveals essential details, consisting of:

    name
  10. Provider name
  11. Task category (for instance, Text Generation). Bedrock Ready badge (if applicable), suggesting that this model can be registered with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to invoke the design

    5. Choose the design 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 design. About and Notebooks tabs with detailed details

    The About tab consists of important details, such as:

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

    Before you release the design, it’s suggested to review the design details and bytes-the-dust.com license terms to verify compatibility with your usage case.

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, utilize the immediately generated name or develop a customized one.
  15. For example type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, go into the number of circumstances (default: 1). Selecting suitable instance types and counts is crucial for expense and performance optimization. Monitor your implementation to change these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is optimized for sustained traffic and low latency.
  17. Review all setups for accuracy. For this design, we strongly recommend adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  18. Choose Deploy to deploy the model.

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

    When implementation is total, your endpoint status will change to InService. At this point, the design is prepared to accept inference demands through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the deployment 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 start with DeepSeek-R1 using the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the essential AWS authorizations 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 supplied 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 inference with your SageMaker JumpStart predictor

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

    Tidy up

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

    Delete the Amazon Bedrock Marketplace implementation

    If you deployed the model utilizing Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace implementations.
  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 deleting the right deployment: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you released will sustain expenses 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 design utilizing Bedrock Marketplace and 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 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 helps emerging generative AI companies build innovative services utilizing AWS services and sped up calculate. Currently, he is concentrated on developing methods for fine-tuning and enhancing the reasoning efficiency of big language models. In his totally free time, Vivek takes pleasure in treking, seeing movies, 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 Specialist Solutions Architect working on generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads product, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker’s artificial intelligence and generative AI hub. She is passionate about developing services that assist consumers accelerate their AI journey and unlock organization worth.
上海开阖软件有限公司 沪ICP备12045867号-1