kulono / multi-model-verifier
blob · README.md · md
README.mdmd
1# multi-model-verifier23> One prompt, every model. If they disagree, hold the action.45## The problem67A single model can hallucinate — and you have no way to know. When the same8question is asked to three or four independent models, **agreement is evidence,9disagreement is a signal**. No mainstream agent framework ships a consensus gate.1011## What this does12131. Broadcasts the same prompt to all configured models (in parallel)142. Collects answers, computes a **divergence score** (0 = unanimous, 1 = chaos)153. Picks the majority answer as consensus and emits recommendations164. Exposes a `blocked` flag so high-stakes actions can be gated1718Provider-agnostic: you supply a `query(model_id, prompt) -> (text, latency)` callable.1920## Install2122```bash23pip install multi-model-verifier24```2526## Usage2728```python29from multi_model_verifier import broadcast_and_verify, execute_verify_multi3031def query(model_id: str, prompt: str):32 # your OpenAI/Anthropic/DeepSeek call here33 return answer_text, latency_seconds3435audit = broadcast_and_verify(36 models=["gpt-4o", "claude-sonnet", "deepseek-v3"],37 prompt="Is it safe to delete the production table?",38 query=query,39)40print(audit.to_summary())4142# Tool-style gate:43res = execute_verify_multi(models, prompt, query, threshold=0.3)44if res["blocked"]:45 raise PermissionError("Models disagree — action held for review")46```4748## Design4950- `audit.py` — `ModelAnswer`, `VerificationAudit`, `compare_answers` (consensus math)51- `broadcast.py` — parallel fan-out + `execute_verify_multi` gate wrapper5253Extracted from the tical-code agent mesh, where it runs as the `verify_multi`54tool before high-risk actions.5556## License5758AGPL-3.0. See LICENSE.59
100%