1 DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
beavxy74897185 edited this page 3 months ago


Today, we are excited to announce that DeepSeek R1 distilled Llama and Qwen models are available through Amazon Bedrock Marketplace and Amazon SageMaker JumpStart. With this launch, you can now release DeepSeek AI's first-generation frontier model, DeepSeek-R1, in addition to the distilled versions ranging from 1.5 to 70 billion specifications to build, pipewiki.org experiment, and properly scale your generative AI concepts on AWS.

In this post, we show how to get started with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar actions to release the distilled versions of the models also.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language design (LLM) developed by DeepSeek AI that utilizes reinforcement discovering to improve reasoning capabilities through a multi-stage training process from a DeepSeek-V3-Base foundation. A key differentiating feature is its support knowing (RL) action, which was used to refine the design's actions beyond the standard pre-training and fine-tuning process. By including RL, DeepSeek-R1 can adjust more effectively to user feedback and objectives, eventually enhancing both importance and clearness. In addition, DeepSeek-R1 employs a chain-of-thought (CoT) approach, suggesting it's equipped to break down complicated questions and reason through them in a detailed way. This guided reasoning process allows the design to produce more precise, transparent, and detailed answers. This design integrates RL-based with CoT abilities, aiming to generate structured responses while focusing on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has recorded the market's attention as a versatile text-generation design that can be integrated into numerous workflows such as representatives, rational thinking and information interpretation jobs.

DeepSeek-R1 uses a Mixture of Experts (MoE) architecture and is 671 billion specifications in size. The MoE architecture enables activation of 37 billion specifications, allowing effective reasoning by routing questions to the most pertinent expert "clusters." This technique allows the design to focus on various issue domains while maintaining total performance. 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 deploy the model. ml.p5e.48 xlarge includes 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled models 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 refers to a procedure of training smaller, more efficient designs to imitate the habits and thinking patterns of the bigger DeepSeek-R1 design, utilizing it as a teacher design.

You can deploy DeepSeek-R1 design either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging design, we advise releasing this model with guardrails in location. In this blog, we will use Amazon Bedrock Guardrails to introduce safeguards, prevent hazardous content, and examine designs against crucial safety criteria. At the time of writing this blog site, for DeepSeek-R1 releases on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports just the ApplyGuardrail API. You can produce several guardrails tailored to various use cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls across your generative AI applications.

Prerequisites

To release the DeepSeek-R1 design, wiki.asexuality.org 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, select Amazon SageMaker, and verify you're using ml.p5e.48 xlarge for endpoint use. Make certain that you have at least one ml.P5e.48 xlarge instance in the AWS Region you are releasing. To request a limitation boost, produce a limit boost request and reach out to your account team.

Because you will be releasing this design with Amazon Bedrock Guardrails, make certain you have the appropriate AWS Identity and Gain Access To Management (IAM) authorizations to use 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 present safeguards, avoid harmful material, and examine models against essential security criteria. You can carry out precaution for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This allows you to apply guardrails to assess user inputs and model actions deployed 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 create the guardrail, see the GitHub repo.

The general flow involves the following actions: 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 design for reasoning. After getting the model's output, another guardrail check is applied. If the output passes this final check, it's returned as the result. However, if either the input or output is intervened by the guardrail, a message is returned suggesting 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 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, complete the following actions:

1. On the Amazon Bedrock console, pick Model catalog under Foundation models in the navigation pane. At the time of composing this post, pediascape.science you can utilize the InvokeModel API to conjure up the model. It doesn't support Converse APIs and other Amazon Bedrock tooling. 2. Filter for DeepSeek as a provider and pick the DeepSeek-R1 design.

The design detail page provides essential details about the design's abilities, pricing structure, and execution guidelines. You can find detailed usage directions, including sample API calls and code bits for integration. The model supports various text generation jobs, consisting of content production, disgaeawiki.info code generation, and question answering, utilizing its reinforcement learning optimization and CoT thinking abilities. The page also includes release alternatives and licensing details to help you begin with DeepSeek-R1 in your applications. 3. To begin utilizing DeepSeek-R1, select Deploy.

