DeepSeek R1 Model now Available in Amazon Bedrock Marketplace And Amazon SageMaker JumpStart
anneliesekhull bu sayfayı düzenledi 2 ay önce


Today, we are delighted 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 deploy DeepSeek AI’s first-generation frontier design, DeepSeek-R1, along with the distilled variations ranging from 1.5 to 70 billion specifications to build, experiment, and properly scale your generative AI concepts on AWS.

In this post, we show how to begin with DeepSeek-R1 on Amazon Bedrock Marketplace and SageMaker JumpStart. You can follow similar steps to release the distilled variations of the models too.

Overview of DeepSeek-R1

DeepSeek-R1 is a large language model (LLM) developed by DeepSeek AI that utilizes reinforcement discovering to boost reasoning capabilities through a multi-stage training procedure from a DeepSeek-V3-Base structure. A crucial differentiating function is its support learning (RL) action, which was used to improve the model’s actions beyond the basic pre-training and fine-tuning process. By integrating RL, DeepSeek-R1 can adjust more efficiently to user feedback and goals, ultimately boosting both relevance and clearness. In addition, DeepSeek-R1 utilizes a chain-of-thought (CoT) technique, meaning it’s equipped to break down complicated queries and factor through them in a detailed way. This directed reasoning process allows the design to produce more accurate, transparent, and hb9lc.org detailed responses. This model integrates RL-based fine-tuning with CoT capabilities, aiming to generate structured reactions while concentrating on interpretability and user interaction. With its comprehensive capabilities DeepSeek-R1 has actually caught the market’s attention as a versatile text-generation model that can be incorporated into different workflows such as agents, rational reasoning and data analysis jobs.

DeepSeek-R1 utilizes a Mixture of Experts (MoE) architecture and is 671 billion parameters in size. The MoE architecture enables activation of 37 billion criteria, making it possible for efficient reasoning by routing inquiries to the most appropriate professional “clusters.” This technique enables the design to focus on different problem domains while maintaining total performance. DeepSeek-R1 needs 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 features 8 Nvidia H200 GPUs providing 1128 GB of GPU memory.

DeepSeek-R1 distilled models bring the reasoning capabilities of the main R1 design to more efficient 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, more effective models to imitate the habits and thinking patterns of the larger DeepSeek-R1 model, utilizing it as an instructor design.

You can release DeepSeek-R1 model either through SageMaker JumpStart or Bedrock Marketplace. Because DeepSeek-R1 is an emerging model, we suggest releasing this model with guardrails in location. In this blog site, we will use Amazon Bedrock Guardrails to present safeguards, prevent harmful content, and assess designs against key safety requirements. At the time of writing this blog site, for DeepSeek-R1 deployments on SageMaker JumpStart and Bedrock Marketplace, Bedrock Guardrails supports only the ApplyGuardrail API. You can produce numerous guardrails tailored to different use cases and apply them to the DeepSeek-R1 design, enhancing user experiences and standardizing security controls throughout your generative AI applications.

Prerequisites

To release 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 wavedream.wiki under AWS Services, choose 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 ask for a limitation boost, develop a limit boost demand and reach out to your account group.

Because you will be releasing this model with Amazon Bedrock Guardrails, make certain you have the correct AWS Identity and Gain Access To Management (IAM) permissions to use Amazon Bedrock Guardrails. For guidelines, see Establish consents to use guardrails for content filtering.

Implementing guardrails with the ApplyGuardrail API

Amazon Bedrock Guardrails permits you to present safeguards, prevent harmful material, and examine designs against essential safety criteria. You can implement security steps for the DeepSeek-R1 model utilizing the Amazon Bedrock ApplyGuardrail API. This enables you to apply guardrails to assess user inputs and model actions 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 create the guardrail, see the GitHub repo.

The general circulation 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 out to the design for inference. After getting the model’s output, engel-und-waisen.de another guardrail check is used. If the output passes this last check, it’s returned as the 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 whether it took place at the input or output phase. The examples showcased in the following sections show reasoning utilizing this API.

Deploy DeepSeek-R1 in Amazon Bedrock Marketplace

