DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
sanoranix9627 redigerade denna sida 2 veckor sedan


Today, we are delighted to announce that 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, in addition to the distilled versions varying from 1.5 to 70 billion specifications to build, experiment, and responsibly scale your generative AI concepts on AWS.

In this post, we demonstrate how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled variations of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that uses support discovering to enhance thinking abilities through a multi-stage training process from a DeepSeek-V3-Base structure. An essential differentiating function is its support learning (RL) step, which was used to fine-tune the design’s responses beyond the standard pre-training and tweak process. By including RL, DeepSeek-R1 can adapt more effectively to user feedback and goals, ultimately enhancing both importance and clarity. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, implying it’s geared up to break down complex queries and factor through them in a detailed way. This assisted reasoning process enables the design to produce more precise, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT capabilities, aiming to create structured reactions while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has actually captured the industry’s attention as a versatile text-generation model that can be incorporated into different workflows such as agents, logical thinking and data analysis tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture permits activation of 37 billion specifications, making it possible for effective inference by routing queries to the most appropriate specialist “clusters.” This method permits the design to focus on various problem domains while maintaining total effectiveness. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge instance to deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning 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 procedure of training smaller, more effective models to mimic the behavior and reasoning patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor design.

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

Prerequisites

To deploy 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 confirm you’re utilizing ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are releasing. To ask for a limitation increase, develop a limitation increase demand and reach out to your account team.

Because you will be deploying this design with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) consents to use Amazon Bedrock Guardrails. For instructions, see Establish authorizations to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid damaging material, and examine designs against crucial safety criteria. You can implement security measures for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and design reactions released on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create a guardrail using the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo.

The basic circulation includes the following actions: 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 to the model for reasoning. After getting the model’s output, another guardrail check is used. If the output passes this final check, it’s returned as the 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 took place at the input or output phase. The examples showcased in the following areas 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 designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, total the following actions:

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

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

    The model detail page supplies vital details about the model’s capabilities, prices structure, and execution standards. You can find detailed usage directions, consisting of sample API calls and code bits for integration. The model supports numerous text generation tasks, consisting of material creation, code generation, and concern answering, utilizing its support learning optimization and CoT thinking capabilities. The page likewise consists of deployment alternatives and licensing details to help you get going with DeepSeek-R1 in your applications.
  2. To start using DeepSeek-R1, choose Deploy.

    You will be triggered to set up the release details for DeepSeek-R1. The model 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, pick your instance type. For optimal efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is suggested. Optionally, you can set up sophisticated security and facilities settings, including virtual private cloud (VPC) networking, service function permissions, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production implementations, you might desire to examine these settings to line up with your company’s security and compliance requirements.
  6. Choose Deploy to start 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 playground to access an interactive user interface where you can experiment with various triggers and change model specifications like temperature and optimum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat template for optimum outcomes. For example, content for inference.

    This is an outstanding way to check out the model’s reasoning and text generation abilities before integrating it into your applications. The playground supplies immediate feedback, helping you understand how the model reacts to various inputs and letting you fine-tune your prompts for ideal results.

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

    Run reasoning utilizing guardrails with the released DeepSeek-R1 endpoint

    The following code example shows how to carry out reasoning using a released DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can develop a guardrail utilizing the Amazon Bedrock console or the API. For the example code to create the guardrail, see the GitHub repo. After you have produced the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures inference criteria, and sends a demand 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 release with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and deploy them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 design through SageMaker JumpStart uses 2 practical approaches: utilizing the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let’s check out both techniques to assist you select the technique 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, select Studio in the navigation pane.
  8. First-time users will be triggered to produce a domain.
  9. On the SageMaker Studio console, pick JumpStart in the navigation pane.

    The design internet browser displays available designs, with details like the supplier name and model capabilities.

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

    - Model name
  10. Provider name
  11. Task classification (for instance, Text Generation). Bedrock Ready badge (if suitable), indicating that this model can be registered with Amazon Bedrock, permitting you to utilize Amazon Bedrock APIs to invoke the model

    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 deploy the model. About and Notebooks tabs with detailed details

    The About tab includes crucial details, such as:

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

    Before you deploy the model, it’s recommended to examine the design details and license terms to confirm compatibility with your use case.

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, use the instantly generated name or develop a custom-made one.
  15. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  16. For Initial circumstances count, enter the number of instances (default: 1). Selecting proper instance types and counts is crucial for cost and efficiency optimization. Monitor your deployment to change 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 accuracy. For this design, we strongly advise 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 several minutes to complete.

    When implementation is total, your endpoint status will alter to InService. At this moment, the design is prepared to accept inference demands through the endpoint. You can monitor the release development on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the deployment is total, you can invoke the design utilizing a SageMaker runtime customer and incorporate 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 require to install the SageMaker Python SDK and make certain you have the required AWS approvals and trademarketclassifieds.com environment setup. The following is a detailed code example that demonstrates how to deploy and use DeepSeek-R1 for inference programmatically. The code for releasing the design is provided in the Github here. You can clone the notebook and run from SageMaker Studio.

    You can run extra demands 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 produce a guardrail using the Amazon Bedrock console or [forum.batman.gainedge.org](https://forum.batman.gainedge.org/index.php?action=profile