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.
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 QUERYsearches the Hub.models MODEL_IDshows the model and pipeline task.deploy MODEL_ID --list-recipesandrecipes list --model-id MODEL_IDcompare optimized recipes. Use--order-by throughputfor output tokens per second,--order-by costfor USD per million output tokens, and--benchmark-suite single-requestfor interactive workloads. Rundeploy MODEL_ID --recipe RECIPE --inspectfor all benchmark suites and resolved settings.recipes listbrowses the catalog by model.estimate MODEL_ID --hours HOURS --instances COUNTcompares memory fit and projected compute charges. The prices are catalog snapshots. Check regional pricing before quoting a cost and usequota --instance-type SKUto check the regional endpoint quota separately.deploy MODEL_ID --name ENDPOINT --instance-type SKU --dry-runpreviews the resolved plan. Use--print-codeto export standalone Python. Provide the approved execution role with--role ARN,--role-name NAME, orSAGEMAKER_ROLE_ARN.
Deploy, invoke, and manage
hf aws deploy is shorthand for hf aws sagemaker deploy.
deploy MODEL_ID --name ENDPOINTuses the default recipe when available and waits forInService. Use--no-waitto return after submission, thendeployments wait ENDPOINT. Use the endpoint name returned by deployment for later commands.deployments list,deployments status ENDPOINT, anddeployments describe ENDPOINTshow endpoints, readiness, and deployed variants and models. Check failures withdeployments logs ENDPOINT --tail 20.deployments invoke ENDPOINT --input "Hello"sends a text inference request. Use--payload @request.jsonfor a container-specific payload.deployments scale ENDPOINT --instances COUNTadjusts capacity. Supply--variant NAMEfor endpoints with multiple production variants.deployments delete ENDPOINT --waitwaits for AWS to remove serving compute. Use--yesfor 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.