Skip to content

v1.1.0 — Anthropic API, OpenAI, and Ollama judge providers

Latest

Choose a tag to compare

@denn-gubsky denn-gubsky released this 05 May 10:50
· 1 commit to main since this release

The three previously-stubbed judge providers are now real. Same JSON schema, same triangulation methodology, same workspace-isolated cache — pick whichever provider fits your billing model and privacy posture.

Five providers now available

Flag What it uses Cost Privacy
`--judge claude-cli` (default) Your Claude Code CLI subscription Included Diffs stay local
`--judge anthropic-api` Anthropic API + `ANTHROPIC_API_KEY` Metered per-token Diffs sent to api.anthropic.com
`--judge openai` OpenAI API + `OPENAI_API_KEY` Metered per-token Diffs sent to api.openai.com
`--judge ollama` Local Ollama server Free (your hardware) Diffs stay local
`--judge stub` Deterministic LOC-based fake n/a n/a (CI only)

Implementation highlights

Each provider uses its SDK's native structured-output mechanism, all sharing one schema source:

  • anthropic-api: forced `tool_use` pattern — single tool whose `input_schema` IS our judgment schema, `tool_choice` set to it. Result lifted from `tool_use.input`. Defaults to `claude-sonnet-4-5`; short aliases (`sonnet`/`opus`/`haiku`) translate to full model IDs.

  • openai: `response_format={"type":"json_schema","json_schema":{"strict":True,"schema":...}}`. Server-side validates every response against the schema. Requires gpt-4o or newer; defaults to `gpt-4o-2024-11-20`. Surfaces openai.refusal as a clear ValueError.

  • ollama: passes the JSON schema dict as the `format` parameter to `ollama.chat()`. Requires ollama 0.5+ for strict format constraint; older versions degrade gracefully. Defaults to `llama3.1:70b`; `OLLAMA_HOST` env var overrides the default localhost:11434.

New: cross-provider corroboration

Run the same target through different providers and the cache distinguishes them by (provider, model, prompt-version), so you can compare results without invalidating each other's cache:

```bash
ai-dev-effectiveness analyze ~/work/repo --judge claude-cli # one cache
ai-dev-effectiveness analyze ~/work/repo --judge openai # another cache, no overlap
```

If the multipliers agree across independent models, that's stronger evidence than any single model's number alone.

Agentic context tradeoff

`claude-cli` runs the bundled subagent with full tool access (Read, Grep, `git show`, ast-index) and investigates the diff dynamically — follows callers, reads related files, etc.

API providers receive the diff embedded inline (truncated at 800 lines). They have no shell access in this setup. For most commits the difference is negligible; for cross-cutting refactors that ripple across many call sites, `claude-cli` produces meaningfully better estimates.

This tradeoff is documented honestly in the README.

Install

The default `claude-cli` provider needs no extra deps. For the others:

```bash

Anthropic API

pipx install --force 'git+https://github.com/denn-gubsky/ai-dev-effectiveness#egg=ai-dev-effectiveness[judge-anthropic]'

OpenAI gpt-4o

pipx install --force 'git+https://github.com/denn-gubsky/ai-dev-effectiveness#egg=ai-dev-effectiveness[judge-openai]'

Ollama (local)

pipx install --force 'git+https://github.com/denn-gubsky/ai-dev-effectiveness#egg=ai-dev-effectiveness[judge-ollama]'
```

Test coverage

24 tests passing on Python 3.10/3.11/3.12. The 12 new API-provider tests use mocked SDK objects, so CI doesn't need API keys, real SDKs, or network access. Tests cover error paths (missing SDK, missing API key, OpenAI refusal) and verify each provider builds the right request shape (correct schema in the call kwargs).

Compatibility

No breaking changes. Existing v1.0.0 users (claude-cli, stub) keep working unchanged. The cache logic version bumped from v3 to v4 so cached judgments from the cli-only era automatically refresh on first run with the new code path — no manual cache clear needed.

```bash
pipx upgrade ai-dev-effectiveness # or pipx install --force git+...
```