Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in / Register
V
vloglover
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Issues 14
    • Issues 14
    • 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
  • Denis Tuck
  • vloglover
  • Issues
  • #5

Closed
Open
Opened Feb 08, 2025 by Denis Tuck@denistuck87215
  • 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 release DeepSeek AI's first-generation frontier design, DeepSeek-R1, in addition to the distilled variations varying from 1.5 to 70 billion specifications to develop, 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 versions of the designs too.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that utilizes reinforcement learning to boost thinking capabilities through a multi-stage training procedure from a DeepSeek-V3-Base foundation. An essential distinguishing function is its reinforcement knowing (RL) step, which was utilized to fine-tune the design's responses beyond the basic pre-training and tweak procedure. By incorporating RL, DeepSeek-R1 can adjust better to user feedback and objectives, ultimately improving both relevance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, suggesting it's equipped to break down intricate queries and factor through them in a detailed way. This directed thinking process enables the model to produce more accurate, transparent, and detailed answers. This model integrates RL-based fine-tuning with CoT capabilities, aiming to produce structured reactions while focusing on interpretability and user interaction. With its extensive abilities DeepSeek-R1 has captured the industry's attention as a flexible text-generation design that can be incorporated into numerous workflows such as agents, logical reasoning and information interpretation jobs.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion criteria, allowing efficient inference by routing queries to the most relevant specialist "clusters." This method allows the design to concentrate on various problem domains while maintaining total performance. DeepSeek-R1 needs 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 deploy the design. ml.p5e.48 xlarge features 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the thinking abilities 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 designs to simulate the behavior and reasoning patterns of the bigger DeepSeek-R1 model, utilizing it as an instructor model.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we recommend deploying this design with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to present safeguards, prevent damaging material, and examine models against key safety requirements. At the time of composing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce multiple guardrails tailored to different use cases and apply them to the DeepSeek-R1 design, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To deploy 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 verify you're utilizing ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are releasing. To request a limit boost, develop a limitation boost request and reach out to your account group.

Because you will be deploying this design with Amazon Bedrock Guardrails, pipewiki.org make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) approvals to use Amazon Bedrock Guardrails. For directions, see Set up permissions to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails allows you to introduce safeguards, prevent damaging material, and evaluate designs against essential security requirements. You can implement precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to examine user inputs and model actions released on Amazon Bedrock Marketplace and SageMaker JumpStart. 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.

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 design 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 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 happened at the input or output stage. The examples showcased in the following areas demonstrate inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

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

1. On the Amazon Bedrock console, pick Model brochure under Foundation designs 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 provider and choose the DeepSeek-R1 design.

The model detail page supplies important details about the model's capabilities, prices structure, and execution standards. You can discover detailed use directions, including sample API calls and code bits for integration. The model supports different text generation tasks, including material development, code generation, and concern answering, using its support learning optimization and CoT reasoning capabilities. The page likewise consists of implementation alternatives and licensing details to assist you begin with DeepSeek-R1 in your applications. 3. To begin utilizing 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, go into an endpoint name (in between 1-50 alphanumeric characters). 5. For Number of circumstances, enter a variety of instances (between 1-100). 6. For Instance type, choose your instance type. For ideal efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can set up sophisticated security and facilities settings, including virtual private cloud (VPC) networking, service function authorizations, and encryption settings. For many utilize cases, the default settings will work well. However, for production deployments, you might wish to evaluate these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to start using the model.

When the deployment is total, you can check 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 triggers and adjust model criteria like temperature level and maximum length. When utilizing R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for optimal outcomes. For instance, content for inference.

This is an outstanding method to explore the design's thinking and text generation capabilities before incorporating it into your applications. The play ground provides instant feedback, assisting you understand how the model reacts to different inputs and letting you tweak your prompts for optimal outcomes.

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

Run reasoning utilizing guardrails with the deployed DeepSeek-R1 endpoint

The following code example demonstrates how to perform inference utilizing a released DeepSeek-R1 model through Amazon Bedrock using the invoke_model and ApplyGuardrail API. 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. After you have created the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime client, sets up reasoning specifications, and sends out a demand to generate text based upon a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) center with FMs, integrated algorithms, and prebuilt ML options that you can deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs to your use case, with your information, and deploy them into production using either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart offers two convenient approaches: utilizing the intuitive SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let's explore both approaches to assist you pick the method 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, select Studio in the navigation pane. 2. First-time users will be prompted to create a domain. 3. On the SageMaker Studio console, choose JumpStart in the navigation pane.

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

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

- Model name

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

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

    The model details page consists of the following details:

    - The design name and company details. Deploy button to deploy 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 deploy the design, it's advised to review the model details and license terms to verify compatibility with your usage case.

    6. Choose Deploy to continue with deployment.

    7. For raovatonline.org Endpoint name, utilize the immediately produced name or produce a custom one.
  1. For example type ¸ select a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the number of circumstances (default: 1). Selecting proper circumstances types and counts is crucial for cost and efficiency optimization. Monitor your release 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 precision. For this design, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in location.
  4. Choose Deploy to release the design.

    The deployment process can take a number of minutes to finish.

    When deployment is total, your endpoint status will alter to InService. At this moment, the design is prepared to accept reasoning demands through the endpoint. You can keep track of the deployment development on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the deployment is total, you can invoke the model using a SageMaker runtime customer and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To start with DeepSeek-R1 utilizing the SageMaker Python SDK, you will need to set up the SageMaker Python SDK and make certain you have the required AWS permissions and environment setup. The following is a detailed code example that demonstrates how to deploy and use DeepSeek-R1 for reasoning programmatically. The code for releasing the design is provided in the Github here. You can clone the note pad and run 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 utilizing the Amazon Bedrock console or the API, and implement it as shown in the following code:

    Clean up

    To prevent unwanted charges, complete the steps in this section to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

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

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, choose Marketplace releases.
  5. In the Managed deployments area, find 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: gratisafhalen.be 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 delete the endpoint if you wish 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 design utilizing Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, refer to 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 assists emerging generative AI business construct innovative options utilizing AWS services and sped up calculate. Currently, he is focused on developing methods for fine-tuning and optimizing the inference performance of large language designs. In his leisure time, Vivek takes pleasure in hiking, seeing films, and attempting 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 technology and Bioinformatics.

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

    Banu Nagasundaram leads item, engineering, and tactical collaborations for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI center. She is enthusiastic about constructing options that assist clients accelerate their AI journey and unlock organization 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: denistuck87215/vloglover#5