The llm_kit library: LLM completion routing across OpenRouter, Claude, Codex and OpenCode backends, durable agent jobs, batch content pipelines, and the front-door HTTP server.
This directory is the llm-kit package. It implements the llm-kit command, a shared completion protocol for OpenAI-compatible, Claude CLI, Codex, and OpenCode backends, durable jobs, batch pipelines, and an OpenAI-compatible front door. It covers the command surface, completion protocol, adapter backends, dispatch, registry, jobs, pipeline, front door, execution, schema, storage, and scaffold modules.
Start
Read plugins/llm-kit/lib/llm_kit/cli/__init__.py for the command map and plugins/llm-kit/lib/llm_kit/completion/types.py for the protocol.
Routes
- CLI to verb
- Completion to backend
- Model to backend
Core areas
- plugins/llm-kit/lib/llm_kit/__init__.py - package root.
- plugins/llm-kit/lib/llm_kit/adapters/__init__.py - backends, runners, and capability records.
- plugins/llm-kit/lib/llm_kit/dispatch/__init__.py - model resolution, reachability, pacing, and backend selection.
- plugins/llm-kit/lib/llm_kit/registry/__init__.py - endpoints, credentials, effort, and declarations.
- plugins/llm-kit/lib/llm_kit/jobs/__init__.py - durable job model, runner, store, and events.
- plugins/llm-kit/lib/llm_kit/pipeline/__init__.py - batch runs, ledger, convergence, spend, analysis, and artifacts.
- plugins/llm-kit/lib/llm_kit/frontdoor/__init__.py - OpenAI-compatible server and acceptance.
- plugins/llm-kit/lib/llm_kit/execution/__init__.py - probes, interrupts, and schema validation.
- plugins/llm-kit/lib/llm_kit/schema/__init__.py - JSON repair and schema helpers.
- plugins/llm-kit/lib/llm_kit/storage/__init__.py - atomic JSON, transactions, and schema versioning.
- plugins/llm-kit/lib/llm_kit/scaffold/__init__.py - project scaffolding.
Key files
- plugins/llm-kit/lib/llm_kit/cli/__init__.py - command groups and migration hints.
- plugins/llm-kit/lib/llm_kit/completion/halt.py - halt taxonomy.
- plugins/llm-kit/lib/llm_kit/adapters/claude_runner.py - shared subprocess runner.
- plugins/llm-kit/lib/llm_kit/jobs/run.py - job launch, halt, and resume.
- plugins/llm-kit/lib/llm_kit/pipeline/execution/store.py - execution ledger.
- plugins/llm-kit/lib/llm_kit/pipeline/core/convergence_loop.py - convergence loop.
- plugins/llm-kit/lib/llm_kit/pipeline/runtime/spend_ledger.py - spend ledger.
- plugins/llm-kit/lib/llm_kit/frontdoor/server.py - HTTP server.
- plugins/llm-kit/lib/llm_kit/bootstrap_guard.py - bootstrap guard.