1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
marcelkeyes749 edited this page 2 months ago


Today, we are thrilled 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 deploy DeepSeek AI's first-generation frontier model, DeepSeek-R1, together with the distilled versions varying from 1.5 to 70 billion parameters to construct, experiment, and responsibly 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 comparable steps to release the distilled versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) developed by DeepSeek AI that utilizes support discovering to improve reasoning capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A crucial distinguishing feature is its reinforcement learning (RL) action, which was used to refine the design's responses beyond the basic pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adjust more successfully to user feedback and objectives, eventually improving both importance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, meaning it's geared up to break down complicated inquiries and reason through them in a detailed manner. This assisted reasoning process permits the model to produce more precise, transparent, and detailed answers. This model integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured responses while focusing on interpretability and user interaction. With its wide-ranging capabilities DeepSeek-R1 has recorded the industry's attention as a flexible text-generation model that can be integrated into different workflows such as agents, rational reasoning and information analysis jobs.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion criteria, making it possible for effective inference by routing inquiries to the most appropriate expert "clusters." This approach permits the design to focus on different issue domains while maintaining general efficiency. DeepSeek-R1 requires 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 deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning capabilities of the main R1 model to more efficient architectures based on popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation refers to a process of training smaller, more efficient models to simulate the habits and reasoning patterns of the bigger DeepSeek-R1 model, gratisafhalen.be utilizing it as an instructor model.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest releasing this design with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous content, and evaluate models against key safety requirements. At the time of writing this blog, for links.gtanet.com.br DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop multiple guardrails tailored to different use cases and use them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, 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 using ml.p5e.48 xlarge for . Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are deploying. To ask for a limitation increase, develop a limitation increase request and connect to your account team.

Because you will be releasing this design with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) consents to use Amazon Bedrock Guardrails. For directions, see Set up consents to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, avoid harmful content, and evaluate designs against essential safety requirements. You can implement precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and design actions released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.

The general flow involves the following steps: 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 out to the design for reasoning. After getting the model's output, another guardrail check is applied. If the output passes this last check, it's returned as the last 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 took place at the input or output phase. The examples showcased in the following sections show inference 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, complete the following steps:

1. On the Amazon Bedrock console, choose Model brochure under Foundation designs in the navigation pane. At the time of composing this post, you can use the InvokeModel API to invoke the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a provider and select the DeepSeek-R1 design.

The model detail page offers vital details about the design's abilities, pricing structure, and implementation guidelines. You can discover detailed use directions, consisting of sample API calls and code bits for integration. The design supports numerous text generation jobs, consisting of content production, code generation, and question answering, using its reinforcement discovering optimization and CoT reasoning abilities. The page also consists of deployment alternatives and licensing details to assist you get going with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, select Deploy.

You will be triggered to set up the implementation details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters). 5. For Variety of circumstances, enter a number of circumstances (between 1-100). 6. For Instance type, pick your instance type. For optimum performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, you can configure sophisticated security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service function permissions, and file encryption settings. For many use cases, the default settings will work well. However, for production releases, you may desire to examine these settings to line up with your organization's security and compliance requirements. 7. Choose Deploy to begin using the model.

When the release is complete, you can evaluate DeepSeek-R1's capabilities straight in the Amazon Bedrock play area. 8. Choose Open in playground to access an interactive user interface where you can experiment with various prompts and adjust design criteria like temperature level and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, utilize DeepSeek's chat design template for ideal results. For example, material for inference.

This is an exceptional way to explore the model's reasoning and text generation abilities before integrating it into your applications. The playground supplies instant feedback, helping you comprehend 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 invoke the deployed model programmatically with any Amazon Bedrock APIs, larsaluarna.se you require to get the endpoint ARN.

Run inference utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example demonstrates how to perform inference using a released 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 reasoning specifications, and sends out a demand to generate text based upon 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 options that you can deploy with simply a few clicks. With SageMaker JumpStart, you can tailor pipewiki.org pre-trained designs to your use case, with your information, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart offers two convenient techniques: utilizing the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's explore both methods to help you pick 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, select Studio in the navigation pane. 2. First-time users will be triggered to create a domain. 3. On the SageMaker Studio console, pick JumpStart in the navigation pane.

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

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

- Model name

  • Provider name
  • Task classification (for example, Text Generation). Bedrock Ready badge (if relevant), yewiki.org indicating that this design can be signed up with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to conjure up the design

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

    The design details page consists of the following details:

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

    The About tab includes crucial details, such as:

    - Model description.
  • License details.
  • Technical requirements.
  • Usage guidelines

    Before you deploy the design, it's advised to examine the model details and license terms to confirm compatibility with your usage case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the instantly produced name or bytes-the-dust.com develop a customized one.
  1. For example type ¸ pick a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the number of instances (default: 1). Selecting suitable circumstances types and counts is crucial for cost and efficiency optimization. Monitor surgiteams.com your deployment to change these settings as needed.Under Inference type, Real-time inference is chosen by default. This is optimized for sustained traffic and low latency.
  3. Review all setups for accuracy. For this model, we highly recommend sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to release the model.

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

    When implementation is total, your endpoint status will alter to InService. At this point, the model is all set to accept reasoning requests through the endpoint. You can monitor the release development on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the release is total, you can invoke the design utilizing a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing 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 essential AWS permissions and environment setup. The following is a detailed code example that demonstrates how to deploy and utilize DeepSeek-R1 for reasoning programmatically. The code for deploying the design is supplied in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run additional demands against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

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

    Tidy up

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

    Delete the Amazon Bedrock Marketplace release

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

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace releases.
  5. In the Managed implementations section, find the endpoint you wish to erase.
  6. Select the endpoint, and on the Actions menu, pick Delete.
  7. Verify the endpoint details to make certain you're erasing the correct implementation: 1. Endpoint name.
  8. Model name.
  9. 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 erase 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 using 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 designs, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting started with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He assists emerging generative AI business build innovative solutions using AWS services and sped up calculate. Currently, he is focused on establishing methods for fine-tuning and optimizing the reasoning efficiency of big language models. In his free time, Vivek enjoys treking, enjoying movies, and attempting different cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team at AWS. His location of focus is AWS AI accelerators (AWS Neuron). He holds a Bachelor's degree in Computer Science and Bioinformatics.

    Jonathan Evans is a Professional Solutions Architect working on 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 hub. She is enthusiastic about building solutions that assist consumers accelerate their AI journey and unlock business value.