Skip to content
All providers

aws

Run chat inference with Amazon Bedrock and SageMaker, and run sandboxes on AWS Lambda MicroVMs or Nitro-enabled EKS.

Requirements

Install the MagicMtn CLI on an Apple Silicon Mac or an x86-64 or ARM64 Linux host. The provider also requires Python 3.11 or later with Boto3 on that host. Configure an AWS profile or an IAM workload role with permissions for the AWS service you use. Keep the credentials on the provider host.

python3 -m venv ~/.local/share/magicmtn/aws-python
~/.local/share/magicmtn/aws-python/bin/python -m pip install 'boto3[crt]>=1.43.111,<1.44'
export MAGICMTN_AWS_PYTHON="$HOME/.local/share/magicmtn/aws-python/bin/python"

Installation

magic provider install aws

This installs the MagicMtn adapter. See Requirements for any runtime or other software to install separately. Registry installation does not require a MagicMtn login or AWS credentials.

To remove the installed adapter:

magic provider uninstall aws

Usage

Set AWS_DEFAULT_REGION to the region that hosts your AWS resources, and set AWS_PROFILE if you use a named profile. Start the provider host or runner with the same environment used to configure Python and AWS credentials.

  • Amazon Bedrock: Register a chat model with provider aws and a supported us.openai.* inference profile. Grant bedrock:InvokeModel for the profile and its routed models. Set MAGICMTN_AWS_BEDROCK_ROLE_ARN if the provider should assume a dedicated Bedrock role.
  • Amazon SageMaker: Register a chat model using endpoints/<endpoint-name>/models/<served-model>. The endpoint must accept the provider's chat request format, and the host role needs sagemaker:InvokeEndpoint.
  • Lambda MicroVMs: Prepare a MicroVM image with the provider command agent. Set MAGICMTN_AWS_MICROVM_IMAGES to a JSON mapping from your sandbox's OCI image reference to the prepared MicroVM image identifier.
  • Nitro Sandboxes on EKS: Use an EKS cluster configured for Nitro isolation. Install kubectl on the host, then set MAGICMTN_AWS_SANDBOX_BACKEND=nitro-eks and MAGICMTN_AWS_NITRO_EKS_CLUSTER to your cluster name.