Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
M
modulysa
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 9
    • Issues 9
    • 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
    • CI / CD
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
  • Denisha Crumley
  • modulysa
  • Issues
  • #2

Closed
Open
Opened Feb 06, 2025 by Denisha Crumley@denishacrumleyMaintainer
  • Report abuse
  • New issue
Report abuse New issue

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

In this post, we demonstrate how to get begun with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow comparable actions to deploy the distilled variations of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) established by DeepSeek AI that uses reinforcement finding out to boost thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base structure. A key identifying function is its support knowing (RL) action, which was utilized to improve the model's reactions beyond the basic pre-training and fine-tuning procedure. By integrating RL, DeepSeek-R1 can adapt better to user feedback and goals, ultimately boosting both significance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) method, implying it's equipped to break down complex questions and factor through them in a detailed manner. This assisted reasoning process enables the design to produce more accurate, transparent, and detailed answers. This model combines RL-based fine-tuning with CoT capabilities, aiming to generate structured responses while focusing on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has actually captured the industry's attention as a versatile text-generation model that can be incorporated into various workflows such as representatives, rational reasoning and information analysis tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion criteria in size. The MoE architecture permits activation of 37 billion parameters, making it possible for effective inference by routing inquiries to the most appropriate professional "clusters." This method permits the design to focus on various issue domains while maintaining overall efficiency. DeepSeek-R1 requires at least 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 model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs supplying 1128 GB of GPU memory.

DeepSeek-R1 distilled designs bring the reasoning abilities 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 describes a procedure of training smaller sized, more efficient designs to simulate the habits and thinking patterns of the larger DeepSeek-R1 model, using it as an instructor design.

You can deploy DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest deploying this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid damaging content, and examine models against essential safety criteria. At the time of writing this blog, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can create several guardrails tailored to different usage cases and apply them to the DeepSeek-R1 design, improving user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, you need access to an ml.p5e circumstances. To examine if you have quotas for P5e, open the Service Quotas console and under AWS Services, select Amazon SageMaker, and validate you're utilizing ml.p5e.48 xlarge for endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are releasing. To ask for a limit boost, produce a limitation boost request and connect to your account group.

Because you will be releasing this design with Amazon Bedrock Guardrails, make certain you have the right AWS Identity and Gain Access To Management (IAM) consents to utilize Amazon Bedrock Guardrails. For instructions, see Set up consents to utilize guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, prevent harmful material, and evaluate models against key security requirements. You can implement security steps for the DeepSeek-R1 model using the Amazon Bedrock ApplyGuardrail API. This allows you to use guardrails to examine user inputs and design reactions 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 produce the guardrail, see the GitHub repo.

The general circulation includes the following steps: links.gtanet.com.br 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 out to the design for reasoning. After getting the design's output, another guardrail check is used. If the output passes this final check, it's returned as the result. However, links.gtanet.com.br 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 took place at the input or output phase. The examples showcased in the following sections demonstrate reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides 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, select Model brochure under Foundation designs in the navigation pane. At the time of writing this post, you can use the InvokeModel API to invoke the design. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a company and select the DeepSeek-R1 design.

The model detail page offers necessary details about the design's abilities, pricing structure, and execution guidelines. You can discover detailed usage instructions, including sample API calls and code snippets for combination. The model supports various text generation jobs, including material production, code generation, and concern answering, utilizing its reinforcement learning optimization and CoT reasoning capabilities. The page also includes implementation alternatives and licensing details to assist you begin with DeepSeek-R1 in your applications. 3. To begin using DeepSeek-R1, select Deploy.

You will be triggered to set up the implementation 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 circumstances, get in a number of circumstances (between 1-100). 6. For Instance type, systemcheck-wiki.de pick your circumstances type. For optimum performance with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, you can configure innovative security and infrastructure settings, consisting of virtual personal cloud (VPC) networking, service function approvals, and file encryption settings. For the majority of utilize cases, the default settings will work well. However, for production releases, you may want to evaluate these settings to line up with your company's security and compliance requirements. 7. Choose Deploy to begin using the model.

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

This is an excellent way to check out the model's reasoning and text generation abilities before incorporating it into your applications. The play ground provides immediate feedback, assisting you understand how the model reacts to numerous inputs and letting you tweak your triggers for optimum results.

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 inference utilizing guardrails with the released DeepSeek-R1 endpoint

The following code example demonstrates how to carry out reasoning using a released DeepSeek-R1 model 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 create the guardrail, see the GitHub repo. After you have actually produced the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime customer, sets up inference criteria, and sends a request to produce text based upon a user prompt.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, integrated algorithms, and prebuilt ML services 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 release them into production utilizing either the UI or SDK.

Deploying DeepSeek-R1 model through SageMaker JumpStart provides two practical techniques: using the intuitive SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both methods to help you choose the approach that finest suits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

1. On the SageMaker console, choose Studio in the navigation pane. 2. First-time users will be prompted to develop a domain. 3. On the SageMaker Studio console, select JumpStart in the navigation pane.

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

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

- Model name

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

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

    The model details page consists of the following details:

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

    The About tab consists of crucial details, such as:

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

    Before you release the model, it's recommended to evaluate the design details and license terms to confirm compatibility with your use case.

    6. Choose Deploy to proceed with release.

    7. For Endpoint name, utilize the instantly produced name or produce a custom-made one.
  1. For Instance type ¸ choose an instance type (default: ml.p5e.48 xlarge).
  2. For Initial instance count, get in the number of circumstances (default: 1). Selecting proper circumstances types and counts is crucial 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 optimized for sustained traffic and low latency.
  3. Review all configurations for precision. For this model, we strongly recommend sticking to SageMaker JumpStart default settings and making certain that network seclusion remains in place.
  4. Choose Deploy to release the design.

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

    When is complete, your endpoint status will alter to InService. At this point, the model is prepared to accept inference requests through the endpoint. You can monitor the implementation progress on the SageMaker console Endpoints page, which will show pertinent metrics and status details. When the implementation is complete, you can conjure up the model using a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 utilizing the SageMaker Python SDK

    To begin with DeepSeek-R1 utilizing 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 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 run from SageMaker Studio.

    You can run extra demands 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 produce a guardrail utilizing the Amazon Bedrock console or the API, and execute it as revealed in the following code:

    Tidy up

    To avoid undesirable charges, finish the steps in this section to clean up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you deployed the model utilizing Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, it-viking.ch choose Marketplace deployments.
  5. In the Managed releases area, find 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 deleting the proper implementation: 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 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 deploy the DeepSeek-R1 model using 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 companies construct innovative solutions utilizing AWS services and accelerated calculate. Currently, he is concentrated on developing methods for fine-tuning and optimizing the reasoning efficiency of big language models. In his downtime, Vivek enjoys treking, enjoying movies, and trying various cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science group at AWS. His location 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 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 hub. She is passionate about developing options that assist clients accelerate their AI journey and unlock business value.
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: denishacrumley/modulysa#2