Skip to main content Switch to mobile version buildwright 0.4.0 Per-agent model routing for AI agents: LangGraph orchestration, PydanticAI agents, LiteLLM-ready registry, Langfuse tracing
pip install buildwright==0.4.0 Copy PIP instructions
The craftsman who builds per the spec — one model per agent: mechanical steps go to the local model (cheap, fast), important decisions to the remote one (strong). The role→model mapping is configuration, not code — switching models touches zero lines of pipeline.
uv tool install buildwright # once published to PyPI # or for development: uv sync Division of roles (one tool, one job)
START → plan (local) → execute (remote) → review (local) → END Plan struct. final answer Review struct. Each node is a PydanticAI agent; the model is decided by the role in Settings (BW_ROLE_*), resolved against the models.yaml registry.
uv sync cp .env.example .env # adjust BW_ROLE_* and keys uv run buildwright models # list local and remote models uv run buildwright roles # role -> model mapping uv run buildwright ask "write a snake game in python with pygame" With no endpoints available, ask fails naming the exact model and the missing env var.
The whole registry speaks OpenAI-compatible (models.yaml):
local/qwen3 → Ollama at localhost:11434/v1
local/llamacpp → llama-server at localhost:8080/v1 (your GGUF)
remote/gpt-4o-mini, gpt-4o → OpenAI (key via OPENAI_API_KEY)
remote/claude-sonnet → Anthropic's OpenAI-compat layer
litellm/* → via the LiteLLM proxy (see docker-compose.yml)
Registry resolution: BW_MODELS_FILE > project-local ./models.yaml > the models.yaml bundled with the package. Adding a model = adding 5 lines. Reassigning one to an agent = changing a BW_ROLE_* in .env.
Optional full stack (LiteLLM + Langfuse + Ollama)
With Docker, docker compose up -d brings up LiteLLM (routing/fallbacks), Langfuse (traces) and Ollama. Langfuse keys show up in its admin UI; copy them to .env and tracing turns itself on (without keys, the tracer is a no-op).
Trusted publishing — no API tokens:
Create github.com/jordimarsal/buildwright and push main.
On pypi.org: Add a pending publisher → owner jordimarsal, repo buildwright, workflow release.yml, environment pypi.
git tag v0.1.0 && git push --tags → the workflow runs uv build and publishes.
In a project initialized with harness:
buildwright harness status # board + planned routing (read-only) buildwright harness run # the FULL feature loop (see below) buildwright harness run --feature f3_dashboard # specific feature buildwright harness approve "lgtm" # resume a parked gate: approve buildwright harness reject "add tests for R1" # resume a parked gate: reject status parses and schema-validates harness/feature_list.json (protocol v1) and shows the board plus which model each role would use.
run is the full feature loop (phase 2) — the graph is the leader. One feature runs batch after batch inside an isolated git worktree (.buildwright/, locally excluded), each batch being the next pending slice of tasks.md (capped at 4, harness discipline):
implement_batch → verify → init_gate → advance_batch → reviewer → traceability_gate → audit_gate → completion_gate → finalize verify re-reads tasks.md and diffs the worktree — a chat claim is not evidence. Nothing written = a stall: the same batch is re-dispatched with Nothing was written: …; two stalls in a row start a fresh agent session; a batch that makes no progress across 4 dispatches is parked.
hard gates run the scripts this protocol already has (init.sh must end [OK], check-traceability.py, and audit-security.sh / bench.sh for standard/strict). A failing gate feeds its log back to the implementer and loops back; 3 consecutive failures park the feature.
the reviewer issues a structured APPROVED / CHANGES_REQUESTED verdict written to harness/progress/review_ .md; two rejections in a row park.
completion_gate is a human gate: the loop interrupt()s and parks, with state persisted in a sqlite checkpointer (.buildwright/checkpoints.sqlite) so it survives restarts. approve merges to main, writes harness/specs/ /APPROVAL, flips status to done, and appends the retro: line to history.md; reject turns the feature back to the implementer with your comments.
Command allowlist defaults are built in; extend or retime via an optional project-owned harness/runtime.yaml (also max_batch_attempts, max_gate_cycles, max_review_rounds):
extra_allowed_commands: - terraform plan command_timeout_s: 300 max_gate_cycles: 3 The unattended multi-phase design lives in docs/specs/2026-10-27-harness-runtime-design.md.
uv run pytest # offline: pydantic-ai's TestModel, zero network Anti-mess rules
Everything speaks OpenAI protocol; PydanticAI never imports litellm.
One agent = one node = one job. No agents inside agents.
Tracing registered exactly once (observability.py); never scattered.
Offline evals in CI rule; Langfuse is production monitoring.
Each piece joins when it has a real trigger (fallbacks→LiteLLM, non-linear flow→LangGraph is already in).
Release history lives in CHANGELOG.md.
Both files in this release have provenance metadata.
MIT View SPDX License List
agents langfuse langgraph litellm llm model-routing pydantic-ai spec-driven-development
Development Status 3 - Alpha
Intended Audience Developers
Operating System OS Independent
Programming Language Python :: 3
Topic Software Development :: Libraries :: Python Modules
Release files for buildwright 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 235.0 kB
Release files / buildwright-0.4.0.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Release files / buildwright-0.4.0-py3-none-any.whl
Security for buildwright 0.4.0
Both files in this release have been uploaded with provenance metadata.
With provenance buildwright-0.4.0.tar.gz Oct 28, 2026
With provenance buildwright-0.4.0-py3-none-any.whl Oct 28, 2026
Attestation for buildwright-0.4.0.tar.gz
Attestation for buildwright-0.4.0-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Nov 14, 2026 2 release files Full provenance
Nov 2, 2026 2 release files Full provenance
Nov 1, 2026 2 release files Full provenance
Oct 30, 2026 2 release files Full provenance
Oct 29, 2026 2 release files Full provenance
Oct 28, 2026 2 release files Full provenance
Oct 27, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




