Skip to content

SageMaker

Host Strands Decider on a SageMaker real-time endpoint in your AWS account. Two paths: a one-click launch from JumpStart, or the Decider repo’s CDK stack for a repeatable, tunable deploy.

  • When to pick it: production traffic, GPU inference, multi-tenant services. Prefer Local for dev or Lambda when traffic is bursty and you want pay-per-request.

The fastest path: open SageMaker Studio → JumpStart, search for Strands Decider, pick a model variant and instance type, and click Deploy. JumpStart creates the SageMaker model, endpoint config, and endpoint for you; no CDK, no CodeBuild, no S3 copy to manage.

Good for:

  • a one-off eval on a specific checkpoint;
  • picking the instance type interactively while reading the published model card;
  • teams that prefer the console over Infrastructure-as-Code.

Trade-offs vs. CDK:

  • defaults only — no max_concurrency, device_map, or extra serve_args flags;
  • the endpoint lives outside your Terraform / CDK state, so lifecycle (updates, blue/green, teardown) is manual;
  • you can still call it the same way (boto3 sagemaker-runtime, see below).

For repeatable deploys with every tuning knob exposed, use the CDK stack in deploy/sagemaker/ on the Decider repo. One stack copies the model to S3, picks (or builds) a serving image, and creates the endpoint; cdk destroy removes everything.

Terminal window
git clone https://github.com/strands-labs/strands-decider
cd strands-decider/deploy/sagemaker
npm install
npx cdk bootstrap aws://<account>/<region> # once per account/region
npx cdk deploy

The default stack creates an ml.g6.xlarge endpoint for strands-decider-2B-qwen3.5-v1-2610 using the published Strands Decider Deep Learning Container. Other instance types or -c image=build build the image from the folder’s Dockerfile in CodeBuild.

Every knob is a CDK context value: set in cdk.json or pass -c key=value:

SettingDefaultWhat it controls
modelStrandsAgents/strands-decider-2B-qwen3.5-v1-2610Hugging Face Hub id; also names the stack and endpoint
model_revisionmainPin to a release’s date tag (YYMMDD) for a stable endpoint
instance_typeml.g6.xlargeSageMaker instance type (GPU or CPU)
instance_count1Instances behind the endpoint
fallback_instance_typesemptyComma-separated list SageMaker tries when instance_type has no capacity
imageemptydlc (published DLC) or build (CodeBuild from Dockerfile); empty auto-picks per instance family
max_concurrencyemptyIn-flight requests per instance (serve --max-concurrency)
device_mapemptyauto splits a model larger than one GPU across the instance’s GPUs (needed for 26B-A4B on ml.g6e.12xlarge)
serve_argsemptyExtra strands-decider serve flags, e.g. "--max-batch 8"

A setting change updates the endpoint in place (blue/green via SageMaker endpoint configs).

InstanceGPU / CPUMemoryFits (bf16 / fp32)
ml.g6.xlarge (default)one L424 GB2B, E2B, E4B
ml.g6e.xlargeone L40S48 GBup to 12B
ml.p5.4xlargeone H10080 GBup to 26B-A4B
ml.g6e.12xlargefour L40S192 GB26B-A4B with device_map=auto
ml.m5.2xlarge8 vCPU32 GB2B on CPU (about 2.5 s for three questions)

GPU instances need quota; InsufficientInstanceCapacity means no free instance of that type in the region. Supply fallback_instance_types or try another region. Graviton, Inferentia, and Trainium are not supported.

Each model value gets its own stack and endpoint, named from the Hub id’s model slug. You can deploy several side by side:

Terminal window
npx cdk deploy # 2B Qwen3.5 (default)
npx cdk deploy -c model=StrandsAgents/strands-decider-E4B-gemma4-v1-2610 # E4B Gemma 4

A SageMaker endpoint is billed per instance-hour whether it gets requests or not. When you’re done:

Terminal window
npx cdk destroy # the default model
npx cdk destroy -c model=<Hub id> # any other model you deployed

Deletes the endpoint, endpoint config, SageMaker model, S3 bucket, ECR repository (if one was built), CodeBuild projects, and IAM roles.

Same for both paths. The request body matches strands-decider serve’s POST /v1/systemone, invoked through the SageMaker runtime:

import json, boto3
runtime = boto3.client("sagemaker-runtime")
response = runtime.invoke_endpoint(
EndpointName="strands-decider-2b-qwen3-5-v1-2610",
ContentType="application/json",
Body=json.dumps(
{
"state": "Help! My payouts have been failing for 3 days!",
"questions": {
"is_urgent": {"type": "noul", "instructions": "Does this convey urgency?"}
},
}
),
)
print(json.loads(response["Body"].read())["answers"])

Callers need IAM sagemaker:InvokeEndpoint on the endpoint. The container has no authentication of its own.