
Deploy DeepSeek R1 on AWS Bedrock
Deploy DeepSeek R1 to Amazon Bedrock: A step-by-step guide to running this powerful language model on AWS.
- An AWS Account: You'll need an active AWS account with appropriate permissions to access Amazon Bedrock.
- AWS CLI: The AWS Command Line Interface (CLI) should be installed and configured with a profile that has the necessary permissions.
- Homebrew (macOS): If you’re on macOS, we’ll use Homebrew for package management. If you’re on Linux, adapt with your distro’s package manager (e.g., apt, yum).
- Storage Space: Make sure you have approximately 30GB of free storage for the model files.
git clone https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
aws s3 mb s3://bedrock-deepseek-models-{account-id}-us-east-1
aws s3 sync --exclude '.git*' DeepSeek-R1-Distill-Llama-8B s3://bedrock-deepseek-models-{account-id}-us-east-1/DeepSeek-R1-Distill-Llama-8B/
- Head to the Console: Navigate to the Amazon Bedrock console within the AWS Management Console and select "Imported models".
- Start Import: Click on "Import model" to begin the import process.
- Model Details: Configure as follows:
- Model name: deepseek-r1-8B (you can choose a different name).
- Tags: Optional.
- VPC settings: Optional.
- Import Job Configuration: This is where we connect to S3:
- Import job name: import_deepseek-r1-8B (or any name that helps you).
- Model import source: Select "Amazon S3 bucket."
- S3 location: Enter the S3 path:
s3://bedrock-deepseek-models-{account-id}-us-east-1/DeepSeek-R1-Distill-Llama-8B/
- Service Access Configuration:
- Choose "Create and use a new service role".
- Accept the auto-generated service role name
- Use default encryption settings
- Import: Finally, click "Import model" to start the import job.


- Replace {account-id}: With your AWS account ID.
- Replace {model-id}: With the Model ID provided in the Imported Model section of the Amazon Bedrock console. The MODEL_ARN will look similar to
arn:aws:bedrock:us-east-1:529088295222:imported-model/h8t50Wwcd0ux
. - Make sure REGION_NAME matches your chosen region
- max_gen_len – Specify the maximum number of tokens to use in the generated response. The model truncates the response once the generated text exceeds
max_gen_len
- HTTPStatusCode: 200: This indicates that your request was successful.
- x-amzn-bedrock-invocation-latency: This shows how long it took for the model to generate a response (in milliseconds).
- x-amzn-bedrock-output-token-count: The number of tokens in the generated output. The model will stop generating if reaches a max token number for the output.
- x-amzn-bedrock-input-token-count: The number of tokens in the input prompt
- body.generation: This field contains the actual text generated by the model, answering your question. In this case, the DeepSeek R1 model has provided a thorough explanation of why the sky appears blue and what might happen without the atmosphere. The stop reason "length" indicates that the output was truncated because it reached a max token limit.
- S3 Storage: Roughly ~$0.69 per month at $0.023/GB.
- Bedrock Model Storage: Approximately ~$2.19/month at $0.0001 per GB-hour.
- Base Rate: Around $0.25 per hour for a ml.g4dn.xlarge instance.
- Per-Request:
- Estimated cost per second: ~$0.000069
- Example 2-second inference: ~$0.00014 per request
- Example: 10,000 requests/month with 2-second inference: ~$1.40/month
- One-time import process charge.
- Data transfer fees (if applicable).
- AWS CloudWatch monitoring, if used.
- Security: Always ensure you are using proper AWS credentials and permissions to avoid any unauthorized access.
- Model Size: Keep in mind the model is around 30GB in size, which has implications for storage and bandwidth.
- Region: Bedrock availability may vary. Check that it's available in your chosen region.
- Monitoring: Use AWS CloudWatch to track your model’s performance, costs, and identify potential issues.
- Permissions: Double-check your AWS credentials and ensure they have the necessary Bedrock permissions.
- Git LFS: Make sure Git LFS is initialized and configured correctly.
- S3 Naming: Verify that your S3 bucket naming adheres to AWS conventions.
- CloudWatch Logs: If you encounter errors, examine CloudWatch logs for more detailed information.
- Bedrock Playground: Test the model further through the Bedrock console's playground.
- Permissions: Set up fine-grained model access permissions as needed.
- Application Integration: Integrate this model into your applications to leverage its power.
- Monitoring: Continually monitor performance and resource usage to optimize.