DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
Adrian Franco muokkasi tätä sivua 1 viikko sitten


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, along with the distilled versions varying from 1.5 to 70 billion specifications to develop, experiment, and properly scale your generative AI concepts 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 models as well.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that uses reinforcement learning to improve thinking capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key differentiating feature is its reinforcement knowing (RL) step, which was used to improve the design’s responses beyond the standard pre-training and fine-tuning procedure. By incorporating RL, DeepSeek-R1 can adapt better to user feedback and objectives, ultimately improving both importance and clarity. In addition, DeepSeek-R1 uses a chain-of-thought (CoT) approach, meaning it’s geared up to break down complicated questions and factor through them in a detailed manner. This guided reasoning process allows the design to produce more accurate, transparent, and detailed responses. This design combines RL-based fine-tuning with CoT capabilities, aiming to create structured actions while concentrating on interpretability and user interaction. With its wide-ranging abilities DeepSeek-R1 has recorded the industry’s attention as a flexible text-generation design that can be incorporated into different workflows such as representatives, logical reasoning and data interpretation tasks.

DeepSeek-R1 utilizes a Mix of Experts (MoE) architecture and is 671 billion in size. The MoE architecture permits activation of 37 billion criteria, allowing effective reasoning by routing questions to the most pertinent specialist “clusters.” This technique permits the model to concentrate on different 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 utilize an ml.p5e.48 xlarge instance to deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs offering 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning capabilities of the main R1 model 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 process of training smaller sized, more effective models to mimic the habits and reasoning patterns of the bigger DeepSeek-R1 design, utilizing it as a teacher design.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we advise releasing this design with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to introduce safeguards, avoid hazardous content, and evaluate designs against crucial security requirements. 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, enhancing user experiences and standardizing safety controls across your generative AI applications.

Prerequisites