You will be triggered to set up the implementation details for DeepSeek-R1. The model ID will be pre-populated. 4. For Endpoint name, get in an endpoint name (between 1-50 alphanumeric characters). 5. For Variety of circumstances, go into a number of circumstances (in between 1-100). 6. For example type, choose your circumstances type. For optimal efficiency with DeepSeek-R1, a GPU-based instance type like ml.p5e.48 xlarge is advised. Optionally, you can set up sophisticated security and infrastructure settings, consisting of virtual private cloud (VPC) networking, service role permissions, and encryption settings. For a lot of use cases, the default settings will work well. However, for production implementations, you might wish to evaluate these settings to align with your company's security and compliance requirements. 7. Choose Deploy to start utilizing the design.

When the implementation is total, you can test 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 experiment with different triggers and adjust model specifications like temperature level and optimum length. When using R1 with Bedrock's InvokeModel and Playground Console, use DeepSeek's chat template for ideal outcomes. For instance, content for inference.

This is an exceptional method to explore the model's thinking and text generation capabilities before incorporating it into your applications. The play area provides immediate feedback, assisting you understand how the model responds to various inputs and letting you fine-tune your triggers for ideal outcomes.

You can rapidly evaluate the design 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 utilizing a deployed 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 develop the guardrail, see the GitHub repo. After you have produced the guardrail, utilize the following code to implement guardrails. The script initializes the bedrock_runtime customer, sets up inference criteria, and sends a demand to produce text based on a user timely.

Deploy DeepSeek-R1 with SageMaker JumpStart

SageMaker JumpStart is an artificial intelligence (ML) hub with FMs, built-in algorithms, and prebuilt ML services that you can deploy with just a few clicks. With SageMaker JumpStart, you can tailor pre-trained designs 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 two hassle-free approaches: utilizing the user-friendly SageMaker JumpStart UI or implementing programmatically through the SageMaker Python SDK. Let's check out both approaches to assist you select the method that best fits your requirements.

Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

The model internet browser shows 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 crucial details, consisting of:

- Model name

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

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

    The model details page consists of the following details:

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

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, utilize the automatically created name or produce a custom one.
  1. For Instance type ¸ choose a circumstances type (default: ml.p5e.48 xlarge).
  2. For Initial circumstances count, get in the number of instances (default: 1). Selecting proper instance types and counts is important for cost and performance optimization. Monitor your release to adjust these settings as needed.Under Inference type, Real-time inference is picked by default. This is enhanced for sustained traffic and low latency.
  3. Review all setups for accuracy. For this design, we highly recommend adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  4. Choose Deploy to deploy the model.

    The implementation process can take numerous minutes to complete.

    When deployment is total, your endpoint status will alter to InService. At this point, the model is ready to accept inference demands through the endpoint. You can keep an eye on the release development on the SageMaker console Endpoints page, which will display appropriate metrics and status details. When the deployment is total, you can conjure up the design utilizing a SageMaker runtime customer 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 set up the SageMaker Python SDK and make certain you have the needed AWS permissions and environment setup. The following is a detailed code example that shows how to deploy and utilize DeepSeek-R1 for inference programmatically. The code for releasing the design 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 inference with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can likewise use 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 revealed in the following code:

    Tidy up

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

    Delete the Amazon Bedrock Marketplace implementation

    If you released the design utilizing Amazon Bedrock Marketplace, complete the following steps:

    1. On the Amazon Bedrock console, under Foundation models in the navigation pane, select Marketplace deployments.
  5. In the Managed implementations area, find the endpoint you want 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 right deployment: 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 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 deploy the DeepSeek-R1 model using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to get going. For more details, refer to Use Amazon Bedrock tooling with Amazon SageMaker JumpStart models, SageMaker JumpStart pretrained models, engel-und-waisen.de 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 ingenious options utilizing AWS services and accelerated compute. Currently, he is concentrated on establishing techniques for fine-tuning and optimizing the inference efficiency of large language models. In his leisure time, Vivek delights in treking, seeing films, and trying various foods.

    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 working on generative AI with the Third-Party Model Science group at AWS.

    Banu Nagasundaram leads product, engineering, and tactical partnerships for Amazon SageMaker JumpStart, SageMaker's artificial intelligence and generative AI hub. She is passionate about building options that help consumers accelerate their AI journey and unlock organization value.