Run TAO Inference Service

VerifiedCaution

Start, query, and stop a network-specific TAO inference microservice by delegating container execution to the appropriate platform skill.

Sby Skills Guide Bot
Data & AIAdvanced
8/5/2026
Claude Code
#tao#inference-microservice#model-serving#container-deployment#nvidia

Recommended for

Automated summary

Starts, queries, and stops a network-specific TAO inference microservice by resolving the container image, building the job payload, and delegating container execution to platform skills.

Strengths

  • Separates reference data (service, request, code templates) from procedure, making image mappings and payload schemas explicit.
  • Enforces safe secret handling by reading HF_TOKEN and other credentials from environment variables instead of prompting or hard-coding.
  • Handles the full lifecycle: start, readiness polling, request routing by job_id or network_arch, and stop.
  • Requires explicit user selection or confirmation of the service and sampling parameters, avoiding silent defaults.

Limitations

  • Relies on companion platform skills and reference YAML/template files, so it is not a standalone deployment workflow without the TAO skill bank.
  • Only covers TAO inference microservices with no cloud-storage dependency; weights must be fetched from HuggingFace Hub or provided via a local container path.
  • Secret handling requires environment variables such as HF_TOKEN, which may not fit environments where users cannot set runtime env vars.
When to use it

Use when you need to deploy, query, or tear down a TAO model inference endpoint using a microservice container.

When not to use it

Avoid when you need a general-purpose model server, cloud-storage-backed TAO jobs, or a fully self-contained skill without platform dependencies.

Security analysis

Caution
Quality score86/100

The skill is a legitimate NVIDIA workflow description for starting/querying/stopping inference containers. It has no exfiltration, obfuscation, or destructive commands, and it explicitly forbids hard-coding or prompting for secrets, instead reading them from env vars. Risk comes from the powerful execution surface it orchestrates (Docker/k8s/SLURM/brev, GPU and port binding, LoadBalancer exposure), plus a few hardening gaps: a permissive `umask 0`, a fixed writable /tmp registry path, an arbitrary image override, and a pattern-based `pkill` in cleanup. These are caution-level, not malicious.

Findings
  • •Inner command is prefixed with `umask 0 &&`, which makes files created by the inference container world-readable/writable and unnecessarily weakens permissions; the rationale is not explained.
  • •Service registry is written to a fixed, predictable path (`/tmp/tao-inf-ms-state.json`) in a world-writable directory; on multi-user hosts this is open to pre-creation/symlink tampering and leaks job IDs, endpoints, and arch metadata.
  • •The skill drives Docker/kubectl/sbatch/brev execution (image pull, GPU allocation, host port binding, `kubectl expose --type=LoadBalancer`), and it delegates the actual commands to platform skills whose contents are not included in this audit; the execution surface must be reviewed per-platform.
  • •Stop flow for SLURM uses `pkill -f "ssh.*-L.*{host_port}"`, a pattern-based kill that could terminate unrelated SSH tunnels matching the same pattern.
  • •Container image resolution honors an `IMAGE_<KEY>` environment-variable override that may be a full arbitrary image URI, allowing substitution of an unvetted image without further validation.
  • •Positive: secrets handling is explicit and sound — HF_TOKEN/WANDB/TAO credentials must be read from environment variables, are never to be hard-coded, prompted for, or logged, and no exfiltration, credential-echoing, curl|sh, obfuscated payload, or destructive filesystem operation appears in the content.
  • •Skill drives Docker/container execution, SSH port-forwarding, and kubectl exposure of services (LoadBalancer) via Bash — powerful operations used for a legitimate deployment purpose.
  • •Inner commands are prefixed with `umask 0 &&`, which makes files created by the container world-writable/readable; this weakens default file permissions on the host-mounted or container paths and is not explained.
  • •Cleanup step `pkill -f "ssh.*-L.*{entry['host_port']}"` uses a pattern match that could terminate unrelated SSH port-forward processes owned by the user.
  • •Kubernetes flow calls `kubectl expose job --type=LoadBalancer`, publishing the inference endpoint externally with no mention of auth/TLS or network restriction.
  • •Persistent service registry written to a shared, predictable path `/tmp/tao-inf-ms-state.json` without permission hardening.
  • •Positive: the skill has an explicit secrets rule forbidding prompting for or hard-coding secret values (HF_TOKEN, WANDB_API_KEY, etc.) and instructs reading them via os.environ; no credential exfiltration, obfuscated payloads, or destructive filesystem commands are present.
How this analysis is made

Examples

