/ping and /invocations protocol.
Prerequisites
- Docker with NVIDIA GPU support (nvidia-container-toolkit)
- Access to Anaconda Platform and an API key
- An AWS account with SageMaker access
- A SageMaker execution IAM role
- An Amazon ECR repository to push the container image to
Install
Install thesagemaker extra for anaconda-ai:
Build the container
Clone theanaconda-sagemaker-runtime repository and build the image:
Push to ECR
Authenticate with ECR, then tag and push the image:Deploy and invoke
- Python SDK
- CLI
Use To pre-stage the model to S3 for a faster cold start (approximately 4 minutes versus 6 minutes), pass You can also call the staging, registration, and deployment steps explicitly:
AnacondaModel to deploy a model from the catalog and invoke the endpoint:Deleting an endpoint does not delete the underlying deployable model. The model registration persists in SageMaker and can be redeployed at any time from the AWS console or using native AWS tools. You only need to run
model.stage() and model.build() once per model.stage=True:llama-server tuning
Use these options to configure the inference server’s context size, parallelism, and attention behavior.- Python SDK
- CLI
Environment variables
Required for catalog download
The following environment variables are required when the container downloads the model from the catalog at startup.
When using
When using
stage=True or model.stage(), the model is pre-staged to S3 and these variables are not required.Optional
Any llama-server argument that supports an environment variable can be passed asLLAMA_ARG_*. For example: LLAMA_ARG_BATCH=4096, LLAMA_ARG_FLASH_ATTN=on.
Supported instance types
GPU is required. Recommended instance families:Model identifier format
For models in the Anaconda Platform model catalog, models are identified using the format:Q4_K_M, Q5_K_M, Q6_K, Q8_0.
Examples: