hf-cloud-sagemaker-production-defaults
Qué hace
Esta skill crea un endpoint de modelo de SageMaker en vivo, configurado para escalar con el tráfico y para informar de los problemas. Es para personas que quieren un despliegue que puedan dejar en marcha y depurar después.
Cuándo usarla
- ✓Cuando está a punto de crearse un endpoint de SageMaker.
- ✓Cuando quieres configurar el autoescalado y las alarmas junto con el endpoint.
- ✓Cuando quieres terminar un despliegue una vez conocidas la imagen y el rol.
Link de la skill
https://github.com/huggingface/skills/blob/main/skills/hf-cloud-sagemaker-production-defaults/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Despliega el modelo elegido como endpoint en tiempo real con autoescalado y alarmas, para que pueda seguir funcionando.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La IA crea un conjunto de recursos vinculados: el modelo, su configuración de endpoint, el propio endpoint, un objetivo de autoescalado y alarmas de CloudWatch para la latencia y los errores. La captura de datos permanece desactivada salvo que la actives.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
SageMaker Production Defaults
The difference between a demo endpoint and one you can leave running is: it scales with traffic, it tells you when it breaks, and you can debug it later. This skill makes those three the default rather than optional extras.
By the time this skill runs, the planner has chosen a real-time endpoint, IAM has a usable role, and image-selection has resolved a container URI + AMI version. This skill turns those into an actual deployment.
What gets created
For every endpoint, the skill creates these as a unit:
- SageMaker Model — image + env vars + execution role + S3 artifacts
- Endpoint config — instance type, initial count, optional data capture
- Endpoint — the real-time endpoint serving inference
- Autoscaling target + policy — target tracking on invocations per instance
- CloudWatch alarms — latency, errors, platform overhead
An inference-component deployment (deploy_ic.py) creates the same set with two changes: the endpoint config carries the execution role and ManagedInstanceScaling, and an inference component carries the model. Its autoscaling target is the component, not the variant.
Data capture (logging requests/responses to S3) is off by default — useful for debugging but creates ongoing S3 costs the user didn't necessarily ask for. Enable with --enable-data-capture.
All resources get a consistent tag set including CreatedBy=agentic-deploy-skills for later cleanup.
Defaults and reasoning in references/deployment-template.md.
Running the deployment
For a text-generation LLM (vLLM), first package the pinned model snapshot as a SageMaker model.tar.gz artifact and upload it to an account-controlled S3 bucket. SageMaker extracts it under /opt/ml/model, so the deployment does not fetch or execute repository code at runtime:
python scripts/deploy.py \
--model-name qwen3-medical \
--image-uri "$IMAGE_URI" \
--inference-ami-version "$AMI" \
--role-arn "$ROLE_ARN" \
--model-s3-uri "s3://<your-model-bucket>/qwen3-medical/model.tar.gz" \
--instance-type ml.g5.xlarge \
--region "$REGION" \
--env SM_VLLM_MODEL=/opt/ml/model \
--env SM_VLLM_HOST=0.0.0.0 \
--env SM_VLLM_TRUST_REMOTE_CODE=false \
--env SM_VLLM_MAX_MODEL_LEN=4096
For an embedding model (TEI, often on CPU):
python scripts/deploy.py \
--model-name bge-large-embeddings \
--image-uri "$IMAGE_URI" \
--role-arn "$ROLE_ARN" \
--instance-type ml.c6i.2xlarge \
--region "$REGION" \
--env HF_MODEL_ID=BAAI/bge-large-en-v1.5
Note: TEI deployments do not need --inference-ami-version. That flag is vLLM-specific. TEI env vars are also simpler (HF_MODEL_ID instead of SM_VLLM_*, no host or trust-remote-code to configure).
Where each value comes from:
| Parameter | Source |
|---|---|
--image-uri |
hf-cloud-serving-image-selection — agent reads from the AWS DLC catalog page |
--inference-ami-version |
hf-cloud-serving-image-selection — required for vLLM tags containing cu130+ |
--role-arn |
hf-cloud-sagemaker-iam-preflight (check_role.py) |
--region |
hf-cloud-aws-context-discovery |
--instance-type |
User input or planner recommendation |
--env |
Model-specific; see hf-cloud-serving-image-selection for required SM_VLLM_* vars |
--model-s3-uri |
Preferred for production — S3 URI of the pinned model artifact extracted to /opt/ml/model; omit only for the Hub-at-runtime exception |
The script creates resources in order with error handling, waits for InService (up to 30 min), surfaces failure reasons, registers autoscaling and alarms, and prints a summary including the teardown command. Outputs a JSON blob on stdout with endpoint/config/model names for downstream scripting.
The scripts ship with this skill. If the installed copy is missing the scripts/ directory (some harnesses copy only SKILL.md on install), fetch them from the source repo rather than re-implementing them from this description.
Model-loading default: pre-stage pinned weights in S3 and pass --model-s3-uri; the container loads them from /opt/ml/model without a runtime Hub dependency. Loading from the Hub is an explicit exception: expect a 5–15+ minute download after endpoint startup, provide a token for gated models, and keep SM_VLLM_TRUST_REMOTE_CODE=false unless the specific architecture requires reviewed custom code. deploy.py waits 30 minutes.
InServi
Preguntas frecuentes
¿Está activada la captura de datos?
No. El registro de peticiones y respuestas en S3 está desactivado por defecto, porque genera costes de almacenamiento continuos.
¿Qué hace el autoescalado?
Ajusta el número de instancias según el tráfico, usando un objetivo de invocaciones por instancia.
¿Puede el endpoint escalar a cero?
Sí. Una opción de escalado a cero en tiempo real es uno de los tipos de endpoint que admite.
Detalles
Descripción original del autor
Create a SageMaker endpoint (real-time, real-time scale-to-zero, or async) with autoscaling, CloudWatch alarms, and tagging enabled by default. Use this skill whenever about to create a SageMaker endpoint, write deployment code that calls `create_endpoint`, or finalize a deployment after the image URI and IAM role are known. Provides deploy.py for real-time endpoints, deploy_ic.py for real-time endpoints that scale to zero instances via inference components, and deploy_async.py for async endpoints (also scale-to-zero). This is the last step in the SageMaker deployment workflow. Never generate
repo: huggingface/skills
Popularidad
- Estrellas en GitHub
- 11 mil
- Posición en el ranking
- #11770
- Licencia
- Apache-2.0
- Actualizada
- 30/10/2026
Comentarios
- …
Más skills de este repositorio
hf-cli
11 milAyuda a tu agente a usar la herramienta de línea de comandos de Hugging Face para descargar, subir y gestionar modelos, conjuntos de datos, Spaces, repositorios y la caché local.
hf-cloud-aws-context-discovery
11 milAyuda a tu agente a encontrar tu perfil, región y datos de cuenta de AWS antes de cualquier trabajo en la nube, para no adivinar qué cuenta usar.
hf-cloud-python-env-setup
11 milAyuda a tu agente a preparar un entorno de Python limpio, con una versión adecuada y las bibliotecas actuales, antes de ejecutar SageMaker o automatizaciones de AWS.
hf-cloud-sagemaker-deployment-planner
11 milAyuda a tu agente a planear cómo desplegar un modelo en Amazon SageMaker, eligiendo alojamiento en tiempo real, sin servidor, asíncrono o por lotes, con valores por defecto sensatos.
Skills parecidas
openclaw-update
394 milAyuda a tu agente a actualizar una Gateway de OpenClaw que ya existe, eligiendo el método de actualización que encaja con cómo se instaló y manteniendo tu sesión activa.
diagnose-gateway
394 milAyuda a tu agente a averiguar por qué falla tu Gateway de OpenClaw, revisando ajustes, canales y puertos sin cambiar nada.
crabbox-apps
394 milAyuda a tu agente a abrir y ejecutar una app en una máquina temporal en la nube y mostrar su vista en el panel lateral de tu chat.