Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Stage any supported open-weight Hugging Face model directly into Amazon S3 and deploy it to an Amazon SageMaker AI real-time endpoint with a compatible vLLM or SGLang Deep Learning Container. Use for model hosting, endpoint creation, direct-to-S3 transfer, smoke testing, and deployment cleanup.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 33% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 24% | 0% |
This skill is a model-agnostic deployment contract. The scripts do not select behavior by model name. The agent researches the requested checkpoint, derives its serving requirements, and supplies those decisions as explicit arguments.
The bundled scripts are generic execution primitives, not a model catalog or a policy engine. The agent must interpret current primary sources and choose the checkpoint, engine, image, hardware, topology, context cap, and request shape. A newly supported model should normally require different arguments, not a code change.
Do not grow the scripts with model profiles or model-name branches. Add code only for a reusable SageMaker capability. If no compatible checkpoint fits a single SageMaker real-time endpoint, choose another official quantization or move to the appropriate SageMaker multi-node path, such as HyperPod, instead of encoding a one-model exception in deploy.py.
Before deriving serving arguments from scratch, look up a known-good configuration for the requested checkpoint in the AWS SageMaker GenAI hosting examples:
<https://github.com/aws-samples/sagemaker-genai-hosting-examples/tree/main/01-models>
Find the requested model or an architecturally similar one and adopt its engine, image family, instance and topology, context cap, and required SM_VLLM_* / SM_SGLANG_* options as the starting point. This does not change the model-neutral contract: any configuration found is supplied through generic CLI arguments (--image, --instance, --env, --smoke-inputs, --capacity-reservation-arn), never added to the scripts. Use the model publisher's model card for anything the examples do not cover.
Always re-validate against current reality before deploying: resolve the newest compatible DLC (reuse an example's pinned image only if it still exists in ECR), confirm the checkpoint's required GPU microarchitecture and quantization support, check endpoint quota, and size context and concurrency to the measured KV-cache budget.
If no matching example exists, or the example is stale (superseded DLC tag, deprecated flag, or an older engine version than the checkpoint needs), do not block: fall back to first-principles research from the model card and proceed. Treat examples as a starting point, not an authority. A dated example never overrides current DLC, quota, or hardware facts.
license, checkpoint format, engine support, minimum engine version, weight size, and native context length. A borrowed config is a starting point to validate, not a substitute for these facts.
non-quantized layers, runtime buffers, and the intended KV cache.
scripts/stage_model.py. Do not create a workstation model snapshot.
and any model-required engine arguments.
scripts/deploy.py without --deploy and review the complete plan.InService, and invoke an OpenAI-compatible smoke request.Inference Component, and smoke-test result.
scripts/teardown.py --yes when validation iscomplete.
Do not add per-model conditionals or profiles to the scripts.
The staging controller resolves a Hugging Face repository to a commit SHA and starts a CPU SageMaker Processing job:
bashpython scripts/stage_model.py \ --hf-model-id organization/model-name python scripts/stage_model.py \ --hf-model-id organization/model-name \ --destination s3://bucket/models/model-name/ \ --run
The worker streams each HTTP response into an S3 multipart upload, records the repository, revision, blob ID, and size as object metadata, skips matching objects on rerun, and writes .hf-model-manifest.json only after all files verify. It never writes model weights to the caller's filesystem.
For a gated repository, store the Hugging Face token in AWS Secrets Manager and pass --hf-token-secret-id. The caller and Processing execution role both need secretsmanager:GetSecretValue. Do not commit a token, place it in command-line arguments, or expose it in a Processing job environment.
The agent must determine these values for the requested model:
| Input | Decision | |---|---| | --model-s3 | Verified S3 prefix containing the uncompressed checkpoint | | --instance | GPU architecture and memory sized to model plus runtime | | --num-gpu | Inferred from known hardware or supplied explicitly | | --engine | vllm or sglang, at a model-compatible version | | --deployment-mode | standard for a whole-instance model, inference-component when intentionally packable | | --max-model-len | Workload-driven context cap that fits the KV-cache budget | | --max-num-seqs | vLLM concurrency cap, when an explicit cap is needed | | --env | Model-required SM_VLLM_* or SM_SGLANG_* options | | --smoke-inputs | Model-specific request fields, if required |
scripts/deploy.py accepts these as explicit arguments. It validates the S3 layout, endpoint quota, GPU count, image compatibility, and JSON inputs before creating resources.
Use the newest compatible canonical SageMaker DLC unless the user requests a pinned image. Resolve images from AWS ECR registry 763104351884, repository vllm or sglang, and ignore EC2, SOCI, server aliases, and non-semantic tags.
| Engine | Base environment | Typical use | |---|---|---| | vLLM | SM_VLLM_MODEL, SM_VLLM_TENSOR_PARALLEL_SIZE | Broad model support and managed benchmark compatibility | | SGLang | SM_SGLANG_MODEL_PATH, SM_SGLANG_TP | Alternate scheduler, kernels, and speculative decoding |
Current Blackwell containers require CUDA 13 and the AL2023 SageMaker GPU inference AMI:
textal2023-ami-sagemaker-inference-gpu-4-1
Pass model-specific server options through --env; do not encode them in Python conditionals. The DLC entrypoints convert each SM_VLLM_* or SM_SGLANG_* variable directly into a CLI option. Use JSON booleans for presence-only flags: true emits the bare flag and false omits it. Use strings or numbers only for options that take a value.
Use a standard endpoint when one model consumes the full instance. The production variant references the SageMaker Model directly.
Use an Inference Component when the model is intentionally packable. The endpoint configuration provisions the host, then the Inference Component declares accelerator count and minimum host memory.
Both paths use CreateModel.PrimaryContainer.ModelDataSource.S3DataSource with S3DataType=S3Prefix and CompressionType=None.
config.json and at least one recognized weightfile.
.hf-model-manifest.json and verify every listed file size beforedeployment. Use --allow-unverified-s3 only for an externally staged prefix that was independently verified.
unverified community quantization. Confirm its license separately.
checkpoint quantization, and the minimum package version. Supporting the base architecture does not prove support for a particular quantized checkpoint.
aggregate memory can still be incompatible with the selected GPU generation.
documented topology requires otherwise.
sagemaker.amazonaws.com and read the modelprefix.
--capacity-reservation-arn for time-sensitive scarce capacity.parallelism plan for the same checkpoint.
concurrency from measured KV-cache usage.
required transformers version or native engine implementation. A newer engine version alone is not sufficient.
add Inference Component packing semantics without a packing use case.
passed validation for reproducible deployments.
bashpython scripts/config.py python scripts/stage_model.py --hf-model-id organization/model-name python scripts/stage_model.py --hf-model-id organization/model-name --run python scripts/deploy.py \ --model-id model-name \ --model-s3 s3://bucket/models/model-name/ \ --instance ml.gpu-instance \ --engine vllm \ --max-model-len 16384 python scripts/deploy.py <same-arguments> --deploy python scripts/smoke_test.py --endpoint ENDPOINT python scripts/smoke_test.py --endpoint ENDPOINT --ic INFERENCE_COMPONENT python scripts/teardown.py --endpoint ENDPOINT --yes
Use the requested model publisher's model card as the source of model-specific serving arguments. Browse the AWS model examples for a matching model family or an architecturally similar SageMaker deployment:
Pass the endpoint and optional Inference Component name to sagemaker-benchmark. Standard endpoints omit the component. Keep intentional S3 model artifacts, but remove real-time endpoint compute after testing.
Other measured skills in the registry, with their headline benchmark lift.