# Analyst model `lib/analyst.ts` talks to any OpenAI-compatible endpoint the user pastes in settings. Two calls, two jobs. `proposeCandidates` asks for 2 to 4 genuinely different remediation options and validates them against a zod schema: `key`, `title`, `diagnosis`, 1-4 `actions`, `option_type`, `sql_to_run`, `expected`. Fewer than two options is an error, because [[Jev scoring]] cannot rank a single option. `streamReport` writes the final answer as OpenUI Lang, streamed token by token into [[OpenUI report language]]. Its system prompt carries hard requirements: every option with `sql_to_run` gets a SqlBlock containing exactly that T-SQL, and every option gets a ScoreBar. Both calls spread the user's extra JSON parameters *after* `max_tokens`, which is how the output ceiling is raised from the settings screen without a rebuild. `extractJson` recovers an object from prose or fenced output and, when the response was cut off, names the character count instead of blaming the model. The local QA endpoint is `http://192.168.88.131:8888/v1` running `qwen3.8-flash-next`; it streams reasoning instead of content unless extra params include `{"chat_template_kwargs":{"enable_thinking":false}}`. Related: [[Jev scoring]], [[Option type and sql to run]], [[Placeholder SQL is dropped]], [[Output token ceiling]].