Spaces:
Running
Running
Commit Β·
a0ccb41
1
Parent(s): d406c40
fix(debate): use the free models that wrote a bear case on the VPS
Browse filesSuper VL, ERNIE, and Flint returned a real skeptical answer. Gemma, Lightning, and the router did not.
Co-authored-by: Cursor <cursoragent@cursor.com>
Files changed (3)
- README.md+1-1
- src/agents/debate.py+29-10
- tests/test_ops_fixes.py+15-3
76 unmodified lines7778798081828376 unmodified lines**Free models (OpenRouter `:free` tier, dynamically verified at runtime)**:- **Pitcher**: `nvidia/nemotron-3-ultra-550b-a55b:free` (also default `STRUCTURED_MODEL` and head of `MODEL_CHAIN`)- **Skeptic**: `openrouter/free`, then Lightning, then Gemma. Gemma's shared pool can refuse a whole hunt, so it is no longer the first skeptic.- **Judge**: `dots-studio/dots-3-note-preview:free` (dedicated JSON role)- **Fallback chain (`MODEL_CHAIN` in `src/llm.py`)**: `nemotron-3-ultra-550b-a55b:free` β `gemma-4-31b-it:free` β `dots-3-note-preview:free` β `nvidia/nemotron-3.5-lightning:free` β `openrouter/free` router catch-all- **Structured chain (`STRUCTURED_CHAIN`)**: walks `nemotron-3-ultra-550b-a55b:free` β `gemma-4-31b-it:free` β `dots-3-note-preview:free` β `openrouter/free` so framework fields survive rate limits.76 unmodified lines7778798081828376 unmodified lines**Free models (OpenRouter `:free` tier, dynamically verified at runtime)**:- **Pitcher**: `nvidia/nemotron-3-ultra-550b-a55b:free` (also default `STRUCTURED_MODEL` and head of `MODEL_CHAIN`)- **Skeptic**: `nvidia/nemotron-3.5-super-vl:free`, then `baidu/ernie-5.5-flash-preview:free`, then `recursive/flint-v1.0:free`. A 2026-11-19 VPS probe showed these three return a real answer. Gemma was refused, Lightning came back empty, and the router was slow.- **Judge**: `dots-studio/dots-3-note-preview:free` (dedicated JSON role)- **Fallback chain (`MODEL_CHAIN` in `src/llm.py`)**: `nemotron-3-ultra-550b-a55b:free` β `gemma-4-31b-it:free` β `dots-3-note-preview:free` β `nvidia/nemotron-3.5-lightning:free` β `openrouter/free` router catch-all- **Structured chain (`STRUCTURED_CHAIN`)**: walks `nemotron-3-ultra-550b-a55b:free` β `gemma-4-31b-it:free` β `dots-3-note-preview:free` β `openrouter/free` so framework fields survive rate limits.
36 unmodified lines37383940414243444531 unmodified lines777879808182838485868788899091929336 unmodified lines# 2026-10-12 benchmark showed returning empty/truncated completions and# rate-limiting constantly. Ultra-550B is the strongest free reasoner.PITCHER_MODEL = os.getenv("DEBATE_PITCHER_MODEL", "nvidia/nemotron-3-ultra-550b-a55b:free")# Gemma's free pool is a shared upstream limit. Spacing cannot clear it, so# the skeptic starts on the OpenRouter router and only then tries a fixed model.SKEPTIC_MODEL = os.getenv("DEBATE_SKEPTIC_MODEL", "openrouter/free")# Judge is the structured-output role; default to the dedicated JSON model so# it stays DISTINCT from pitcher and skeptic. _judge_model_chain() falls back# through MODEL_CHAIN if it is rate-limited.31 unmodified linesreturn outdef _fallback_for(primary: str) -> str:"""First backup for ``primary``. Kept for callers that want one model."""chain = _backup_candidates(primary)return chain[0] if chain else primarydef _call_chain(primary: str) -> list[str]:"""Primary plus two backups. The debate used to die after the second."""return [primary] + _backup_candidates(primary)[:2]class DebateState(TypedDict, total=False):"""Internal state for the debate subgraph."""ticker: str36 unmodified lines373839404142434445464748495051525331 unmodified lines85868788899091929394959697989910010110210310410510610710810911011111236 unmodified lines# 2026-10-12 benchmark showed returning empty/truncated completions and# rate-limiting constantly. Ultra-550B is the strongest free reasoner.PITCHER_MODEL = os.getenv("DEBATE_PITCHER_MODEL", "nvidia/nemotron-3-ultra-550b-a55b:free")# VPS probe on 2026-11-19: Super VL, ERNIE, and Flint returned a correct# AVOID in the message body. Gemma was refused, Lightning came back empty,# and the router was slow and empty during the morning hunt.SKEPTIC_MODEL = os.getenv("DEBATE_SKEPTIC_MODEL","nvidia/nemotron-3.5-super-vl:free",)SKEPTIC_BACKUPS = ("baidu/ernie-5.5-flash-preview:free","recursive/flint-v1.0:free",)# Judge is the structured-output role; default to the dedicated JSON model so# it stays DISTINCT from pitcher and skeptic. _judge_model_chain() falls back# through MODEL_CHAIN if it is rate-limited.31 unmodified linesreturn outdef _call_chain(primary: str) -> list[str]:"""Primary plus two backups. The debate used to die after the second.The skeptic uses the three models that answered on the VPS probe.Other roles keep the general free-model backups."""if primary == SKEPTIC_MODEL:chain = [primary]reserved = {PITCHER_MODEL, JUDGE_MODEL}for model in SKEPTIC_BACKUPS:if model not in chain and model not in reserved:chain.append(model)return chain[:3]return [primary] + _backup_candidates(primary)[:2]def _fallback_for(primary: str) -> str:"""First backup for ``primary``. Kept for callers that want one model."""chain = _call_chain(primary)return chain[1] if len(chain) > 1 else primaryclass DebateState(TypedDict, total=False):"""Internal state for the debate subgraph."""ticker: str
124 unmodified lines125126127128129130131132133134135124 unmodified linesskeptic_fb = debate._fallback_for(debate.SKEPTIC_MODEL)pitcher_fb = debate._fallback_for(debate.PITCHER_MODEL)skeptic_chain = debate._call_chain(debate.SKEPTIC_MODEL)check("skeptic starts on the router", debate.SKEPTIC_MODEL == "openrouter/free", debate.SKEPTIC_MODEL)check("skeptic backup is not the pitcher", skeptic_fb != pitcher, skeptic_fb)check("pitcher backup is not the skeptic", pitcher_fb != debate.SKEPTIC_MODEL, pitcher_fb)check("skeptic gets two backups", len(skeptic_chain) == 3, skeptic_chain)check("gemma is not the first skeptic", skeptic_chain[0] != "google/gemma-4-31b-it:free", skeptic_chain)calls = []sleeps = []124 unmodified lines125126127128129130131132133134135136137138139140141142143144145146147124 unmodified linesskeptic_fb = debate._fallback_for(debate.SKEPTIC_MODEL)pitcher_fb = debate._fallback_for(debate.PITCHER_MODEL)skeptic_chain = debate._call_chain(debate.SKEPTIC_MODEL)check("skeptic starts on Super VL",debate.SKEPTIC_MODEL == "nvidia/nemotron-3.5-super-vl:free",debate.SKEPTIC_MODEL,)check("skeptic backup is not the pitcher", skeptic_fb != pitcher, skeptic_fb)check("pitcher backup is not the skeptic", pitcher_fb != debate.SKEPTIC_MODEL, pitcher_fb)check("skeptic chain is Super VL, ERNIE, Flint",skeptic_chain == ["nvidia/nemotron-3.5-super-vl:free","baidu/ernie-5.5-flash-preview:free","recursive/flint-v1.0:free",],skeptic_chain,)check("gemma is not the first skeptic", "gemma" not in skeptic_chain[0], skeptic_chain)calls = []sleeps = []
README.md+1-1
src/agents/debate.py+29-10
tests/test_ops_fixes.py+15-3