nvidia-tao/tao-skill-bank/tao-run-inference-service
Claude Code and agent skill by nvidia-tao/tao-skill-bank
- community
Checking that the SKILL.md file is still in the repository.
Start, query, and stop a network-specific TAO inference microservice ({network_arch}-inference-microservice) by delegating container execution to the appropriate platform skill. Handles container image resolution, job-payload JSON construction, and the service registry. Use when the user wants to run inference on a TAO model checkpoint using a microservice container, deploy a TAO inference endpoint, or stop a running inference container.
Install
npx vskill@latest install nvidia-tao/tao-skill-bank/tao-run-inference-serviceSKILL.md
The same SKILL.md was published earlier as nvidia/skills/tao-run-inference-service.
TAO Inference Microservice
Standalone install? If this session was not initialized by the TAO skill bank plugin, run thetao-setupskill first (host preflight, credentials, cross-skill discovery).
Instructions
To start an inference service:
- Collect required inputs (Section 1) and resolve the container image (Section 2).
- Build the job payload and inner command (Sections 3–4.1); use
references/code-templates.yaml→job_payload_builder. - Read
skills/platform/<platform>/SKILL.mdand start the container (Section 4.2). - Write the service registry and poll readiness (Section 4.3); use
references/code-templates.yaml→registry_write.<platform>andreadiness_check.
To send an inference request:
- Resolve which service receives the request per Section 6.0 (by
job_id, bynetwork_arch, or by explicit user choice when multiple services run — never silently default to `"latest"` when more than one service exists), then read the endpoint fromreferences/code-templates.yaml→request.registry_readwith the resolvedjob_id. - Before building the request body, prompt the user for the vLLM-style sampling parameters (Section 6.1). Present
max_tokens,top_p,temperature(and any per-arch extras) with their defaults; let the user override or skip each one to accept the default. Never silently use defaults. - Build and send the body per Section 6.2; handle the response per Section 6.3.
To stop a service: Read references/code-templates.yaml → stop.registry_read to resolve the job_id, read skills/platform/<platform>/SKILL.md, then follow Section 5.
Reference data (schemas, mappings, valid values — no instructions):
- `references/service.yaml` — image mappings, valid
network_archnames, job payload schema, env var names, secrets classification. - `references/request.yaml` — endpoint definition, request field schema, response shapes, code examples.
- `references/code-templates.yaml` — Python templates for payload building, registry writes, readiness checks, and stop/request flows.
Secrets rule (applies to every generated code block in this skill)
Never ask the user to type a secret value into a prompt. For every secret value:
- Tell the user which environment variable to set —
export HF_TOKEN=...in their shell, or aKEY=valueline in a user-approved env file loaded withset -a; source /path/to/.env; set +a. - Never print,
cat, orReadsuch a file — verify presence only:[ -n "$HF_TOKEN" ] && echo SET || echo UNSET. - Generate code that reads it with
os.environ["VAR_NAME"]— never hard-code, interpolate, or prompt for the value.
Secret env vars (full list in references/service.yaml → secrets_handling): HF_TOKEN, WANDB_API_KEY, CLEARML_API_ACCESS_KEY, CLEARML_API_SECRET_KEY, TAO_API_KEY, TAO_USER_KEY.
Safe to collect in the prompt: network_arch, model_path, num_gpus, prompt text, WANDB_* config URLs, CLEARML_*_HOST URLs.
1. What to collect from the user
| Input | Role | |
|---|---|---|
| `network_arch` | Chooses container image, the per-arch inner command shape (references/service.yaml → container_commands.<network_arch>), and neural_network_name in the job JSON when applicable. Must match a basename in valid_network_arch_config_basenames in references/service.yaml (e.g. cosmos-rl, cosmos-predict2.5). | |
| `model_path` | The trained model checkpoint. Valid forms: hf_model://<org>/<model> (HuggingFace Hub — set HF_TOKEN for gated models) or a local container filesystem path. Cloud URIs (s3://, gs://, az://) are NOT supported — the inference service has no cloud-storage dependency. Always ask the user; never substitute a placeholder. See references/service.yaml → model_path_protocols. | |
| `platform` | Compute platform: local-docker, brev, slurm, or kubernetes. | |
| `num_gpus` | Defaults to 1; minimum 1 for inference. |
2. Image resolution
Each network_arch has a sidecar config file named {network_arch}.config.json. Resolve the container image as follows:
- Read
{network_arch}.config.jsonand takeapi_params.image(e.g.COSMOS_RL). This selects an entry fromdocker_image_defaultsinreferences/service.yaml. - If the host env var
IMAGE_<KEY>is set (e.g.IMAGE_COSMOS_RL), it overrides the packaged default. - For a key under
model_skill_defaults, callscripts/resolve_tao_image.pywith its model, action, and backend. This keeps the exact Cosmos image in the Cosmos model skill'sreferences/skill_info.yaml. - For a key under
mapping, resolve the dotted value against the repo-rootversions.yamlwithscripts/resolve_versions_key.py. Absolute environment overrides pass through unchanged. The Python examples live inreferences/code-templates.yaml. - If the config file is missing or
api_params.imageis empty, fall back to theCOSMOS_RLkey.
The config file also has spec_params.inference.model_path which drives folder vs file path semantics: if the value contains the substring folder, the container treats the path as a directory.
3. Environment variables (no callbacks)
Set these in env_payload before encoding env_json. Do not set TAO_LOGGING_SERVER_URL or TAO_ADMIN_KEY.
`TAO_EXECUTION_BACKEND` — must match the platform:
| Platform | TAO_EXECUTION_BACKEND value | |
|---|---|---|
| local-docker | local-docker | |
| brev | local-docker | |
| slurm | slurm | |
| kubernetes | local-k8s |
`CLOUD_BASED` — always "False" for this skill (disables callback posting to TAO_LOGGING_SERVER_URL).
GPU env vars — only needed when the platform skill does not handle GPU injection automatically:
- Tegra / Jetson:
--runtime=nvidiawithNVIDIA_DRIVER_CAPABILITIES=allandNVIDIA_VISIBLE_DEVICES=<ids>. - Standard x86 + nvidia-container-toolkit: use Docker
device_requests. The platform skill handles this.
4. Executing across platforms
The job payload and inner command (Sections 1–3) are platform-agnostic. For each platform, read `skills/platform/<name>/SKILL.md` for preflight checks and credentials before generating any execution code.
4.1 Build the inner command (per arch)
The inner-command shape is per `network_arch` — there is no uniform template. Look up the per-arch entry in references/service.yaml → container_commands.<network_arch>; if not present, the arch is unsupported — stop and ask. Pick the matching sub-block in references/code-templates.yaml → job_payload_builder.<network_arch>. Prefix the command with umask 0 && and keep it identical across platforms (local-docker, brev, slurm, kubernetes).
Common across arches:
job_id: freshuuid.uuid4()— becomes the container name and registry key.image: resolve per Section 2.- Secrets (
access_key,secret_key,HF_TOKEN, etc.) are read from env vars at runtime — never hard-code, never log or print.
Arch-specific notes (full details in references/service.yaml → container_commands):
- `cosmos-rl` — single
--job '<JOB_JSON>' --docker_env_vars '<ENV_JSON>'blob;json.dumps(...)+shlex.quote(...).env_payloadcarriesTAO_EXECUTION_BACKEND(per Section 3 table),TAO_API_JOB_ID,CLOUD_BASED=False. The inference service has no cloud-storage dependency;HF_TOKENis the only cred env var that ever applies (for gated HuggingFace models). - `cosmos-predict2.5` — flag-style
cosmos_predict inference_microservice start ... --port 8080(nosetup.prefix; usestyro.conf.OmitArgPrefixes).--job/--docker_env_varsare not accepted. Translatemodel_pathto--checkpoint-path(local path) or--model <registered_key>(hf_model://); cloud URIs are rejected. The only cred env var that ever applies isHF_TOKENfor gated HuggingFace models. Per-request params (prompt, inference_type, num_output_frames, guidance, seed, num_steps, negative_prompt) go in the request body, not at startup.TAO_EXECUTION_BACKEND/TAO_API_JOB_ID/CLOUD_BASEDare unused and may be omitted.
4.2 Delegate execution to the platform skill
Read `skills/platform/<platform>/SKILL.md` and follow it to start the container.
Base parameters (all platforms):
| Parameter | Value | |
|---|---|---|
image | resolved container image (Section 2) | |
command | inner — the shell string built in Section 4.1 | |
gpu_count | num_gpus | |
env_vars | env_payload | |
| job / container name | job_id — must equal the UUID from 4.1 so the registry can reference it | |
host_port (local-docker, brev) | host-side port to bind to container port 8080. Default 8080, but must be unique per concurrent service — see the port-allocation rule below. |
Platform-specific additional inputs:
| Platform | Additional inputs | |
|---|---|---|
| local-docker | None beyond base | |
| brev | instance_id (optional — reuse an existing instance); on multi-credential / multi-workspace accounts also cloud_cred_id and workspace_group_id for first-create — see skills/platform/tao-run-on-brev/SKILL.md | |
| slurm | partition and account — check SLURM_PARTITION/SLURM_ACCOUNT env vars; ask user if unset | |
| kubernetes | namespace (default: default); image_pull_secret (required for nvcr.io images) |
Port binding (local-docker and brev): use direct docker run so that -p <host_port>:8080 can be passed and the container name equals job_id exactly.
Port allocation rule (local-docker and brev, REQUIRED for concurrent services): Before starting a service, read the registry (/tmp/tao-inf-ms-state.json) and collect the set of host_port values from every existing entry on the same platform (and, for brev, the same instance_id). Pick the lowest free port starting from 8080 that is not in that set — e.g. host_port = next(p for p in range(8080, 8200) if p not in used_ports). The default 8080 only applies when no other service is running. This is what makes "start 3 services, each reachable at a distinct host_url" work; without it, services 2 and 3 fail with bind: address already in use. SLURM and kubernetes get distinct endpoints from their own platform mechanisms and do not need this step.
4.3 After start: service registry and endpoint
Write the service registry immediately after the platform confirms the container is running. The registry (/tmp/tao-inf-ms-state.json) is keyed by job_id; "latest" always points to the most recently started service.
See references/code-templates.yaml → registry_write.<platform> for the Python template.
| Platform | host_url | platform_job_id | Extra step before writing | |
|---|---|---|---|---|
| local-docker | http://localhost:{host_port} | — | None | |
| brev | http://{brev_ip}:{host_port} | — | brev ls → get instance IP (localhost is invalid on remote VM) | |
| slurm | http://localhost:{host_port} | SLURM scheduler job ID | Wait until Running; SSH port-forward localhost:{host_port}→{node}:8080 | |
| kubernetes | http://{external_ip}:8080 | k8s job name | kubectl expose job … --type=LoadBalancer; wait for external IP |
After writing the registry, print the job_id and URL:
Then poll for readiness — see references/code-templates.yaml → readiness_check. The container loads the model in the background; do not send requests before it returns 200.
5. Stopping the inference service
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/applications/tao-run-inference-service/SKILL.md
Popularity
- Repository stars
- 86
- Repository forks
- 24
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 28 Aug 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nvidia-tao/tao-skill-bank/tao-run-inference-service)