DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
brigidagabel53 a édité cette page il y a 4 mois


Today, we are delighted 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 release DeepSeek AI’s first-generation frontier design, DeepSeek-R1, along with the distilled variations varying from 1.5 to 70 billion parameters to build, experiment, and properly scale your generative AI concepts on AWS.

In this post, we demonstrate how to get going with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to release the distilled versions of the designs as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that utilizes support finding out to boost reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A crucial distinguishing feature is its reinforcement knowing (RL) step, which was used to fine-tune the design’s responses beyond the standard pre-training and fine-tuning procedure. By including RL, DeepSeek-R1 can adapt better to user feedback and objectives, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) method, indicating it’s geared up to break down complicated inquiries and wavedream.wiki reason through them in a detailed manner. This guided thinking procedure permits the design to produce more precise, transparent, and detailed answers. This design combines RL-based fine-tuning with CoT abilities, aiming to generate structured reactions while focusing on interpretability and trademarketclassifieds.com user interaction. With its wide-ranging abilities DeepSeek-R1 has caught the industry’s attention as a flexible text-generation design that can be incorporated into different workflows such as representatives, sensible thinking and information interpretation jobs.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion criteria, making it possible for effective inference by routing questions to the most relevant professional “clusters.” This technique enables the design to concentrate on various issue domains while maintaining overall effectiveness. DeepSeek-R1 needs at least 800 GB of HBM memory in FP8 format for inference. In this post, we will use 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 model to more efficient 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 sized, more efficient designs to imitate the behavior and reasoning patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor design.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise deploying this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent harmful material, and examine 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 only the ApplyGuardrail API. You can develop multiple guardrails tailored to different use cases and use them to the DeepSeek-R1 model, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 design, you need access to an ml.p5e circumstances. To examine 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 releasing. To request a limitation increase, develop a limitation increase request and connect to your account team.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) approvals to utilize Amazon Bedrock Guardrails. For instructions, see Establish authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, prevent harmful content, and assess designs against essential safety requirements. You can execute safety procedures for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to evaluate user inputs and model 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 produce the guardrail, see the GitHub repo.

The general circulation 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 model’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 intervened by the guardrail, a message is returned indicating the nature of the intervention and whether it occurred at the input or output stage. The examples showcased in the following areas show inference utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides 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 steps:

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 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 choose the DeepSeek-R1 design.

    The design detail page provides important details about the design’s abilities, prices structure, and implementation guidelines. You can find detailed use directions, including sample API calls and code snippets for combination. The design supports different text generation jobs, including content production, code generation, and question answering, utilizing its support discovering optimization and CoT thinking capabilities. The page likewise includes implementation choices and licensing details to assist you begin with DeepSeek-R1 in your applications.
  2. To begin using DeepSeek-R1, select Deploy.

    You will be prompted 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 circumstances, go into a variety of circumstances (between 1-100).
  5. For Instance type, pick your circumstances type. For optimal performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is suggested. Optionally, you can configure innovative security and infrastructure settings, including virtual private cloud (VPC) networking, service role consents, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for setiathome.berkeley.edu production releases, you may desire to examine these settings to align with your company’s security and compliance requirements.
  6. Choose Deploy to begin utilizing the design.

    When the deployment is total, you can evaluate DeepSeek-R1’s abilities straight in the Amazon Bedrock play area.
  7. Choose Open in playground to access an interactive interface where you can explore different prompts and adjust model criteria like temperature level 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 way to check out the design’s reasoning and text generation capabilities before incorporating it into your applications. The playground supplies instant feedback, helping you comprehend how the model responds to different inputs and letting you fine-tune your prompts for optimum results.

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

    Run inference utilizing guardrails with the deployed 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 using the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo. After you have produced the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, configures reasoning specifications, and sends out a request to create 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 services that you can deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs 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 convenient approaches: utilizing the instinctive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let’s explore both techniques to assist you choose the technique that finest fits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

    Complete the following actions to deploy DeepSeek-R1 using 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, select JumpStart in the navigation pane.

    The design internet browser displays available models, with details like the provider name and model abilities.

    4. Search for DeepSeek-R1 to see the DeepSeek-R1 model card. Each design card shows crucial details, consisting of:

    - Model name
  10. Provider name
  11. Task classification (for instance, Text Generation). Bedrock Ready badge (if suitable), suggesting that this model can be signed up 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 design details page consists of the following details:

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

    The About tab consists of crucial details, such as:

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

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

    6. Choose Deploy to continue with release.

    7. For Endpoint name, utilize the instantly produced name or develop a customized one.
  15. For Instance type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  16. For Initial circumstances count, get in the number of instances (default: 1). Selecting appropriate circumstances types and counts is crucial for expense 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 model, we highly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  18. Choose Deploy to deploy the design.

    The release procedure can take numerous minutes to complete.

    When release is total, your endpoint status will change to InService. At this point, the model is prepared to accept inference requests through the endpoint. You can keep track of the deployment progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the deployment is total, you can invoke the model using a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing 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 needed AWS consents and 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 offered in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run extra demands against the predictor:

    Implement guardrails and [forum.batman.gainedge.org](https://forum.batman.gainedge.org/index.php?action=profile