Usage

Run everything from the project root, with --extra dev so the type checkers are actually on PATH inside uv’s environment.

# full pipeline: mine -> generate -> filter -> evaluate
uv run --extra dev pytifex --model command-a-03-2025

# stop once you've found N disagreements
uv run --extra dev pytifex --model command-a-03-2025 --num-examples 10

# a local model behind an OpenAI-compatible server
uv run --extra dev pytifex --model qwen3-6b --openai-base-url http://localhost:8080/v1

# the real OpenAI API
uv run --extra dev pytifex --model gpt-4o --openai-base-url https://api.openai.com/v1

# skip GitHub seed fetching, generate from patterns instead
uv run --extra dev pytifex --model command-a-03-2025 --no-github

# verbose output
uv run --extra dev pytifex --model command-a-03-2025 -v

Commands

Command Does
uv run --extra dev pytifex full pipeline (generate + evaluate)
uv run --extra dev pytifex generate generate disagreements only
uv run --extra dev pytifex check run the type checkers on examples that already exist
uv run --extra dev pytifex eval evaluate results that already exist

Options

Option Default Does
--num-examples N 5 target number of disagreements to find
--batch-size N 15 examples generated per LLM call
--max-attempts N 5 generation rounds before giving up
--max-refinements N 2 refinement passes per example that didn’t diverge
--model MODEL gemini-2.5-flash (pending removal — always pass this explicitly) model name, see providers below
--openai-base-url URL — base URL for an OpenAI-compatible endpoint
--eval-method METHOD comprehensive evaluation method
--no-github — skip GitHub seed mining
-v, --verbose — show every example, not just the disagreements

Providers

The provider is picked automatically from --model and --openai-base-url — there’s no separate --provider flag.

OpenAI-compatible

Triggered by passing --openai-base-url, regardless of model name. Works with real OpenAI, llama-server, Ollama, vLLM, or any server speaking /v1/chat/completions.

# real OpenAI
export OPENAI_API_KEY=your_key
uv run --extra dev pytifex --model gpt-4o --openai-base-url https://api.openai.com/v1

# a local model, no key needed unless the server requires one
uv run --extra dev pytifex --model qwen3-6b --openai-base-url http://localhost:8080/v1

# Ollama
uv run --extra dev pytifex --model llama3 --openai-base-url http://localhost:11434/v1

If OPENAI_API_KEY isn’t set and the server doesn’t require auth, that’s fine — it gets sent as an empty string.

Cohere

Needs COHERE_API_KEY or CO_API_KEY, triggered by any command-* model name.

uv run --extra dev pytifex --model command-a-03-2025
uv run --extra dev pytifex --model command-r-plus-08-2024

If you leave both --model and --openai-base-url unset, the CLI currently falls back to Gemini internally — that’s a leftover default that’s going away, not a supported path. Always pass one of the two options above.

What a run looks like

============================================================
PYTIFEX - Full Pipeline (with disagreement filtering)
============================================================

[STEP 1/2] Generating examples with disagreement filtering...
Target: 2 disagreement examples
Using model: command-a-03-2025

[Attempt 1/5] Generating batch of 15...
  Using 5 GitHub issue seeds
  Parsed 19 examples, running type checkers...
  ✓ generic-typevar-bound: DISAGREEMENT {'mypy': 'ok', 'pyrefly': 'ok', 'zuban': 'error', 'ty': 'ok'}
  ✓ self-in-protocol:      DISAGREEMENT {'mypy': 'error', 'pyrefly': 'error', 'zuban': 'error', 'ty': 'ok'}
  Progress: 2/2 disagreements found

GENERATION COMPLETE: 2 disagreements from 19 total examples

If something goes wrong

No disagreements found — try --max-attempts or --batch-size higher, or a more capable model.

GitHub rate limit errors — set GITHUB_TOKEN, or just run with --no-github.

“command not found” for a type checker — you forgot --extra dev. Without it, uv run pytifex only installs pytifex’s own two dependencies, not the checkers. Re-run with uv run --extra dev pytifex ....

Local server not responding — make sure the server process is actually up and the port in --openai-base-url matches. Double-check --model matches exactly what the server’s /v1/models endpoint calls it — a mismatch there is the most common cause of a 404.