Cloud Computing for ML covered the vocabulary; APIs & Model Serving covered cloud-agnostic serving concepts. This page is the part in between: the actual, concrete methods for getting a trained model deployed and answering real traffic on AWS and Azure specifically, with real commands for each — not just names.
A trained model sitting on a laptop is like a chef who can cook but has no restaurant — great food, nobody can order it. Deploying a model is opening the restaurant: standing up something that can receive a real request over the network, run the model, and hand back an answer, reliably, whether one customer shows up or a thousand. AWS and Azure each give you several different "restaurant" shapes for this — always-open (real-time endpoints), open-on-demand-only (serverless), and a kitchen that takes orders for later instead of making people wait at the counter (async/batch) — and which shape fits depends entirely on how requests actually arrive: steady and fast, spiky and occasional, or huge and slow.
AWS: Amazon SageMaker
SageMaker's inference methods all follow the same three-step shape — create_model (point at a container image and model artifact), create_endpoint_config (choose a deployment mode and resources), create_endpoint (stand it up) — with the config step being where each method actually differs.
Real-Time Endpoints
The default: a persistent, always-on HTTPS endpoint for synchronous, low-latency inference.
No always-on instance to manage or pay for while idle — SageMaker provisions compute per request and scales to zero, at the cost of cold-start latency (the same tradeoff Serverless Inference covers for LLM hosting generally). Swap InstanceType/InitialInstanceCount for a ServerlessConfig:
sm.create_endpoint_config( EndpointConfigName="fraud-detector-serverless-config", ProductionVariants=[{ "VariantName": "AllTraffic", "ModelName": "fraud-detector", "ServerlessConfig": { "MemorySizeInMB": 2048, # 1024-6144, in fixed steps "MaxConcurrency": 20, # 1-200 "ProvisionedConcurrency": 10, # optional: keep this many instances warm, avoids cold starts up to this concurrency }, }],)
Right fit: spiky or low-average-traffic endpoints where paying for an always-on ml.m5.xlarge would mostly pay for idle time.
Async Inference
For requests that take too long for a synchronous HTTP response (large payloads, slow models) — the caller gets an immediate acknowledgment and polls (or gets an SNS notification) for the result, landing in S3:
No endpoint at all — point at a whole dataset in S3, get predictions back in S3, and the compute tears down when the job finishes. The right choice for batch inference with no latency pressure.
Rather than one endpoint per model (expensive to keep dozens of low-traffic models each on their own instance), serve many models behind one endpoint:
# Multi-model endpoint: Mode="MultiModel" points at a whole S3 prefix of model artifacts,# loaded onto the instance on demand and cached/evicted by access patternsm.create_model( ModelName="multi-tenant-models", PrimaryContainer={"Image": "<account>.dkr.ecr.us-east-1.amazonaws.com/multi-model-server:1.0", "ModelDataUrl": "s3://my-ml-bucket/models/", "Mode": "MultiModel"}, ExecutionRoleArn="arn:aws:iam::<account>:role/SageMakerExecutionRole",)
# each invocation picks the specific model by S3 key relative to ModelDataUrlaws sagemaker-runtime invoke-endpoint \ --endpoint-name multi-tenant-endpoint \ --target-model customer-42/model.tar.gz \ --body '{"features": [...]}' output.json
Multi-container endpoints are a different pattern: several different containers (a preprocessor, a model, a postprocessor, or entirely separate models) behind one endpoint, invoked either in Direct mode (caller picks which container per request via TargetContainerHostname) or Serial mode (request flows through all containers as a pipeline) via InferenceExecutionConfig on create_endpoint_config.
AWS: Container-Native Serving
The alternative to SageMaker's managed inference layer: run the serving container from Containers yourself, on general compute.
ECS: a real task definition and service for the FastAPI endpoint from APIs & Model Serving:
EKS: the same Kubernetes Deployment/Service/HPA manifests from that page apply directly once connected to an EKS cluster:
eksctl create cluster --name ml-cluster --region us-east-1 --node-type m5.xlarge --nodes 3aws eks update-kubeconfig --name ml-cluster --region us-east-1 # kubectl now points at EKSkubectl apply -f deployment.yaml # same manifest as the Kubernetes page
Lambda: works for a model small and fast enough to fit Lambda's execution model, packaged as a container image (the standard zip-based Lambda package limit is too small for most real model artifacts):
For foundation models specifically, Bedrock is the managed-LLM-serving equivalent of SageMaker real-time endpoints — no infrastructure to provision at all, just an API call against a hosted model:
az ml online-endpoint create -n fraud-detector-endpoint -f endpoint.ymlaz ml online-deployment create -n blue --endpoint fraud-detector-endpoint -f blue-deployment.yml --all-traffic# canary rollout of a new "green" deployment, same shape as Deployment Strategies' canary pattern:az ml online-endpoint update -n fraud-detector-endpoint --traffic "blue=90 green=10"
Batch Endpoints
The batch-transform equivalent — score a whole dataset, no persistent endpoint:
az ml batch-endpoint create -f batch-endpoint.yml --name fraud-detector-batch-endpointaz ml batch-deployment create -f batch-deployment.yml --endpoint-name fraud-detector-batch-endpoint --set-defaultaz ml batch-endpoint invoke --name fraud-detector-batch-endpoint --input s3://my-ml-bucket/datasets/fraud/2026-01/
Azure: Container-Native Serving
AKS: same Kubernetes manifests as always, once connected:
az aks create --resource-group ml-rg --name ml-cluster --node-count 3 --node-vm-size Standard_D4s_v3az aks get-credentials --resource-group ml-rg --name ml-cluster # kubectl now points at AKSkubectl apply -f deployment.yaml
Container Apps: a managed, serverless-ish container platform (scale-to-zero, no cluster to manage) — a lighter-weight option than AKS for a single serving container:
Azure's equivalent of Bedrock for foundation models — hosted access to OpenAI's models through Azure's own infrastructure and compliance boundary (see LLM Hosting & Serving Patterns for why an enterprise might choose this over calling OpenAI directly):
from openai import AzureOpenAIclient = AzureOpenAI(azure_endpoint="https://my-resource.openai.azure.com/", api_version="2026-01-01-preview", api_key=api_key)response = client.chat.completions.create( model="gpt-4o-deployment", # the deployment name you chose, not the raw model name messages=[{"role": "user", "content": "Summarize this ticket."}],)