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


Today, we are delighted to reveal 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 design, DeepSeek-R1, along with the distilled versions ranging from 1.5 to 70 billion parameters to construct, 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 release the distilled versions of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes reinforcement finding out to enhance reasoning abilities through a multi-stage training process from a DeepSeek-V3-Base structure. A key identifying feature is its reinforcement knowing (RL) step, which was used to fine-tune the design's actions beyond the standard pre-training and fine-tuning process. By integrating RL, DeepSeek-R1 can adapt better to user feedback and goals, eventually enhancing both significance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, meaning it's equipped to break down complex queries and factor through them in a detailed manner. This assisted reasoning procedure allows the model to produce more precise, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to produce structured actions while focusing on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has actually recorded the market's attention as a versatile text-generation model that can be incorporated into numerous workflows such as representatives, sensible thinking and data analysis jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion specifications, making it possible for effective inference by routing queries to the most pertinent specialist "clusters." This approach enables the design to concentrate on various problem domains while maintaining overall effectiveness. 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 instance to deploy the model. ml.p5e.48 xlarge comes with 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models 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 procedure of training smaller sized, more effective designs to mimic the behavior and reasoning patterns of the bigger DeepSeek-R1 model, using it as a teacher model.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, 89u89.com we recommend releasing this design with guardrails in place. In this blog, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent harmful material, and evaluate models against essential safety criteria. At the time of composing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop numerous guardrails tailored to different usage cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing security 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, select Amazon SageMaker, and confirm you're using 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 deploying. To ask for a limit boost, create a limit increase request and reach out to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, avoid hazardous material, and examine designs against key security criteria. You can carry out security steps for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to assess user inputs and model actions deployed 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 basic circulation 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 to the design for inference. After getting the design'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 occurred at the input or output phase. The examples showcased in the following sections show inference utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, higgledy-piggledy.xyz and specialized structure designs (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following actions:

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 utilize the InvokeModel API to conjure up the design. It does not support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a supplier and select the DeepSeek-R1 model.

The model detail page provides vital details about the design's capabilities, rates structure, and implementation guidelines. You can find detailed use directions, consisting of sample API calls and code snippets for combination. The design supports various text generation tasks, including material development, code generation, and question answering, using its support learning optimization and CoT thinking abilities. The page also includes deployment choices and licensing details to help you get begun with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, pick Deploy.

You will be prompted to configure the deployment details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters). 5. For Number of circumstances, get in a variety of circumstances (between 1-100). 6. For example type, pick your instance type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can set up innovative security and facilities settings, consisting of virtual private cloud (VPC) networking, service role authorizations, and file encryption settings. For many utilize cases, the default settings will work well. However, for production deployments, you may wish to evaluate these settings to line up with your organization's security and compliance requirements. 7. Choose Deploy to begin utilizing the design.

When the implementation is complete, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock playground. 8. Choose Open in playground to access an interactive user interface where you can experiment with various prompts and adjust model specifications like temperature level and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for optimal results. For instance, content for inference.

This is an excellent way to check out the design's thinking and text generation capabilities before integrating it into your applications. The playground offers immediate feedback, helping you comprehend how the design responds to different inputs and letting you fine-tune your triggers for optimum results.

You can rapidly check 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 shows how to carry out inference using a released DeepSeek-R1 model 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 actually developed the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime client, sets up inference criteria, and sends out a request to produce text based on a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in algorithms, and prebuilt ML solutions that you can release with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your information, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 hassle-free methods: 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 technique that best matches your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions to deploy DeepSeek-R1 utilizing SageMaker JumpStart:

1. On the SageMaker console, pick Studio in the navigation pane. 2. First-time users will be triggered to develop a domain. 3. On the SageMaker Studio console, wiki.dulovic.tech select JumpStart in the navigation pane.

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

4. Search for DeepSeek-R1 to see the DeepSeek-R1 model card. Each design card reveals key details, bytes-the-dust.com consisting of:

- Model name

  • Provider name
  • Task classification (for example, Text Generation). Bedrock Ready badge (if applicable), suggesting that this design can be registered 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 model details page consists of the following details:

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

    The About tab consists of essential details, such as:

    - Model description.
  • License details.
  • Technical specs.
  • Usage standards

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

    6. Choose Deploy to continue with release.

    7. For Endpoint name, utilize the immediately created name or develop a custom one.
  1. For Instance type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the number of circumstances (default: 1). Selecting appropriate circumstances types and counts is crucial for cost and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is optimized for sustained traffic and low latency.
  3. Review all setups for precision. For this design, we highly advise adhering to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  4. Choose Deploy to deploy the model.

    The release process can take numerous minutes to finish.

    When deployment is complete, your endpoint status will change to InService. At this moment, the model is all set to accept reasoning requests through the endpoint. You can keep an eye on the deployment progress on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the deployment is complete, you can conjure up the model using a SageMaker runtime customer and integrate 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 set up the SageMaker Python SDK and make certain you have the needed AWS authorizations and environment setup. The following is a detailed code example that shows how to deploy and utilize DeepSeek-R1 for reasoning programmatically. The code for deploying the design is provided 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 inference 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 revealed in the following code:

    Tidy up

    To prevent undesirable charges, finish the actions in this area to clean up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the model using Amazon Bedrock Marketplace, total the following actions:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, select Marketplace deployments.
  5. In the Managed implementations area, find the endpoint you want 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 release: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed 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 out how you can access and higgledy-piggledy.xyz deploy the DeepSeek-R1 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained models, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Getting begun 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 innovative services utilizing AWS services and accelerated calculate. Currently, he is concentrated on developing strategies for fine-tuning and optimizing the inference performance of large language models. In his spare time, Vivek takes pleasure in treking, viewing motion pictures, 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 Professional Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads product, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is enthusiastic about developing options that assist customers accelerate their AI journey and unlock company worth.