Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
U ujaen
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar
  • Antoinette Rettig
  • ujaen
  • Issues
  • #13

Closed
Open
Created Feb 20, 2025 by Antoinette Rettig@antoinetterettMaintainer

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


Today, we are excited 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, in addition to the distilled variations varying from 1.5 to 70 billion specifications 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 comparable steps to release the distilled variations of the designs also.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language design (LLM) developed by DeepSeek AI that uses reinforcement discovering to enhance reasoning capabilities through a multi-stage training process from a DeepSeek-V3-Base structure. An essential distinguishing function is its support knowing (RL) step, which was used to fine-tune the design's responses beyond the standard pre-training and tweak procedure. By including RL, DeepSeek-R1 can adapt better to user feedback and objectives, eventually boosting both significance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, implying it's geared up to break down intricate queries and reason through them in a detailed manner. This guided reasoning procedure allows the design to produce more precise, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT abilities, aiming to generate structured reactions while focusing on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has actually caught the market's attention as a flexible text-generation design that can be integrated into various workflows such as agents, sensible reasoning and data analysis jobs.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture permits activation of 37 billion specifications, making it possible for efficient reasoning by routing questions to the most relevant specialist "clusters." This method allows the design to concentrate on different issue domains while maintaining overall effectiveness. 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 supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking capabilities of the main R1 model 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 efficient models to simulate the behavior and reasoning patterns of the bigger DeepSeek-R1 design, using it as an instructor design.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend releasing this design with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, prevent damaging material, and assess designs against essential security requirements. At the time of composing this blog site, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can develop several guardrails tailored to different usage cases and setiathome.berkeley.edu use them to the DeepSeek-R1 model, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you need access to an ml.p5e circumstances. To inspect if you have quotas for P5e, setiathome.berkeley.edu open the Service Quotas console and under AWS Services, pick 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 ask for a limit boost, produce a limit increase demand and connect to your account group.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, avoid harmful material, and assess designs against crucial security criteria. You can execute safety procedures for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and design reactions released on Amazon Bedrock Marketplace and wavedream.wiki SageMaker JumpStart. You can develop a guardrail using the Amazon Bedrock console or the API. For the example code to develop the guardrail, see the GitHub repo.

The basic flow involves 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 out to the model for reasoning. After receiving the model's output, another guardrail check is applied. If the output passes this last check, it's returned as the final result. However, if either the input or output is intervened by the guardrail, a message is returned suggesting the nature of the intervention and whether it took place at the input or output phase. The examples showcased in the following areas demonstrate inference utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace offers you access to over 100 popular, emerging, and specialized foundation models (FMs) through Amazon Bedrock. To gain access to DeepSeek-R1 in Amazon Bedrock, complete the following steps:

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

The model detail page provides essential details about the design's capabilities, prices structure, and implementation standards. You can find detailed usage directions, consisting of sample API calls and code bits for combination. The design supports different text generation jobs, consisting of development, code generation, and concern answering, utilizing its reinforcement discovering optimization and CoT reasoning capabilities. The page also includes implementation options and licensing details to assist you get going with DeepSeek-R1 in your applications. 3. To start utilizing DeepSeek-R1, pick Deploy.

You will be prompted to configure the implementation details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters). 5. For Variety of instances, get in a variety of circumstances (between 1-100). 6. For Instance type, pick your instance type. For ideal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is suggested. Optionally, you can configure innovative security and facilities settings, consisting of virtual private cloud (VPC) networking, service function authorizations, and file encryption settings. For most utilize cases, the default settings will work well. However, for production implementations, you might wish to review these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to begin utilizing the design.

When the release is complete, you can evaluate DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in play area to access an interactive user interface where you can try out various triggers and change model parameters like temperature and optimum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimum results. For instance, material for reasoning.

This is an outstanding method to check out the model's thinking and text generation abilities before integrating it into your applications. The play area supplies instant feedback, assisting you comprehend how the model reacts to different inputs and letting you fine-tune your prompts for optimum outcomes.

You can rapidly test the model in the play area through the UI. However, to conjure up the released 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 demonstrates how to carry out inference using a deployed DeepSeek-R1 model through Amazon Bedrock using 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 actually created the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up reasoning criteria, and sends a request to generate text based upon a user timely.

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 just a couple of clicks. With SageMaker JumpStart, you can tailor pre-trained models to your usage case, with your data, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart uses 2 practical methods: using the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both methods to assist you pick the technique 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, choose Studio in the navigation pane. 2. First-time users will be prompted to produce a domain. 3. On the SageMaker Studio console, choose JumpStart in the navigation pane.

The design web browser displays available designs, with details like the company name and design capabilities.

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

- Model name

  • Provider name
  • Task category (for instance, Text Generation). Bedrock Ready badge (if applicable), showing that this model can be registered with Amazon Bedrock, permitting you to use Amazon Bedrock APIs to invoke the design

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

    The design details page includes the following details:

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

    The About tab includes essential details, such as:

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

    Before you release the model, it's recommended to examine the model details and license terms to validate compatibility with your usage case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the immediately produced name or create a custom one.
  1. For example type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the variety of instances (default: 1). Selecting proper instance types and counts is vital for cost and performance optimization. Monitor your deployment to adjust these settings as needed.Under Inference type, Real-time inference is selected by default. This is enhanced for sustained traffic and low latency.
  3. Review all configurations for precision. For this model, we strongly advise sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to deploy the model.

    The implementation procedure can take numerous minutes to complete.

    When implementation is total, your endpoint status will alter to InService. At this point, the design is prepared to accept reasoning requests through the endpoint. You can keep an eye on the release progress on the SageMaker console Endpoints page, which will display pertinent metrics and status details. When the implementation 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 start with DeepSeek-R1 using the SageMaker Python SDK, you will need to install the SageMaker Python SDK and make certain you have the necessary AWS authorizations and environment setup. The following is a detailed code example that shows how to release and use DeepSeek-R1 for inference programmatically. The code for releasing the design is supplied in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run additional requests against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

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

    Clean up

    To prevent unwanted charges, complete 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, complete the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, choose Marketplace releases.
  5. In the Managed deployments section, 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 deleting the right deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you released will sustain costs if you leave it running. Use the following code to delete the endpoint if you desire 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 begin. 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 assists emerging generative AI companies construct innovative options utilizing AWS services and accelerated calculate. Currently, he is focused on establishing techniques for fine-tuning and optimizing the reasoning efficiency of big language models. In his free time, Vivek enjoys treking, seeing films, and attempting different cuisines.

    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 technology and Bioinformatics.

    Jonathan Evans is a Professional Solutions Architect working on generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and strategic partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is passionate about constructing services that assist customers accelerate their AI journey and unlock organization value.
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking