Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Contribute to GitLab
  • Sign in / Register
S
stay-22
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Issues 27
    • Issues 27
    • 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
  • Antwan Flanagan
  • stay-22
  • Issues
  • #17

Closed
Open
Opened Apr 06, 2025 by Antwan Flanagan@antwanflanagan
  • Report abuse
  • New issue
Report abuse New issue

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


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, in addition to the distilled versions ranging from 1.5 to 70 billion criteria to develop, experiment, and properly 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 deploy the distilled variations of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) established by DeepSeek AI that utilizes support finding out to enhance thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential identifying function is its reinforcement knowing (RL) step, which was utilized to refine the design's responses beyond the standard pre-training and fine-tuning process. By integrating RL, DeepSeek-R1 can adapt more efficiently to user feedback and objectives, eventually boosting both relevance and clarity. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) method, implying it's equipped to break down intricate queries and reason through them in a detailed manner. This guided reasoning process allows the design to produce more precise, transparent, and detailed responses. This model combines RL-based fine-tuning with CoT abilities, aiming to create structured responses while concentrating on interpretability and user interaction. With its extensive capabilities DeepSeek-R1 has actually captured the market's attention as a flexible text-generation model that can be incorporated into various workflows such as agents, sensible thinking and data interpretation tasks.

DeepSeek-R1 uses a Mix 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 queries to the most pertinent professional "clusters." This technique enables the design to specialize in different issue domains while maintaining general performance. DeepSeek-R1 requires at least 800 GB of HBM memory in FP8 format for reasoning. In this post, we will utilize an ml.p5e.48 xlarge circumstances to release the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the thinking abilities of the main R1 design to more efficient architectures based upon popular open models like Qwen (1.5 B, 7B, 14B, and 32B) and Llama (8B and 70B). Distillation describes a procedure of training smaller, more effective designs to mimic the behavior and reasoning patterns of the larger DeepSeek-R1 design, using it as a teacher model.

You can release DeepSeek-R1 model 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 site, we will utilize Amazon Bedrock Guardrails to present safeguards, prevent harmful content, and assess designs against key safety criteria. At the time of writing 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 use cases and apply them to the DeepSeek-R1 model, improving user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 model, 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, pick Amazon SageMaker, and confirm 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 deploying. To request a limitation boost, create a limit boost demand and connect to your account group.

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) consents to use Amazon Bedrock Guardrails. For instructions, see Set up approvals to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to present safeguards, avoid harmful content, and evaluate models against essential security criteria. You can execute precaution for the DeepSeek-R1 design utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to assess user inputs and design actions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can produce a guardrail utilizing 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 steps: First, the system receives 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 model for reasoning. After receiving the design's output, another guardrail check is applied. If the output passes this last check, it's returned as the outcome. 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 took place at the input or output phase. The examples showcased in the following areas show inference utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives 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 actions:

1. On the Amazon Bedrock console, pick Model brochure under Foundation models in the navigation pane. At the time of composing this post, you can utilize the InvokeModel API to invoke the model. 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 model detail page offers important details about the design's abilities, prices structure, and implementation guidelines. You can find detailed usage directions, consisting of sample API calls and code snippets for integration. The model supports numerous text generation jobs, consisting of content production, code generation, and question answering, utilizing its reinforcement finding out optimization and CoT thinking abilities. The page also includes release alternatives and licensing details to help you get going with DeepSeek-R1 in your applications. 3. To start using DeepSeek-R1, pick Deploy.

You will be triggered to configure the deployment details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, enter an endpoint name (between 1-50 alphanumeric characters). 5. For Number of instances, get in a number of circumstances (between 1-100). 6. For Instance type, select your instance type. For optimum performance with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can configure sophisticated security and infrastructure settings, including virtual personal cloud (VPC) networking, service role authorizations, and file encryption settings. For a lot of utilize cases, the default settings will work well. However, for production implementations, you may wish to examine these settings to align with your organization's security and compliance requirements. 7. Choose Deploy to begin using the design.

When the release is complete, you can test DeepSeek-R1's abilities straight in the Amazon Bedrock play area. 8. Choose Open in playground to access an interactive interface where you can experiment with various prompts and adjust 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, content for inference.

This is an outstanding way to check out the model's reasoning and text generation abilities before incorporating it into your applications. The play ground provides immediate feedback, helping you comprehend how the model reacts to different inputs and letting you fine-tune your triggers for ideal results.

You can quickly evaluate the model in the play area through the UI. However, to conjure up the deployed model 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 reasoning using a released DeepSeek-R1 design through Amazon Bedrock using the invoke_model and ApplyGuardrail API. You can produce 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 created the guardrail, use the following code to execute guardrails. The script initializes the bedrock_runtime customer, configures reasoning specifications, 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 deploy 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 design through SageMaker JumpStart uses 2 convenient techniques: utilizing the user-friendly SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let's check out both methods to help you select the approach that best fits your needs.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

4. Look for DeepSeek-R1 to view the DeepSeek-R1 model card. Each model card shows crucial details, including:

- Model name

  • Provider name
  • Task category (for example, Text Generation). Bedrock Ready badge (if appropriate), showing that this design can be signed up with Amazon Bedrock, allowing you to utilize Amazon Bedrock APIs to invoke the design

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

    The model details page includes the following details:

    - The design name and supplier details. Deploy button to release the model. 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 suggested to examine the design details and license terms to verify compatibility with your use case.

    6. Choose Deploy to continue with deployment.

    7. For Endpoint name, use the instantly created name or create a customized one.
  1. For example choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, enter the number of instances (default: 1). Selecting suitable circumstances types and counts is crucial for expense and performance optimization. Monitor your deployment to change these settings as needed.Under Inference type, Real-time inference is chosen by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for accuracy. For this model, we highly advise sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to deploy the model.

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

    When implementation is total, your endpoint status will change to InService. At this moment, the model is prepared to accept inference requests through the endpoint. You can keep an eye on the implementation development 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 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 need to set up the SageMaker Python SDK and make certain you have the essential AWS consents and environment setup. The following is a detailed code example that shows how to release and use DeepSeek-R1 for reasoning programmatically. The code for releasing the model is offered in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run extra demands against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

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

    Clean up

    To avoid undesirable charges, finish the steps in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you deployed the design using Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace implementations.
  5. In the Managed implementations area, locate 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 appropriate release: 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 want to stop sustaining charges. For more details, see Delete Endpoints and Resources.

    Conclusion

    In this post, we explored 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, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Beginning 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 develop ingenious services using AWS services and accelerated compute. Currently, he is concentrated on developing strategies for fine-tuning and optimizing the inference efficiency of big language models. In his complimentary time, Vivek delights in hiking, watching motion pictures, and trying different 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 a Professional Solutions Architect dealing with generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads item, engineering, and strategic collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about constructing solutions that help clients accelerate their AI journey and unlock business 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: antwanflanagan/stay-22#17