012-custom-models.sql

 1-- Models table
 2-- Stores user-configured LLM models with API keys
 3
 4CREATE TABLE models (
 5    model_id TEXT PRIMARY KEY,
 6    display_name TEXT NOT NULL,
 7    provider_type TEXT NOT NULL CHECK (provider_type IN ('anthropic', 'openai', 'openai-responses', 'gemini')),
 8    endpoint TEXT NOT NULL,
 9    api_key TEXT NOT NULL,
10    model_name TEXT NOT NULL,  -- The actual model name sent to the API (e.g., "claude-sonnet-4-5-20250514")
11    max_tokens INTEGER NOT NULL DEFAULT 200000,
12    tags TEXT NOT NULL DEFAULT '',  -- Comma-separated tags (e.g., "slug" for slug generation)
13    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
14    updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
15);