Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
  • Sign in
T
tylerwesleywilliamson
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Issues 3
    • Issues 3
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
  • Ardis Phares
  • tylerwesleywilliamson
  • Issues
  • #1

Closed
Open
Opened Feb 28, 2025 by Ardis Phares@ardisphares21
  • Report abuse
  • New issue
Report abuse New issue

DeepSeek-R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart


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 model, DeepSeek-R1, along with the distilled versions varying from 1.5 to 70 billion specifications to develop, experiment, and responsibly scale your generative AI concepts on AWS.

In this post, we show how to start with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to release the distilled versions of the designs too.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that utilizes support learning to improve reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential distinguishing function is its support knowing (RL) action, which was utilized to refine the design's reactions beyond the basic pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and objectives, ultimately improving both significance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, meaning it's equipped to break down complicated questions and reason through them in a detailed manner. This assisted reasoning process enables the model to produce more precise, transparent, and detailed answers. This design integrates RL-based fine-tuning with CoT capabilities, aiming to create structured reactions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has caught the industry's attention as a versatile text-generation design that can be integrated into numerous workflows such as agents, logical thinking and data interpretation tasks.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion criteria, allowing effective inference by routing questions to the most pertinent specialist "clusters." This method allows the model to focus on different issue domains while maintaining general performance. DeepSeek-R1 requires a minimum of 800 GB of HBM memory in FP8 format for reasoning. In this post, we will use an ml.p5e.48 xlarge instance to release the design. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning capabilities of the main R1 design 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 procedure of training smaller sized, more effective models to simulate the habits and thinking patterns of the larger DeepSeek-R1 model, utilizing it as an instructor model.

You can deploy 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 place. In this blog site, we will utilize Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous content, and evaluate designs against crucial security requirements. 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 create multiple guardrails tailored to different use cases and use them to the DeepSeek-R1 model, enhancing user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you require access to an ml.p5e instance. To check 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 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, create a limitation increase request and reach out to your account group.

Because you will be deploying this design 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 instructions, see Establish authorizations to utilize guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to present safeguards, avoid hazardous material, and assess designs against essential security requirements. You can carry out precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to examine user inputs and model reactions 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 circulation includes the following actions: First, the system gets an input for the model. This input is then processed through the ApplyGuardrail API. If the input passes the guardrail check, it's sent to the design for reasoning. After receiving the design's output, another guardrail check is applied. If the output passes this final check, it's as the result. However, if either the input or output is stepped in by the guardrail, a message is returned showing the nature of the intervention and whether it happened at the input or output phase. The examples showcased in the following areas demonstrate inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized foundation 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 models in the navigation pane. At the time of writing 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 company and select the DeepSeek-R1 model.

The design detail page supplies necessary details about the model's abilities, pricing structure, and execution guidelines. You can find detailed usage instructions, consisting of sample API calls and code snippets for integration. The model supports various text generation jobs, including content development, code generation, and concern answering, using its support finding out optimization and CoT reasoning abilities. The page likewise includes implementation choices and licensing details to help you get started with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, choose Deploy.

You will be prompted to set up the release 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, enter a number of instances (in between 1-100). 6. For Instance type, choose your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can set up advanced security and infrastructure settings, including virtual personal cloud (VPC) networking, service function consents, and file encryption settings. For most 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 start using the model.

When the implementation is total, you can test DeepSeek-R1's capabilities straight in the Amazon Bedrock play ground. 8. Choose Open in play ground to access an interactive interface where you can explore various triggers and change design parameters like temperature and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat design template for ideal results. For instance, material for reasoning.

This is an exceptional method to check out the model's reasoning and text generation capabilities before integrating it into your applications. The playground provides instant feedback, helping you comprehend how the model reacts to various inputs and letting you tweak your triggers for optimum outcomes.

You can rapidly test the design in the play area through the UI. However, to conjure up the deployed model programmatically with any Amazon Bedrock APIs, you require to get the endpoint ARN.

Run reasoning using guardrails with the released DeepSeek-R1 endpoint

The following code example shows how to perform inference using a deployed DeepSeek-R1 model through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can produce 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 actually developed the guardrail, utilize the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures inference parameters, and sends 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, integrated algorithms, and prebuilt ML solutions that you can release with simply a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your information, and release them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses two practical approaches: utilizing the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both techniques to assist you choose the approach that best fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following actions to release DeepSeek-R1 using SageMaker JumpStart:

1. On the SageMaker console, pick Studio in the navigation pane. 2. First-time users will be triggered to create a domain. 3. On the SageMaker Studio console, setiathome.berkeley.edu pick JumpStart in the navigation pane.

The design browser shows available designs, with details like the company name and model capabilities.

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

- Model name

  • Provider name
  • Task classification (for instance, Text Generation). Bedrock Ready badge (if relevant), suggesting that this design can be signed up with Amazon Bedrock, permitting you to utilize Amazon Bedrock APIs to conjure up the model

    5. Choose the design card to view the design details page.

    The model details page includes the following details:

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

    The About tab consists of important details, such as:

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

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

    6. Choose Deploy to continue with release.

    7. For Endpoint name, utilize the automatically generated name or create a customized one.
  1. For Instance type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the variety of instances (default: 1). Selecting proper instance types and counts is essential for expense and efficiency optimization. Monitor your release 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.
  3. 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 location.
  4. Choose Deploy to release the design.

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

    When deployment is complete, your endpoint status will change to InService. At this moment, the design is prepared to accept reasoning requests through the endpoint. You can monitor the release progress on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the deployment is complete, you can conjure up the design utilizing a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the needed AWS approvals and environment setup. The following is a detailed code example that shows how to release and utilize DeepSeek-R1 for reasoning programmatically. The code for releasing the model is supplied in the Github here. You can clone the note pad and run from SageMaker Studio.

    You can run additional requests against the predictor:

    Implement guardrails and run reasoning 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 utilizing the Amazon Bedrock console or the API, and implement it as revealed in the following code:

    Tidy up

    To avoid unwanted charges, complete the steps in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace release

    If you released the design utilizing Amazon Bedrock Marketplace, complete the following actions:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace deployments.
  5. In the Managed implementations section, locate the endpoint you want to erase.
  6. Select the endpoint, and on the Actions menu, choose Delete.
  7. Verify the endpoint details to make certain you're deleting the right deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you released will sustain costs if you leave it running. Use the following code to erase the endpoint if you want to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we checked out how you can access and deploy the DeepSeek-R1 model utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get begun. 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 going 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 develop ingenious options utilizing AWS services and accelerated calculate. Currently, he is concentrated on developing techniques for fine-tuning and enhancing the reasoning performance of big language models. In his spare time, Vivek enjoys treking, seeing movies, and trying various foods.

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

    Jonathan Evans is an Expert Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads product, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about developing options that assist consumers accelerate their AI journey and unlock service value.
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
No due date
0
Labels
None
Assign labels
  • View project labels
Reference: ardisphares21/tylerwesleywilliamson#1