Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
W
wecomy
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 79
    • Issues 79
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
  • Ahmed Lucia
  • wecomy
  • Issues
  • #31

Closed
Open
Opened Apr 04, 2025 by Ahmed Lucia@ahmedlucia4256Maintainer
  • 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 designs 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 variations varying from 1.5 to 70 billion criteria to build, experiment, and responsibly scale your generative AI ideas 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 variations of the models as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a big language model (LLM) established by DeepSeek AI that uses support finding out to enhance thinking abilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. An essential identifying feature is its reinforcement learning (RL) step, which was utilized to refine the design's actions beyond the standard pre-training and fine-tuning procedure. By integrating RL, DeepSeek-R1 can adjust better to user feedback and objectives, eventually enhancing both relevance and clearness. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) technique, suggesting it's geared up to break down intricate inquiries and reason through them in a detailed way. This assisted reasoning process allows the model to produce more accurate, transparent, and detailed responses. This model integrates RL-based fine-tuning with CoT capabilities, aiming to generate structured actions while focusing on interpretability and user interaction. With its comprehensive abilities DeepSeek-R1 has actually recorded the market's attention as a flexible text-generation design that can be integrated into various workflows such as representatives, sensible reasoning and information interpretation tasks.

DeepSeek-R1 uses a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture allows activation of 37 billion specifications, making it possible for efficient inference by routing questions to the most appropriate professional "clusters." This technique enables the model to concentrate on various problem domains while maintaining general efficiency. DeepSeek-R1 needs a minimum of 800 GB of HBM memory in FP8 format for inference. In this post, we will use an ml.p5e.48 xlarge circumstances to release the model. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning capabilities of the main R1 design to more effective 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 imitate the habits and reasoning patterns of the bigger DeepSeek-R1 design, bytes-the-dust.com using it as an instructor design.

You can release DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we suggest releasing this model with guardrails in place. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid harmful content, and evaluate models against crucial safety criteria. At the time of writing this blog, for DeepSeek-R1 implementations on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can develop multiple guardrails tailored to various use cases and use them to the DeepSeek-R1 design, improving user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you require access to an ml.p5e circumstances. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and verify you're utilizing 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, develop a limit boost 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) permissions to use Amazon Bedrock Guardrails. For guidelines, see Set up authorizations to use guardrails for material filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to introduce safeguards, avoid hazardous content, and assess designs against crucial safety requirements. You can carry out security measures for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This permits you to apply guardrails to examine user inputs and design responses deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can create a guardrail utilizing the Amazon Bedrock console or the API. For the example code to produce the guardrail, see the GitHub repo.

The basic flow includes 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 design's output, another guardrail check is applied. 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 indicating the nature of the intervention and whether it occurred at the input or output phase. The examples showcased in the following areas demonstrate reasoning using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

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

1. On the Amazon Bedrock console, select Model catalog under Foundation models in the navigation pane. At the time of writing 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 service provider and choose the DeepSeek-R1 design.

The design detail page provides necessary details about the model's abilities, prices structure, and implementation guidelines. You can discover detailed use instructions, including sample API calls and code snippets for combination. The design supports different text generation tasks, including material production, code generation, and concern answering, utilizing its reinforcement learning optimization and CoT thinking abilities. The page likewise includes implementation options and licensing details to help you start with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, pick Deploy.

You will be prompted to set up the deployment details for DeepSeek-R1. The design ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (between 1-50 characters). 5. For Number of circumstances, enter a number of circumstances (between 1-100). 6. For Instance type, choose your instance type. For ideal performance 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 personal cloud (VPC) networking, service function consents, and encryption settings. For many use cases, the default settings will work well. However, for production deployments, you may desire to examine these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start using the model.

When the release is complete, you can check DeepSeek-R1's abilities straight in the Amazon Bedrock play ground. 8. Choose Open in play ground to access an interactive user interface where you can try out different triggers and adjust model criteria like temperature level and maximum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for ideal results. For example, material for reasoning.

This is an excellent way to explore the design's thinking and text generation abilities before incorporating it into your applications. The play ground offers immediate feedback, helping you understand how the model reacts to various inputs and letting you tweak your prompts for optimum results.

You can rapidly check the model in the playground through the UI. However, to invoke the released design programmatically with any Amazon Bedrock APIs, you need to get the endpoint ARN.

Run inference using guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to perform reasoning utilizing a released 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, use the following code to carry out guardrails. The script initializes the bedrock_runtime client, configures inference criteria, and sends out a demand to create 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 services 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 data, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 design through SageMaker JumpStart uses 2 hassle-free approaches: utilizing the intuitive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both methods to help you pick the approach that finest fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

Complete the following steps 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 create a domain. 3. On the SageMaker Studio console, select JumpStart in the navigation pane.

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

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

- Model name

  • Provider name
  • Task category (for instance, Text Generation). Bedrock Ready badge (if applicable), indicating that this design can be signed up with Amazon Bedrock, enabling you to use Amazon Bedrock APIs to conjure up the design

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

    The design details page consists of the following details:

    - The design name and supplier details. Deploy button to release the design. 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 deploy the model, it's suggested to examine the design details and license terms to confirm compatibility with your usage case.

    6. Choose Deploy to proceed with deployment.

    7. For Endpoint name, use the automatically produced name or produce a custom-made one.
  1. For example type ¸ pick an instance type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the variety of circumstances (default: 1). Selecting appropriate instance types and counts is essential for cost and efficiency optimization. Monitor your deployment to adjust these settings as needed.Under Inference type, Real-time reasoning is chosen by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for accuracy. For this model, we strongly advise sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to release the model.

    The deployment procedure can take several minutes to finish.

    When deployment is total, your endpoint status will change to InService. At this point, the design is prepared to accept reasoning demands through the endpoint. You can monitor the implementation development on the SageMaker console Endpoints page, which will display relevant metrics and status details. When the release is complete, you can conjure up the model using a SageMaker runtime customer and integrate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To get started with DeepSeek-R1 using the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the needed AWS approvals 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 model is offered in the Github here. You can clone the notebook 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 develop a guardrail utilizing the Amazon Bedrock console or the API, and implement it as revealed in the following code:

    Tidy up

    To prevent unwanted charges, finish the steps in this area to clean 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, choose Marketplace releases.
  5. In the Managed deployments area, locate the endpoint you wish to erase.
  6. Select the endpoint, and on the Actions menu, select Delete.
  7. Verify the endpoint details to make certain you're erasing the correct deployment: 1. Endpoint name.
  8. Model name.
  9. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart model you deployed will sustain costs if you leave it running. Use the following code to erase 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 deploy the DeepSeek-R1 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get started. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained designs, Amazon SageMaker JumpStart Foundation Models, Amazon Bedrock Marketplace, and Starting with Amazon SageMaker JumpStart.

    About the Authors

    Vivek Gangasani is a Lead Specialist Solutions Architect for Inference at AWS. He helps emerging generative AI business develop ingenious options utilizing AWS services and accelerated calculate. Currently, he is focused on developing methods for fine-tuning and optimizing the inference performance of big language models. In his downtime, Vivek enjoys hiking, seeing motion pictures, 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 a Professional Solutions Architect dealing with generative AI with the Third-Party Model Science team at AWS.

    Banu Nagasundaram leads item, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about constructing solutions that help consumers accelerate their AI journey and unlock organization value.
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: ahmedlucia4256/wecomy#31