Start TAO inference service
Start a TAO inference microservice for the `classification` network architecture using my local checkpoint at /models/tao/classifier.ckpt and 1 GPU. Use the default sampling parameters and tell me the service endpoint.
Query running service
Send an inference request to the TAO service for job_id `infer-20250612-abc123` with the prompt 'Describe this image', max_tokens=256, and temperature=0.2. Ask me before overriding any other sampling defaults.
Stop service
Stop the TAO inference container running under job_id `infer-20250612-abc123` and clean up its service registry entry.

name: tao-run-inference-service description: > 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. license: Apache-2.0 compatibility: The inference service has no cloud-storage dependency — model weights come from the HuggingFace Hub (HF_TOKEN env var for gated models) or a local container path. Platform prerequisites are checked by each platform skill. metadata: author: NVIDIA Corporation version: "0.1.0" allowed-tools: Read Bash Write tags:

  • inference
  • microservice
  • workflow

TAO Inference Microservice

Standalone install? If this session was not initialized by the TAO skill bank plugin, run the tao-setup skill first (host preflight, credentials, cross-skill discovery).

Instructions

To start an inference service:

  1. Collect required inputs (Section 1) and resolve the container image (Section 2).
  2. Build the job payload and inner command (Sections 3–4.1); use references/code-templates.yaml → job_payload_builder.
  3. Read skills/platform/<platform>/SKILL.md and start the container (Section 4.2).
  4. Write the service registry and poll readiness (Section 4.3); use references/code-templates.yaml → registry_write.<platform> and readiness_check.

