hf-cloud-sagemaker-production-defaults

Deploys SageMaker endpoints with autoscaling, CloudWatch alarms, tagging, and teardown scripts.

507|40|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/waybarrios/opencode-power-pack --skill hf-cloud-sagemaker-production-defaults-waybarrios
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hf-cloud-sagemaker-production-defaults
Source: https://github.com/waybarrios/opencode-power-pack/tree/main/skills/hf-cloud-sagemaker-production-defaults
Command: npx skills add https://github.com/waybarrios/opencode-power-pack --skill hf-cloud-sagemaker-production-defaults-waybarrios

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires boto3, botocore, and includes scripts (resource) and references (resource) components.

What problem does it solve? Turning a working SageMaker demo endpoint into one you can leave running requires autoscaling, monitoring alarms, consistent tagging, and safe teardown — all of which are tedious to wire up correctly by hand and easy to get wrong (e.g., async scale-to-zero needs a separate step-scaling policy, and vLLM CUDA 13+ images fail silently without an InferenceAmiVersion). ## Core Features & Use Cases - Real-time deployment: deploy.py creates the model, endpoint config, and endpoint, then registers target-tracking autoscaling and three CloudWatch alarms (latency p99, 5XX errors, overhead latency) with consistent resource tags. - Async inference deployment: deploy_async.py supports scale-to-zero with a backlog target-tracking policy plus a step-scaling wake-from-zero policy, S3 output paths, and SNS notifications. - Smoke testing and teardown: invoke_endpoint.py invokes endpoints with BOM-safe UTF-8 payloads (avoiding the Windows PowerShell BOM gotcha), and teardown.py deletes alarms, autoscaling, endpoint, config, and model in safe order. - Use Case: Deploy a Qwen3 LLM on ml.g5.xlarge with a vLLM DLC image, autoscaling from 1–4 instances, then verify it actually serves requests by scanning CloudWatch logs for worker crashes before declaring success. ## Quick Start Ask the agent to deploy your model to a SageMaker real-time endpoint by providing the image URI, IAM role ARN, instance type, and region, then have it smoke-test the endpoint and print the teardown command.

Frequently Asked Questions about hf-cloud-sagemaker-production-defaults

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a model to a SageMaker endpoint with autoscaling?▼

Run deploy.py with --model-name, --image-uri, --role-arn, --instance-type, and --region. It creates the model, endpoint config, and endpoint, waits for InService, then registers target-tracking autoscaling on invocations per instance and three CloudWatch alarms.

How do I set up SageMaker async inference with scale-to-zero?▼

Use deploy_async.py with --output-s3-uri and --min-capacity 0. It registers a target-tracking policy on ApproximateBacklogSizePerInstance plus a step-scaling policy triggered by a HasBacklogWithoutCapacity alarm, which is required to wake the endpoint from zero instances.

Why does my SageMaker endpoint fail with CannotStartContainerError and no logs?▼

This is the InferenceAmiVersion problem: vLLM DLC images with cu130 or later require --inference-ami-version al2-ami-sagemaker-inference-gpu-3-1. Without it the container dies before producing any CloudWatch logs, so check the AMI flag before debugging images or IAM.

Why does SageMaker invoke-endpoint return Unexpected UTF-8 BOM error?▼

The request payload file contains a UTF-8 byte-order mark, often from PowerShell's Set-Content -Encoding UTF8 on Windows. Use the bundled invoke_endpoint.py script, which strips BOMs and writes BOM-free UTF-8, or write the file with UTF8Encoding($false).

Does InService status mean my SageMaker endpoint is working?▼

No. InService only means the container answered /ping; in MMS-based containers the Java front-end can respond while the Python worker crash-loops. Always run one real invocation and scan CloudWatch logs for worker-crash markers before declaring success.

How do I delete a SageMaker endpoint and all its resources?▼

Run teardown.py with the endpoint name and region. It deletes alarms, autoscaling policies and targets, the endpoint, endpoint config, and model in safe order. It does not delete the IAM role, data capture S3 objects, SNS topics, or model artifacts.