To deploy the DeepSeek-R1 model, you need access to an ml.p5e instance. To inspect if you have quotas for P5e, open the Service Quotas console and under AWS Services, pick Amazon SageMaker, and verify you’re using ml.p5e.48 xlarge for pipewiki.org endpoint usage. Make certain that you have at least one ml.P5e.48 xlarge circumstances in the AWS Region you are deploying. To ask for a limit boost, produce a limit increase demand and connect to your account team.

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

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails enables you to introduce safeguards, prevent harmful content, and evaluate models against essential security requirements. You can execute security steps for the DeepSeek-R1 design using the Amazon Bedrock ApplyGuardrail API. This enables you to use guardrails to assess user inputs and model actions deployed on Amazon Bedrock Marketplace and SageMaker JumpStart. You can develop a guardrail using 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: 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 model for wiki.eqoarevival.com reasoning. After getting the design’s output, another guardrail check is used. If the output passes this final check, it’s returned as the final result. However, if either the input or output is stepped in by the guardrail, a message is returned indicating the nature of the intervention and bytes-the-dust.com whether it happened at the input or output phase. The examples showcased in the following areas demonstrate inference using this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace gives you access to over 100 popular, emerging, and specialized structure 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 designs in the navigation pane. At the time of writing this post, you can utilize the InvokeModel API to conjure up the design. It doesn’t support Converse APIs and other Amazon Bedrock tooling.

  1. Filter for DeepSeek as a company and pick the DeepSeek-R1 model.

    The model detail page offers vital details about the design’s abilities, pricing structure, and application guidelines. You can discover detailed usage guidelines, including sample API calls and code snippets for combination. The design supports various text generation tasks, consisting of material creation, code generation, and question answering, using its reinforcement learning optimization and CoT thinking capabilities. The page likewise includes release options and licensing details to help you begin with DeepSeek-R1 in your applications.
  2. To start utilizing DeepSeek-R1, select Deploy.

    You will be triggered to configure the release details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, go into an endpoint name (between 1-50 alphanumeric characters).
  4. For Number of circumstances, get in a number of instances (between 1-100).
  5. For example type, select your circumstances type. For optimum efficiency with DeepSeek-R1, a GPU-based circumstances type like ml.p5e.48 xlarge is recommended. Optionally, you can configure sophisticated security and facilities settings, consisting of virtual private cloud (VPC) networking, service role authorizations, and file encryption settings. For most use cases, the default settings will work well. However, for production implementations, you may want to review these settings to align with your company’s security and compliance requirements.
  6. Choose Deploy to begin utilizing the design.

    When the deployment is total, you can test DeepSeek-R1’s abilities straight in the Amazon Bedrock playground.
  7. Choose Open in play ground to access an interactive user interface where you can try out different prompts and change design parameters like temperature level and maximum length. When using R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat design template for ideal outcomes. For example, content for reasoning.

    This is an exceptional method to explore the model’s reasoning and text generation abilities before integrating it into your applications. The playground offers instant feedback, helping you comprehend how the model responds to numerous inputs and letting you fine-tune your prompts for optimal results.

    You can rapidly check the model in the play ground through the UI. However, to conjure up the deployed design 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 demonstrates how to carry out reasoning using a released DeepSeek-R1 design 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 develop the guardrail, see the GitHub repo. After you have actually created the guardrail, use the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up reasoning parameters, and sends a demand to create text based on a user prompt.

    Deploy DeepSeek-R1 with SageMaker JumpStart

    SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, integrated algorithms, and prebuilt ML options that you can release with simply a few clicks. With SageMaker JumpStart, you can tailor pre-trained models to your use case, with your data, and deploy them into production utilizing either the UI or SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart offers 2 practical methods: utilizing the user-friendly SageMaker JumpStart UI or executing programmatically through the SageMaker Python SDK. Let’s check out both methods to assist you pick the approach that best matches your needs.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

    Complete the following steps to release DeepSeek-R1 utilizing SageMaker JumpStart:

    1. On the SageMaker console, select Studio in the navigation pane.
  8. First-time users will be triggered to produce a domain.
  9. On the SageMaker Studio console, pick JumpStart in the navigation pane.

    The model internet browser shows available designs, with details like the supplier name and model capabilities.

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

    - Model name
  10. Provider name
  11. Task classification (for instance, Text Generation). Bedrock Ready badge (if suitable), suggesting that this design can be signed up with Amazon Bedrock, enabling you to utilize Amazon Bedrock APIs to conjure up the model

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

    The model details page includes 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 includes important details, such as:

    - Model description.
  12. License details.
  13. Technical specs.
  14. Usage guidelines

    Before you deploy the model, it’s advised to examine the model details and license terms to confirm compatibility with your use case.

    6. Choose Deploy to proceed with implementation.

    7. For Endpoint name, utilize the immediately created name or develop a custom-made one.
  15. For Instance type ¸ select an instance type (default: ml.p5e.48 xlarge).
  16. For Initial instance count, enter the number of circumstances (default: 1). Selecting suitable circumstances types and counts is vital for expense and efficiency optimization. Monitor your implementation to adjust these settings as needed.Under Inference type, Real-time reasoning is selected by default. This is enhanced for sustained traffic and low latency.
  17. Review all setups for precision. For this model, we highly suggest sticking to SageMaker JumpStart default settings and making certain that network isolation remains in place.
  18. Choose Deploy to release the model.

    The deployment procedure can take several minutes to finish.

    When deployment is complete, your endpoint status will change to InService. At this point, the design is ready 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 appropriate metrics and status details. When the release is complete, you can conjure up the design utilizing a SageMaker runtime client and incorporate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To get going with DeepSeek-R1 utilizing the SageMaker Python SDK, you will require to install the SageMaker Python SDK and make certain you have the necessary AWS permissions and environment setup. The following is a detailed code example that demonstrates how to release and utilize DeepSeek-R1 for reasoning programmatically. The code for deploying the design is offered in the Github here. You can clone the notebook and range from SageMaker Studio.

    You can run extra requests against the predictor:

    Implement guardrails and run inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise utilize the ApplyGuardrail API with your SageMaker JumpStart predictor. You can develop a guardrail utilizing the Amazon Bedrock console or the API, and execute it as displayed in the following code:

    Clean up

    To prevent undesirable charges, complete the steps in this area to tidy up your resources.

    Delete the Amazon Bedrock Marketplace deployment

    If you deployed the model using Amazon Bedrock Marketplace, total the following actions:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, pick Marketplace releases.
  19. In the Managed implementations area, find the endpoint you desire to erase.
  20. Select the endpoint, and on the Actions menu, pick Delete.
  21. Verify the endpoint details to make certain you’re erasing the right deployment: 1. Endpoint name.
  22. Model name.
  23. Endpoint status

    Delete the SageMaker JumpStart predictor

    The SageMaker JumpStart design you released will sustain expenses 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 explored how you can access and deploy the DeepSeek-R1 model 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 designs, SageMaker JumpStart pretrained designs, 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 business build innovative solutions utilizing AWS services and accelerated calculate. Currently, he is concentrated on establishing strategies for fine-tuning and optimizing the reasoning efficiency of big language models. In his totally free time, Vivek enjoys hiking, viewing films, and attempting different cuisines.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team 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 dealing with 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 enthusiastic about constructing services that assist customers accelerate their AI journey and unlock service value.