hf-cloud-sagemaker-production-defaults
Was er macht
Dieser Skill erstellt einen laufenden SageMaker-Modellendpunkt, der sich am Datenverkehr skaliert und Probleme meldet. Er ist für Leute gedacht, die eine Bereitstellung wollen, die sie dauerhaft laufen lassen und später debuggen können.
Wann du ihn nutzt
- ✓Wenn gleich ein SageMaker-Endpunkt angelegt wird.
- ✓Wenn du Autoscaling und Alarme zusammen mit dem Endpunkt einrichten willst.
- ✓Wenn du eine Bereitstellung abschließen willst, sobald Image und Rolle feststehen.
Link zum Skill
https://github.com/huggingface/skills/blob/main/skills/hf-cloud-sagemaker-production-defaults/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Stell das gewählte Modell als Echtzeit-Endpunkt mit Autoscaling und Alarmen bereit, damit es dauerhaft laufen kann.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Die KI legt eine Gruppe verknüpfter Ressourcen an: das Modell, seine Endpunktkonfiguration, den Endpunkt selbst, ein Autoscaling-Ziel und CloudWatch-Alarme für Latenz und Fehler. Die Datenerfassung bleibt aus, außer du schaltest sie ein.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen
Ist die Datenerfassung eingeschaltet?
Nein. Das Protokollieren von Anfragen und Antworten in S3 ist standardmäßig aus, weil es laufende Speicherkosten verursacht.
Was macht das Autoscaling?
Es passt die Anzahl der Instanzen an den Datenverkehr an, anhand eines Zielwerts für Aufrufe pro Instanz.
Kann der Endpunkt auf null skalieren?
Ja. Eine Echtzeit-Option mit Skalierung auf null gehört zu den Endpunkttypen, die er unterstützt.
Details
Originalbeschreibung des Autors
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
Beliebtheit
- GitHub-Sterne
- 11k
- Platz im Ranking
- #11770
- Lizenz
- Apache-2.0
- Aktualisiert
- 30.10.2026
Kommentare
- …
Weitere Skills aus diesem Repository
hf-cli
11kHilft deinem Agenten, das Hugging-Face-Kommandozeilenwerkzeug hf zu nutzen, um Modelle, Datensätze, Spaces und Repositorys herunterzuladen, hochzuladen und den lokalen Cache zu verwalten.
hf-cloud-aws-context-discovery
11kHilft deinem Agenten, dein AWS-Profil, deine Region und Kontodaten zu finden, bevor Cloud-Arbeiten beginnen, damit er nicht rät, welches Konto er nutzen soll.
hf-cloud-python-env-setup
11kHilft deinem Agenten, eine saubere Python-Umgebung mit passender Python-Version und aktuellen Bibliotheken einzurichten, bevor SageMaker- oder AWS-Automatisierung läuft.
hf-cloud-sagemaker-deployment-planner
11kHilft deinem Agenten, die Bereitstellung eines Modells auf Amazon SageMaker zu planen und zwischen Echtzeit-, serverlosem, asynchronem und Batch-Hosting mit sinnvollen Standards zu wählen.
Ähnliche Skills
openclaw-update
394kHilft deinem Agenten, ein bestehendes OpenClaw-Gateway zu aktualisieren, mit der Methode, die zu deiner Installation passt, während deine Sitzung weiterläuft.
diagnose-gateway
394kHilft deinem Agenten herauszufinden, warum dein OpenClaw-Gateway fehlschlägt, indem er Einstellungen, Kanäle und Ports prüft, ohne etwas zu ändern.
crabbox-apps
394kHilft deinem Agenten, eine App auf einer temporären Cloud-Maschine zu öffnen und auszuführen und ihre Ansicht in deinem Chat-Seitenpanel zu zeigen.