tao-run-on-virtualenv
Run a Python training/eval script directly in an existing local virtualenv — no docker, no container. Implements the four-verb consumer contract (submit/status/logs/cancel) over a vendored process-lifecycle runner with durable on-disk state, PID-reuse-safe identity, and process-group cleanup. Use for docker-free local execution, plain-Python model scripts, fast HPO/AutoML trial smokes, or hosts where containers are unavailable. Trigger phrases include "run in my venv", "no docker", "virtualenv execution", "local python training", "run this training script directly".
Unsigned, install at your own risk
UnverifiedThis skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install skills-nvidia-tao-toolkit-tao-run-on-virtualenvManual setup by platform
Claude Code
~/.claude/skills/skills-nvidia-tao-toolkit-tao-run-on-virtualenv/SKILL.md
Instructions
Virtualenv — docker-free local Python execution
Standalone install? If this session was not initialized by the TAO skill bank plugin, run the
tao-setupskill first (host preflight, credentials, cross-skill discovery).
The virtualenv platform runs a Python script natively in an existing venv —
as an argv vector whose first element is <venv>/bin/python, never through a
shell, never activating anything. The vendored runner
(references/virtualenv_runner.py) is this platform's "native CLI" — the role
docker/kubectl/sbatch play elsewhere — and owns only the process
lifecycle. Job records stay with tao_job_record.py; specs are authored by the
agent, exactly like every other platform.
When to use
- The workload is a plain Python script (its dependencies pip-installed in
a venv), not a TAO container action. - No docker on the host, or container startup cost isn't worth it (fast
smokes, AutoML trial loops over lightweight models). - Single node only. For TAO container actions use
tao-run-on-docker; for
clusters use-slurm/-kubernetes.
Preflight
# 1. The venv is real and has an executable interpreter.
[ -f "$VENV/pyvenv.cfg" ] && [ -x "$VENV/bin/python" ] || echo "MISSING: $VENV is not a venv"
# 2. The script's top-level imports resolve inside it (catches wrong-venv early);
# substitute the real modules your script imports.
"$VENV/bin/python" -c "import torch" || echo "MISSING: script dependency not in $VENV"
# 3. GPU visibility only if the script needs CUDA.
nvidia-smi >/dev/null 2>&1 || echo "note: no GPU visible (fine for CPU scripts)"
No credentials are required by the platform itself; model-specific env vars
(e.g. HF_TOKEN) pass through by NAME with -e (values never land on argv).
Storage
Tier A by definition — everything is local paths. Datasets must already be
on local disk (stage with tao-data-io first if they live in S3). Outputs land
in the job record's results_dir, which IS the runner's --job-dir.
Execution — the four verbs
$BANK = ${TAO_SKILL_BANK_PATH}; $RUNNER =
$BANK/skills/tao-run-on-virtualenv/references/virtualenv_runner.py.
submit
- Author the spec (if the script takes one) at a local path — nested
dicts, never flat dotted keys — and lint the assembled command with
redact_secrets.py lint. - Open the record — mints the id, binds
results_dirBEFORE launch:JOB_ID=$("$BANK/scripts/tao_job_record.py" open --platform virtualenv \ --image "$VENV/bin/python" --network-arch "$ARCH" --action "$ACTION" \ --storage-tier A --results-root "$RESULTS_ROOT") RESULTS_DIR="$RESULTS_ROOT/$JOB_ID" - Launch detached (the runner writes a durable wrapper that gates start,
records identity, and cleans up the process group on exit):
Placeholdersset -a; source /path/to/.env; set +a # omit if already exported python3 "$RUNNER" submit --job-dir "$RESULTS_DIR" --venv "$VENV" \ --script train.py --job-id "$JOB_ID" --config-path "$SPEC" \ --arg train --arg=--config={config_path} --arg=--out={results_dir} \ --gpu-ids 0 -e HF_TOKEN{config_path}{results_dir}{job_id}render inside
--argtokens. A token starting with-must use the--arg=TOKEN
form (argparse).--gpu-idssetsCUDA_VISIBLE_DEVICES;--gpus 0
hides GPUs; neither reserves anything. - Record RUNNING with the pid the runner printed:
"$BANK/scripts/tao_job_record.py" mark "$JOB_ID" --state RUNNING --backend-ref "pid:<pid>"
One submit per job dir — a retry gets a NEW record (--retry-of), never a
re-submit into the same dir.
status
python3 "$RUNNER" status --job-dir "$RESULTS_DIR" # {"status": "...", ...}
Prints the fixed vocabulary directly: PENDING RUNNING COMPLETE ERROR CANCELED UNKNOWN — no mapping table needed. Status is derived from durable files
(exit_status.json, launcher identity) and is safe to poll from any process,
any time, including after reboots of the polling agent. On a terminal status,
mark the record.
logs
python3 "$RUNNER" logs --job-dir "$RESULTS_DIR" --tail 200
cancel
python3 "$RUNNER" cancel --job-dir "$RESULTS_DIR"
"$BANK/scripts/tao_job_record.py" mark "$JOB_ID" --state CANCELED --source agent
Cancel marks first (a not-yet-started wrapper self-cancels at its start gate),
then uses a durable group guardian and Linux pidfds for SIGTERM→SIGKILL. The
guardian prevents PGID reuse during discovery; a pidfd pins each target across
the observation/signal boundary. already_terminal in the reply means the job
finished before the cancel — mark the record with the status it reports instead.
Platform caveats
- Linux active cancellation. Safe active-process termination requires
procfs,pidfd_open, andpidfd_send_signal. On another POSIX host the
ps/pgrepfallback can prove a group is empty, but cancellation of active
members returnsUNKNOWNinstead of risking a reused numeric PID or PGID. - No multi-node, no image resolution — there is no container. The "image"
recorded is the venv's interpreter path. - The runner never downloads anything. Remote inputs are the agent's job to
stage first (tao-data-io).
Security
Reviews (0)
Related skills
Browse all →More from skills
View source →More Build skills
Browse category →Frequently asked questions about tao-run-on-virtualenv
What does the tao-run-on-virtualenv skill do?
Run a Python training/eval script directly in an existing local virtualenv — no docker, no container. Implements the four-verb consumer contract (submit/status/logs/cancel) over a vendored process-lifecycle runner with durable on-disk state, PID-reuse-safe identity, and process-group cleanup. Use for docker-free local execution, plain-Python model scripts, fast HPO/AutoML trial smokes, or hosts where containers are unavailable. Trigger phrases include "run in my venv", "no docker", "virtualenv execution", "local python training", "run this training script directly". It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the tao-run-on-virtualenv skill?
Run `npx @skills-hub-ai/cli install skills-nvidia-tao-toolkit-tao-run-on-virtualenv` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/skills-nvidia-tao-toolkit-tao-run-on-virtualenv/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does tao-run-on-virtualenv work with?
tao-run-on-virtualenv runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the tao-run-on-virtualenv skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use tao-run-on-virtualenv after installing it?
In Claude Code, type `/skills-nvidia-tao-toolkit-tao-run-on-virtualenv` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the tao-run-on-virtualenv skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.