Dispatch bounded tasks to isolated LLM workers (GLM, Kimi, and more)
Project description
pilot-workers
Dispatch bounded tasks to isolated LLM workers. Your main AI agent (Claude, Codex, or any planner) stays in control of requirements, planning, and verification — the worker only executes what it's told.
What it does
- Provider isolation: each model (GLM, Kimi, DeepSeek, or your own) gets its own credentials, XDG directories, logs, and session storage. No cross-contamination.
- Fixed routing: provider, model, and endpoint are locked per YAML config. Tasks cannot override them.
- Security by default: API keys never appear in CLI args, environment variables, task contracts, or logs. Output is auto-redacted.
- Five modes:
code(edit),explore(read-only),test(run tests),review(read-only audit),resume(continue a prior code session). - Pluggable runners: the runner adapter layer (
RunnerABC) abstracts engine-specific details. Currently ships with OpenCode; designed for future alternatives. - Observable: two-line JSON contract (
started+ structuredverdictcarryingparse_state, a per-moderesult, andfinal_text_path) for AI planners; human-readablelatest.logfortail -f. - Per-run sandboxes: every dispatch runs inside its own isolated XDG tree (
providers/<key>/runs/<run_id>/) with a zero-copy symlink to the canonical credential and a shared per-provider cache; resume (--session+--run-id) reuses the original sandbox. - Host-level playbook: one
pilot-workersplaybook skill per host (Claude Code or Codex).install claude/install codexdeploys the same engine-neutral playbook regardless of which providers you've configured.
Install
pip install pilot-workers
Quick start
# 1. Install the worker runtime
pilot-workers install runner opencode
# 2. Configure credentials (interactive, key never displayed)
pilot-workers credentials glm
pilot-workers credentials kimi-k3
pilot-workers credentials ds
# 3. Deploy the playbook skill to your host
pilot-workers install claude # Claude Code: pilot-workers playbook skill
pilot-workers install codex # Codex: same playbook skill
pilot-workers install all # both hosts
# 4. Check everything is ready
pilot-workers status
# 5. Verify with a dry-run
pilot-workers run --provider glm --mode explore --workdir . --task "hello" --dry-run
# 6. Run a real task
pilot-workers template code > /tmp/task.md # generate a structured task template
# fill in the template, then:
pilot-workers dispatch --provider glm --mode code --workdir /path/to/project --task-file /tmp/task.md
# dispatch stdout = exactly two JSON lines: worker_runner.started + worker_runner.verdict
CLI reference
pilot-workers <subcommand> [args]
run Dispatch a task (streaming output).
dispatch Deterministic wrapper around run (two-line JSON: started + verdict).
fanout Dispatch several jobs concurrently; stdout = one JSON array of verdicts.
template Print the task template for a mode (code|explore|test|review).
install Install host playbook skill or runner.
install <host|all>
install runner <name>
uninstall Remove host playbook skill or runner.
uninstall <host|all>
uninstall runner <name>
status Show provider credentials, host installs, and runner state.
status [--json]
status <host>
credentials Configure isolated worker credentials.
maintain Worker log, run-sandbox, and worktree lifecycle tools.
maintain logs --older-than-days N
maintain runs --older-than-days N [--keep M]
maintain worktrees list|remove <path>
Adding a new provider
Drop a YAML file in data/providers/ (inside the package):
key: my-model
provider_id: my-worker
model_id: my-model-v1
base_url: https://api.example.com/v1
display_name: My Model Worker
context_tokens: 128000
output_tokens: 8192
# runner: opencode # optional, default opencode
# permissions: relaxed # optional, reference a permission profile
# asset_prefix: my-model # optional, default = key (legacy; no longer used for file naming)
# strengths: ... # optional, surfaced by `pilot-workers status`
# suitable_modes: ... # optional, surfaced by `pilot-workers status`
# notes: ... # optional, surfaced by `pilot-workers status`
Then pilot-workers credentials my-model and pilot-workers install claude (or codex) to deploy/refresh the host playbook skill.
Reserved keys (cannot be used as provider key): runner, all, on, claude, codex.
Host integration
The host is whatever AI agent acts as the planner. Each host ships ONE pilot-workers playbook skill (a doctrine playbook, not provider-specific syntax):
claude-host/skills/pilot-workers/: playbook skill for Claude Code (installed to~/.claude/skills/pilot-workers/)codex-host/skills/pilot-workers/: the same playbook skill for Codex (installed to$CODEX_HOME/skills/pilot-workers/)
pilot-workers install <host> copies the skill into the host's skill directory; it carries no engine-specific knowledge and is the same regardless of which providers you've configured. (The v0.4.0 12-agents + 8-commands matrix is gone.)
Adding a new host: create integrations/<name>-host/skills/pilot-workers/, put whatever config your host needs, point it at pilot-workers dispatch. See integrations/README.md.
Architecture
See CLAUDE.md for the current architecture, module reference, and conventions. See docs/architecture.md for the detailed contract and security model.
Development
python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest # 297 tests, all offline
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pilot_workers-0.5.0.tar.gz.
File metadata
- Download URL: pilot_workers-0.5.0.tar.gz
- Upload date:
- Size: 92.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13f535dc3831bfcab8d4ce0b1a34c65541df893a4c25729b7e29aed75b2619c6
|
|
| MD5 |
2c406befba628883b0a334ce41da3923
|
|
| BLAKE2b-256 |
de6689678eff805a6a3aa84621a1a7e1d76ba9d76334671cd5cff5b5f3b981b2
|
Provenance
The following attestation bundles were made for pilot_workers-0.5.0.tar.gz:
Publisher:
publish.yml on gWcyWoo/pilot-workers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pilot_workers-0.5.0.tar.gz -
Subject digest:
13f535dc3831bfcab8d4ce0b1a34c65541df893a4c25729b7e29aed75b2619c6 - Sigstore transparency entry: 2235498876
- Sigstore integration time:
-
Permalink:
gWcyWoo/pilot-workers@0d58389cf9846b5f938c04969dee31c56881fd94 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/gWcyWoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d58389cf9846b5f938c04969dee31c56881fd94 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pilot_workers-0.5.0-py3-none-any.whl.
File metadata
- Download URL: pilot_workers-0.5.0-py3-none-any.whl
- Upload date:
- Size: 80.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aab5ab0ed05f74a67377e14a11cdd1a9569064264390d766d60ca4730af1e319
|
|
| MD5 |
7f97fd551ba439d384db505851dfb74e
|
|
| BLAKE2b-256 |
b81c27ed3db9e0f91b947109334774a9220fb49e969821000e310d5c57d59642
|
Provenance
The following attestation bundles were made for pilot_workers-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on gWcyWoo/pilot-workers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pilot_workers-0.5.0-py3-none-any.whl -
Subject digest:
aab5ab0ed05f74a67377e14a11cdd1a9569064264390d766d60ca4730af1e319 - Sigstore transparency entry: 2235500400
- Sigstore integration time:
-
Permalink:
gWcyWoo/pilot-workers@0d58389cf9846b5f938c04969dee31c56881fd94 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/gWcyWoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d58389cf9846b5f938c04969dee31c56881fd94 -
Trigger Event:
push
-
Statement type: