auditor: sweep model lanes off lapsed Ollama Cloud onto OpenRouter

Ollama Cloud sub lapsed 2026-09-02 — every ollama_cloud model 402s.
Consensus lane -> openrouter/deepseek/deepseek-chat-v3.1 (same lineage),
tie-breaker -> openrouter/x-ai/grok-4.3 (4.1-fast deprecated upstream),
kimi_architect -> openrouter/moonshotai/kimi-k2.6 via provider default
so the Kimi<->Haiku alternation stays intact. maxTokensFor learns the
vendor-prefixed kimi id. All three lanes + pr_audit mode runner probed
live through the gateway before landing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
root
2026-09-02 04:05:13 -05:00
co-authored by Claude Fable 5
parent c97f52de82
commit 0661c2cb83
2 changed files with 20 additions and 13 deletions
+10 -5
View File
@@ -28,11 +28,16 @@ const GATEWAY = process.env.LH_GATEWAY_URL ?? "http://localhost:3100";
// retries — verified with trivial 8-token probes). Swapped default to
// deepseek-v3.1:671b which is proven working end-to-end through the
// pr_audit mode runner during Phase 5 distillation acceptance testing.
// kimi-k2:1t can be re-selected via LH_AUDITOR_REVIEW_MODEL env when
// the upstream returns. Tie-breaker stays grok-4.1-fast (different
// vendor lineage so consensus + tie-break won't fail-correlate).
const MODEL = process.env.LH_AUDITOR_REVIEW_MODEL ?? "deepseek-v3.1:671b";
const TIEBREAKER_MODEL = process.env.LH_AUDITOR_TIEBREAKER_MODEL ?? "x-ai/grok-4.1-fast";
//
// 2026-09-02 update: Ollama Cloud subscription lapsed — every
// ollama_cloud model 402s ("requires a subscription"). J's call: sweep
// the auditor to OpenRouter. Same deepseek lineage via OpenRouter;
// tie-breaker moves to grok-4.3 because OpenRouter 404s grok-4.1-fast
// as deprecated. Both probed live through the gateway before landing.
// Vendor lineages stay distinct so consensus + tie-break won't
// fail-correlate.
const MODEL = process.env.LH_AUDITOR_REVIEW_MODEL ?? "openrouter/deepseek/deepseek-chat-v3.1";
const TIEBREAKER_MODEL = process.env.LH_AUDITOR_TIEBREAKER_MODEL ?? "openrouter/x-ai/grok-4.3";
const N_CONSENSUS = Number(process.env.LH_AUDITOR_CONSENSUS_N ?? 3);
const AUDIT_DISCREPANCIES_JSONL = "/home/profit/lakehouse/data/_kb/audit_discrepancies.jsonl";
// 40KB comfortably fits the consensus models' context windows
+10 -8
View File
@@ -51,13 +51,15 @@ const CALL_TIMEOUT_MS = 900_000;
const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
const MAX_DIFF_CHARS = 180_000;
const MAX_PRIOR_FINDINGS = 50;
// Default provider/model = ollama_cloud/kimi-k2.6. Pre-2026-04-27 we
// went direct to api.kimi.com, but Ollama Cloud Pro now exposes the
// same model legitimately, so we route there to avoid User-Agent
// gating. The api.kimi.com path (provider=kimi) remains wired in the
// gateway as a fallback for when Ollama Cloud is upstream-broken.
const KIMI_PROVIDER = process.env.LH_AUDITOR_KIMI_PROVIDER ?? "ollama_cloud";
const KIMI_MODEL = process.env.LH_AUDITOR_KIMI_MODEL ?? "kimi-k2.6";
// Default provider/model = openrouter/moonshotai/kimi-k2.6.
// History: pre-2026-04-27 direct api.kimi.com (User-Agent gating),
// then ollama_cloud/kimi-k2.6 while the sub was active. 2026-09-02:
// Ollama Cloud subscription lapsed (402 on every cloud model), J's
// call was to sweep the auditor to OpenRouter — same Moonshot model,
// probed live through the gateway. The api.kimi.com path
// (provider=kimi) remains wired in the gateway as a fallback.
const KIMI_PROVIDER = process.env.LH_AUDITOR_KIMI_PROVIDER ?? "openrouter";
const KIMI_MODEL = process.env.LH_AUDITOR_KIMI_MODEL ?? "moonshotai/kimi-k2.6";
// Cross-lineage alternation. 2026-04-27 J's call: Opus is too
// expensive to auto-fire (~$0.30/audit). Kimi K2.6 via Go-sub is
// effectively free; Haiku 4.5 via Zen is ~$0.04. Alternate between
@@ -111,7 +113,7 @@ function maxTokensFor(model: string): number {
if (MAX_TOKENS_OVERRIDE > 0) return MAX_TOKENS_OVERRIDE;
if (model.startsWith("claude-opus")) return 32_000;
if (model.startsWith("claude-haiku") || model.startsWith("claude-sonnet")) return 8_192;
if (model.startsWith("kimi-")) return 128_000;
if (model.startsWith("kimi-") || model.includes("/kimi-")) return 128_000;
if (model.startsWith("gpt-5") || model.startsWith("o1") || model.startsWith("o3") || model.startsWith("o4")) return 32_000;
return 16_000;
}