Skip to content

huggingface/hf-aws

Hugging Face CLI extension to deploy open-models from the Hub on AWS

https://skillcdn.ai/gh/huggingface/hf-aws

Connect this address to your AI to use this skill. How to connect

  • Unverified
  • Default branchmain
  • Commitfb1743f
  • LicenseMIT
  • Searchwords
View on GitHub

hf-aws

Plan, deploy, invoke, scale, and delete Hugging Face Hub models on Amazon SageMaker AI with hf aws. Use for SageMaker GPU estimates, deployment recipes, endpoint troubleshooting, and launching Pi or OpenCode against a deployment.

Path
skills/hf-aws/SKILL.md
License
MIT

hf-aws

hf aws COMMAND [OPTIONS] -o json

Use hf-aws instead for the standalone installation. For automation, pass -o json to get results on stdout and errors on stderr. Use the command's --help for its arguments. Harness launchers use their own output formats. Pass the user's --profile and --region consistently. Otherwise the CLI uses the Boto3 credential chain and session Region, with us-east-1 as the fallback. Private recipes and gated models require Hugging Face authentication.

Find a model and plan

  • models list --search QUERY searches the Hub. models MODEL_ID shows the model and pipeline task.
  • deploy MODEL_ID --list-recipes and recipes list --model-id MODEL_ID compare optimized recipes. Use --order-by throughput for output tokens per second, --order-by cost for USD per million output tokens, and --benchmark-suite single-request for interactive workloads. Run deploy MODEL_ID --recipe RECIPE --inspect for all benchmark suites and resolved settings. recipes list browses the catalog by model.
  • estimate MODEL_ID --hours HOURS --instances COUNT compares memory fit and projected compute charges. The prices are catalog snapshots. Check regional pricing before quoting a cost and use quota --instance-type SKU to check the regional endpoint quota separately.
  • deploy MODEL_ID --name ENDPOINT --instance-type SKU --dry-run previews the resolved plan. Use --print-code to export standalone Python. Provide the approved execution role with --role ARN, --role-name NAME, or SAGEMAKER_ROLE_ARN.

Deploy, invoke, and manage

hf aws deploy is shorthand for hf aws sagemaker deploy.

  • deploy MODEL_ID --name ENDPOINT uses the default recipe when available and waits for InService. Use --no-wait to return after submission, then deployments wait ENDPOINT. Use the endpoint name returned by deployment for later commands.
  • deployments list, deployments status ENDPOINT, and deployments describe ENDPOINT show endpoints, readiness, and deployed variants and models. Check failures with deployments logs ENDPOINT --tail 20.
  • deployments invoke ENDPOINT --input "Hello" sends a text inference request. Use --payload @request.json for a container-specific payload. deployments scale ENDPOINT --instances COUNT adjusts capacity. Supply --variant NAME for endpoints with multiple production variants.
  • deployments delete ENDPOINT --wait waits for AWS to remove serving compute. Use --yes for an authorized deletion in a noninteractive session.

Launch a coding agent

hf aws pi ENDPOINT --region REGION -- -p "Explain this repository"
hf aws opencode ENDPOINT --region REGION -- run "Explain this repository"

Use Pi 1.x or OpenCode 2.x on PATH with an InService endpoint that serves streaming OpenAI Chat Completions. For agent tools, use a model and container configured for tool calling. The CLI generates a temporary SageMaker bearer token from the AWS session. Relaunch to refresh it. Use --model to override the served ID and --context-window or --max-tokens to match the deployment limits. Harness arguments go after --. CLI README

Files of this skill

This skill has no supporting files.

Browse all supporting files