Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

1.2 KB
Raw Blame
-- 097_model_intelligence.sql
-- Model intelligence scores: per-model task-fitness from arena ELO, models.dev
-- tier rankings, and user overrides. Supports resolution chain (user_override
-- > arena_elo > models_dev_tier) and auto-expiry for stale synced data.

CREATE TABLE IF NOT EXISTS model_intelligence (
  model TEXT NOT NULL,
  source TEXT NOT NULL,           -- 'arena_elo' | 'models_dev_tier' | 'user_override'
  category TEXT NOT NULL,         -- 'coding' | 'review' | 'planning' | 'analysis' | 'debugging' | 'documentation' | 'default'
  score REAL NOT NULL,            -- [0..1] normalized fitness score
  elo_raw INTEGER,                -- original ELO if source='arena_elo'
  confidence TEXT,                -- 'high' | 'medium' | 'low' or CI string like '+10/-8'
  synced_at TEXT NOT NULL DEFAULT (datetime('now')),
  expires_at TEXT,                -- TTL for auto-invalidated scores (NULL = never expires)
  PRIMARY KEY (model, source, category)
) WITHOUT ROWID;

CREATE INDEX IF NOT EXISTS idx_mi_model_category
  ON model_intelligence (model, category);

CREATE INDEX IF NOT EXISTS idx_mi_source
  ON model_intelligence (source);

CREATE INDEX IF NOT EXISTS idx_mi_expires
  ON model_intelligence (expires_at) WHERE expires_at IS NOT NULL;