Amazon Bedrock Marketplace provides you access to over 100 popular, emerging, and specialized foundation 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 catalog under Foundation models in the navigation pane. At the time of composing this post, you can use the InvokeModel API to invoke the design. It doesn’t support Converse APIs and other Amazon Bedrock tooling.

  1. Filter for DeepSeek as a provider and select the DeepSeek-R1 design.

    The model detail page supplies necessary details about the model’s abilities, pricing structure, and application standards. You can find detailed usage directions, consisting of sample API calls and code snippets for integration. The model supports different text generation jobs, including content development, code generation, and concern answering, utilizing its support discovering optimization and CoT thinking capabilities. The page likewise includes deployment options and licensing details to assist you start with DeepSeek-R1 in your applications.
  2. To begin using DeepSeek-R1, select Deploy.

    You will be triggered to configure the implementation details for DeepSeek-R1. The design ID will be pre-populated.
  3. For Endpoint name, go into an endpoint name (in between 1-50 alphanumeric characters).
  4. For Number of circumstances, enter a variety of instances (in between 1-100).
  5. For example type, select 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 advanced security and engel-und-waisen.de facilities settings, consisting of virtual personal cloud (VPC) networking, service role consents, and encryption settings. For a lot of utilize cases, the default settings will work well. However, for production implementations, you might want to evaluate these settings to line up with your organization’s security and compliance requirements.
  6. Choose Deploy to start using the model.

    When the implementation is total, you can check DeepSeek-R1’s capabilities straight in the Amazon Bedrock play area.
  7. Choose Open in play area to access an interactive user interface where you can experiment with different prompts and change model parameters like temperature level and optimum length. When utilizing R1 with Bedrock’s InvokeModel and Playground Console, use DeepSeek’s chat template for ideal results. For instance, material for inference.

    This is an excellent way to explore the design’s reasoning and text generation capabilities before integrating it into your applications. The play ground offers immediate feedback, assisting you understand pipewiki.org how the model reacts to numerous inputs and letting you tweak your prompts for ideal outcomes.

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

    Run inference utilizing guardrails with the released DeepSeek-R1 endpoint

    The following code example shows how to perform inference utilizing a released DeepSeek-R1 design through Amazon Bedrock utilizing the invoke_model and ApplyGuardrail API. You can develop 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 produced the guardrail, utilize the following code to execute guardrails. The script initializes the bedrock_runtime client, configures reasoning specifications, and sends a demand to generate text based on a user timely.

    Deploy DeepSeek-R1 with SageMaker JumpStart

    SageMaker JumpStart is an artificial intelligence (ML) center with FMs, built-in algorithms, and prebuilt ML solutions that you can deploy with just 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 surgiteams.com SDK.

    Deploying DeepSeek-R1 model through SageMaker JumpStart uses two convenient techniques: utilizing the instinctive SageMaker JumpStart UI or carrying out programmatically through the SageMaker Python SDK. Let’s check out both methods to help you choose the approach that best suits your requirements.

    Deploy DeepSeek-R1 through SageMaker JumpStart UI

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

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

    The model internet browser displays available models, with details like the company name and model capabilities.

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

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

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

    The design details page includes the following details:

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

    The About tab consists of important details, such as:

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

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

    6. Choose Deploy to continue with implementation.

    7. For Endpoint name, utilize the immediately generated name or create a custom one.
  15. For example type ¸ select an instance type (default: ml.p5e.48 xlarge).
  16. For Initial circumstances count, get in the number of circumstances (default: 1). Selecting proper instance types and counts is for cost and performance optimization. Monitor your deployment to adjust these settings as needed.Under Inference type, Real-time reasoning is picked by default. This is enhanced for sustained traffic and low latency.
  17. Review all setups for accuracy. For this model, we strongly suggest adhering to SageMaker JumpStart default settings and making certain that network seclusion remains in location.
  18. Choose Deploy to release the model.

    The release procedure can take several minutes to finish.

    When implementation is total, your endpoint status will change to InService. At this point, the design is prepared to accept inference demands through the endpoint. You can keep an eye on the release progress on the SageMaker console Endpoints page, which will show appropriate metrics and status details. When the release is total, you can conjure up the model using a SageMaker runtime client and integrate it with your applications.

    Deploy DeepSeek-R1 using the SageMaker Python SDK

    To start with DeepSeek-R1 using the SageMaker Python SDK, you will require to set up the SageMaker Python SDK and make certain you have the necessary AWS consents and environment setup. The following is a detailed code example that demonstrates how to release and utilize DeepSeek-R1 for inference programmatically. The code for deploying the model is offered in the Github here. You can clone the note pad and range from SageMaker Studio.

    You can run extra requests against the predictor:

    Implement guardrails and run reasoning with your SageMaker JumpStart predictor

    Similar to Amazon Bedrock, you can also use the ApplyGuardrail API with your SageMaker JumpStart predictor. You can create a guardrail using the Amazon Bedrock console or the API, and execute it as shown in the following code:

    Clean up

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

    Delete the Amazon Bedrock Marketplace deployment

    If you deployed the design utilizing Amazon Bedrock Marketplace, total the following steps:

    1. On the Amazon Bedrock console, under Foundation designs in the navigation pane, pick Marketplace implementations.
  19. In the Managed implementations section, locate the endpoint you want to erase.
  20. Select the endpoint, and on the Actions menu, select 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 model you deployed will sustain expenses if you leave it running. Use the following code to delete the endpoint if you want 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 design using Bedrock Marketplace and SageMaker JumpStart. Visit SageMaker JumpStart in SageMaker Studio or Amazon Bedrock Marketplace now to start. For more details, describe Use Amazon Bedrock tooling with Amazon SageMaker JumpStart designs, SageMaker JumpStart pretrained models, 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 develop innovative options utilizing AWS services and sped up calculate. Currently, he is concentrated on developing strategies for fine-tuning and enhancing the inference performance of big language designs. In his spare time, Vivek enjoys hiking, enjoying movies, and trying various foods.

    Niithiyn Vijeaswaran is a Generative AI Specialist Solutions Architect with the Third-Party Model Science team 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 center. She is enthusiastic about building options that assist clients accelerate their AI journey and unlock business worth.