To send an inference request:

  1. Resolve which service receives the request per Section 6.0 (by job_id, by network_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 from references/code-templates.yaml → request.registry_read with the resolved job_id.
  2. 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.
  3. 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_arch names, 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:

  1. Tell the user which environment variable to set (e.g. export HF_TOKEN=...).
  2. 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:

  1. Read {network_arch}.config.json and take api_params.image (e.g. COSMOS_RL). This is a key into docker_image_defaults.mapping in references/service.yaml.
  2. Look up that key in the mapping. If the host env var IMAGE_<KEY> is set (e.g. IMAGE_COSMOS_RL), it overrides the mapped default.
  3. The mapped value is normally a dotted key into the repo-root versions.yaml manifest (e.g. tao_toolkit.cosmos_rl). Resolve it to a concrete nvcr.io/... image URI by looking up versions.yaml → images.<group>.<name>. Absolute URIs pass through unchanged, so an IMAGE_<KEY> env-var override that contains a full URI still works. The Python helper for this lives in references/code-templates.yaml.
  4. If the config file is missing or api_params.image is empty, fall back to the COSMOS_RL key.

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=nvidia with NVIDIA_DRIVER_CAPABILITIES=all and NVIDIA_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: fresh uuid.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_payload carries TAO_EXECUTION_BACKEND (per Section 3 table), TAO_API_JOB_ID, CLOUD_BASED=False. The inference service has no cloud-storage dependency; HF_TOKEN is the only cred env var that ever applies (for gated HuggingFace models).
  • cosmos-predict2.5 — flag-style cosmos_predict inference_microservice start ... --port 8080 (no setup. prefix; uses tyro.conf.OmitArgPrefixes). --job/--docker_env_vars are not accepted. Translate model_path to --checkpoint-path (local path) or --model <registered_key> (hf_model://); cloud URIs are rejected. The only cred env var that ever applies is HF_TOKEN for 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_BASED are 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 (not DockerSDK) 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:

print(f"Inference service started.")
print(f"  Job ID : {job_id}")
print(f"  Arch   : {network_arch}")
print(f"  URL    : {state[job_id]['host_url']}/v1/chat/completions")
print(f"Use this Job ID to send requests or stop the service.")

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

Ask the user for the job_id to stop. If they don't provide one, default to state["latest"] and confirm which job_id is being stopped. Read the registry using references/code-templates.yaml → stop.registry_read, then read skills/platform/<platform>/SKILL.md and use its cancellation / stop mechanism.

| Platform | Identifier to pass | Extra cleanup | |----------|--------------------|---------------| | local-docker | job_id_to_stop — container name | None | | brev | job_id_to_stop — container name | None | | slurm | entry["platform_job_id"] — SLURM job ID | pkill -f "ssh.*-L.*{entry['host_port']}" | | kubernetes | entry["platform_job_id"] — k8s job name | kubectl delete svc {entry["platform_job_id"]} -n <namespace> |

where entry = state[job_id_to_stop]. After stopping, clean up the registry: references/code-templates.yaml → stop.registry_cleanup.


6. Sending inference requests

6.0 Resolve which service receives this request (REQUIRED)

Each request must be routed to the specific service that runs the matching model. Routing happens by job_id — the registry stores network_arch per entry, so you can resolve a target by arch when the user names a model instead of a job_id. Apply these rules in order:

  1. User provided an explicit job_id → use it. Verify it exists in state.
  2. User named a network_arch (e.g. "send this to the cosmos-rl service") → look up matching entries: candidates = [j for j, e in state.items() if j != "latest" and isinstance(e, dict) and e["network_arch"] == arch].
    • Exactly one match → use it.
    • Multiple matches → prompt the user with the candidate job_ids and their started_at; do not auto-pick.
    • No match → stop and tell the user no service for that arch is running.
  3. No job_id and no network_arch → count non-"latest" entries in state:
    • Exactly one running service → use it.
    • Two or more → do not silently default to state["latest"]. Prompt the user with the full list (job_id, network_arch, host_url) and require an explicit choice. The "latest" pointer is a convenience for single-service workflows, not a routing fallback when multiple services coexist.
    • Zero → stop and tell the user to start a service first.

After resolving, read the endpoint from the registry (references/code-templates.yaml → request.registry_read), passing the resolved job_id as user_provided_job_id. Confirm to the user: "Sending to job_id=… arch=… url=…". If the service may still be loading, poll readiness first (references/code-templates.yaml → readiness_check).

Cross-check before sending: if the user-supplied request body contains arch-specific fields (e.g. guidance / num_steps / seed / negative_prompt → cosmos-predict2.5; required image_url/video_url content items → cosmos-rl), verify they are consistent with state[job_id]["network_arch"]. On mismatch, stop and ask — sending a cosmos-predict2.5 body to a cosmos-rl service will fail at the container with a 4xx/5xx that is harder to diagnose than catching it here.

6.1 Sampling parameters — REQUIRED user prompt before each request

Before constructing the request body, you MUST explicitly prompt the user for the vLLM-style sampling parameters. Do not silently apply defaults. Use a structured prompt, one question per field, that:

  1. Lists every applicable field with its type and default value.
  2. Lets the user skip / accept any field to take that field's default — entering a value is never required.
  3. Collects all fields in one round.

After the prompt, apply each user-entered value verbatim and substitute the default for any skipped field. Do not invent values or silently clamp.

Field list, defaults, and per-arch applicability: references/request.yaml → chat_completions_request_body (base sampling fields: max_tokens, top_p, temperature) and network_arch_constraints.<network_arch> (per-arch overrides and extras such as guidance/num_steps/seed/negative_prompt for cosmos-predict2.5). If a field is marked unsupported for the active arch, do not prompt for it and do not include it in the body.

6.2 Request format

Send a POST to {BASE_URL}/v1/chat/completions with Content-Type: application/json and a timeout of at least 300 s. The body is OpenAI-compatible (vLLM chat completions); see references/request.yaml → chat_completions_request_body for the full field schema and content-item shapes (text / image_url / video_url), and code_examples for ready-to-run Python and curl samples.

Constraints: only the first user message is processed. No secret values in request bodies. Per-network constraints (e.g. cosmos-rl requires every request to include an image or video; cosmos-rl rejects data: URIs) are in references/request.yaml → network_arch_constraints.

6.3 Response handling

| HTTP status | Meaning | Action | |-------------|---------|--------| | 200 | Success — choices[0].message.content has the generated text | Read result | | 202 | Server still initializing or model still loading | Retry after a delay | | 503 | Initialization failed, model load failed, or model not yet ready | Inspect error.type: model_not_ready → retry; initialization_error / model_load_error → give up and check logs | | 400 | Missing or empty JSON body | Fix request | | 500 | Unhandled exception during inference | Check container logs |

For 202 and 503, the body contains {"error": {"type": "<error_type>", "message": "<reason>"}}. See container_response_shapes in references/request.yaml for error type strings.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/run-tao-inference-service-msfn192w/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/run-tao-inference-service-msfn192w' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/run-tao-inference-service-msfn192w/download' --output '.skill-downloads/run-tao-inference-service-msfn192w/SKILL.md.part' && mv '.skill-downloads/run-tao-inference-service-msfn192w/SKILL.md.part' '.skill-downloads/run-tao-inference-service-msfn192w/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Environment declared by the author: The inference service has no cloud-storage dependency — model weights come from the HuggingFace Hub (HF_TOKEN env var for gated models) or a local container path. Platform prerequisites are checked by each platform skill.

Tools declared by the author (check availability in your agent): Read Bash Write

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/run-tao-inference-service-msfn192w/SKILL.md' && test -s '.skill-downloads/run-tao-inference-service-msfn192w/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/tao-run-inference-service' && cp -R '.skill-downloads/run-tao-inference-service-msfn192w' '.claude/skills/tao-run-inference-service'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/run-tao-inference-service-msfn192w'

openskills read 'run-tao-inference-service-msfn192w'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/run-tao-inference-service-msfn192w/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills