/** * Model Policy — THE single source of truth for the ecosystem's model DEFAULTS * and the model BLACKLIST. "Lock in our models": to change a default, edit it * HERE, not in the ~20 files that used to hardcode the same string. * * Division of responsibility: * - Per-provider model CATALOGS (which models a provider offers + their * capabilities) live WITH their adapters — OPENAI_MODELS, ANTHROPIC_MODELS, * GEMINI_MODELS, XAI_MODELS, LOCAL_LLM_MODELS, BITNET_MODELS, … . That is * correct: a provider owns its own model list. * - This module owns the cross-cutting POLICY: which model each TIER selects by * default, and which models are REFUSED everywhere (the blacklist). * * Everything that needs "the default local/fleet/cloud model" imports from here. * `@holoscript/llm-provider` is the lowest-level package in the model stack * (core, studio, mcp-server, services all depend on it; it depends on none of * them), so this is a cycle-free home for the SSOT. * * @version 1.0.0 */ /** * Canonical sovereign LOCAL (Ollama) default model. The on-device / LAN tier * (daily-driver Ollama, Jetson edge node). * * `qwen3:4b-instruct-2507` (classic Qwen3, non-thinking, 256K) — chosen over the * earlier `qwen3.5:4b` because Qwen3.5 reproduces the BLACKLISTED-class failure * on Ollama: it was trained on the Qwen3-Coder XML tool-call format, but Ollama * sends the Hermes-JSON parser, so tool calls fall through as PLAIN TEXT * (Ollama #14745/#14493) — the exact symptom we blacklisted qwen2.5 for. The * 2507 line has the proven Hermes parser path + BFCL ~62%/82.6% AST. See * research/2026-06-16_open-weight-model-lane-evaluation.md (W.512). The local * picker still PREFERS behaviorally-verified discovery; this is the floor. */ export declare const LOCAL_DEFAULT_MODEL = "qwen3:4b-instruct-2507"; /** * Canonical FLEET serving default — the model the sovereign GPU fleet serves * (vLLM / scale-to-zero autoscaler) when no explicit served model is pinned. * For the served CODE lane prefer LANE_DEFAULTS.code_served (qwen3-coder:30b). */ export declare const FLEET_DEFAULT_MODEL = "qwen3:4b-instruct-2507"; /** * Canonical CLOUD frontier default — the BYOK fallback when sovereign tiers are * unavailable AND a frontier key is present (F.112 sovereign-first, BYOK-fallback). */ export declare const CLOUD_DEFAULT_MODEL = "claude-opus-4-8"; /** * Back-compat alias: the local model picker's "safe fallback" IS the local * default. Kept as a named export so existing call sites keep working. */ export declare const SAFE_LOCAL_FALLBACK = "qwen3:4b-instruct-2507"; /** * Per-lane default models (D.085 "variable models per scenario"). Evidence-based * from research/2026-06-16_open-weight-model-lane-evaluation.md. A lane router * (capacity-plan Gap #2) selects these per request; until that wiring lands they * document the intended model per lane and back per-lane env overrides. * * NOTE: `code_served` / `vision` / `fleet_worker` tags must be pulled/served on * the target box before a lane routes to them (verify on Ollama/fleet first). */ export declare const LANE_DEFAULTS: { /** CODE, local 4B — proven Hermes tool-calls. */ readonly code_local: "qwen3:4b-instruct-2507"; /** CODE, fleet-served — purpose-built tool-calling (30B-A3B). */ readonly code_served: "qwen3-coder:30b"; /** OPERATOR — fast short chat; served alt: glm-4.5-air / minimax-m2. */ readonly operator: "qwen3:4b"; /** REASONING — cloud frontier; open co-primary: deepseek-v4-pro / kimi-k2.6. */ readonly reasoning: "claude-opus-4-8"; /** VISION — local GUI/screenshot agent (fills the cloud-only vision gap). */ readonly vision: "qwen3-vl:4b"; /** FLEET-WORKER — cheap 0.5-1.5B tool-caller; closes capacity-plan Gap #1. */ readonly fleet_worker: "granite4:1b"; }; export type ModelLane = keyof typeof LANE_DEFAULTS; /** The default model for a given lane (non-blacklisted by construction). */ export declare function laneDefault(lane: ModelLane): string; /** Execution tier a model runs in. */ export type ModelTier = 'local' | 'fleet' | 'cloud'; /** A catalog entry: a recommended model + the metadata lane routing / UIs need. */ export interface ModelLibraryEntry { /** Canonical id — Ollama tag for local/fleet, provider id for cloud. */ id: string; /** Lanes this model is recommended for. */ lanes: ModelLane[]; /** Approx parameters in billions (ACTIVE params for MoE; 0 = cloud/N-A). */ paramsB: number; /** License family — all entries are NMoS-clean to self-host or BYOK. */ license: 'apache-2.0' | 'mit' | 'gemma' | 'frontier'; /** Where it runs. */ tier: ModelTier; /** One-line capability note (tool-calling quality / caveat). */ note: string; } /** * THE model library — the current (2026-06) open-weight catalog the ecosystem * recommends, distilled from research/2026-06-16_open-weight-model-lane-evaluation.md. * LANE_DEFAULTS picks ONE model per lane; this is the fuller set incl. alternatives * so a lane router / model-picker UI can choose. Non-blacklisted by construction. * * ⚠ Local/fleet tags must be pulled/served on the target box before use; the * local picker's behavioral tool-call probe remains the real gate. Update this * list (and LANE_DEFAULTS) as the open-weight landscape moves — it is the SSOT. */ export declare const MODEL_LIBRARY: readonly ModelLibraryEntry[]; /** Library entries recommended for a lane. */ export declare function modelsForLane(lane: ModelLane): ModelLibraryEntry[]; /** Look up a library entry by exact id. */ export declare function modelLibraryEntry(id: string): ModelLibraryEntry | undefined; /** * Models that may still be useful inside their lane but must not be promoted as * usable final-output towers without an additional final-output gate. */ export declare const FINAL_OUTPUT_GATED_MODELS: readonly string[]; /** True when a model id belongs to a family barred from Tower C final output promotion. */ export declare function isFinalOutputGatedModel(name: string | undefined | null): boolean; /** * Model families the ecosystem refuses to auto-select. qwen2.5 (esp. * qwen2.5-coder:7b) FALSELY reports `tools` support in /api/show capabilities * yet emits malformed / prose tool calls — it lies past the capability check and * silently degrades real agent turns. Matched case-insensitively as a SUBSTRING * so every tag and quant variant (qwen2.5-coder:7b, qwen2.5:14b-instruct-q4_K_M, * qwen2.5-7b-instruct, …) is covered. */ export declare const MODEL_BLACKLIST: readonly string[]; /** True when `name` matches a blacklisted model family (case-insensitive substring). */ export declare function isBlacklistedModel(name: string | undefined | null): boolean; /** * Resolve a requested model against policy: returns it unless it is blacklisted, * in which case `fallback` (default: the safe local default) is returned. Use at * any seam that accepts an external/explicit model string. */ export declare function resolveAllowedModel(requested: string | undefined | null, fallback?: string): string;