Patzer v7.21 + v7.22: a Gemini coach, and what broke after it shipped The open-source Patzer chess app shipped v7.21 and v7.22, adding Google Gemini as a coach provider through its OpenAI-compatible endpoint while keeping the existing client code intact. The releases also fixed a Play-vs-Friend refetch loop that froze browser tabs, scaled the thinking-token reserve for always-thinking Gemini models, and added streaming coach answers, cost warnings before testing all models, and a two-tap Resign. The project now supports Ollama, vLLM, LM Studio, DeepSeek and Gemini, with the provider pattern documented in server/src/llm-providers.ts. I keep coming back to the same design line with Patzer: the engine does the thinking, the model does the talking. The server works out what a move allows, hangs or wins, and the LLM only turns that into a sentence a ten-year-old can follow. It is also why adding a new coach provider is a small change rather than a rewrite. The newest one, shipped in v7.21.0, is Google AI Studio PR 107, by @66ton99 https://dev.to/66ton99 . The coach can now talk to Gemini through its OpenAI-compatible endpoint, so the existing client code stays and only the provider entry is new. Three details from that PR are worth a look if you are wiring an LLM into anything: -latest aliases "none" is mapped to "low" and the response budget gets 1024 extra tokens, because the thinking tokens come out of the same max tokens you asked for and the visible answer comes back empty otherwise. reasoning effort with a 400 including the very unhelpful "Request contains an invalid argument." , the request is retried without it, the thinking reserve is kept, and the per-model outcome is cached so the next call does not pay for the failed round-trip again. /models catalog is filtered to chat-capable models, and the models/ prefix is stripped only for Gemini — other providers need it, so a blanket strip breaks them. Two more things landed in the same release, both about not lying to the user. "Test ALL models" now says what it will cost before it starts: on DeepSeek and Gemini every model is a paid call of up to 30 seconds, and the button used to fire all of them off without asking. And coach answers now stream to the browser one chunk at a time — the streaming callback was never awaited, so an answer could arrive out of order, while an error writing to a browser that had already gone away was swallowed and left the model generating until the hard timeout. That is the whole trick with provider support: the interesting work is in the edge cases, not the endpoint URL. The edge cases then found us. v7.21.1 killed a loop where Play → vs Friend refetched the lobby on every response, which re-ran the fetch, until the browser ran out of connections and the tab froze PR 109, reported and diagnosed by @dloyd09 . v7.22.0 caught the thinking reserve being too small: on always-thinking Gemini models it ran out of max tokens in the middle of a JSON game review, so the reserve now scales with the reasoning level 4096 / 8192 / 16384 and a length-truncated response widens numPredict on retry instead of hitting the same ceiling again. Same release adds live percentage and ply progress while Game Review analyzes, and makes Resign take two taps, because a stray click should not end a game PRs 118, 119, 113, 114 — all of it from @JacobStephens2 . The same contributor who gave us Gemini also gave the coach LM Studio and DeepSeek earlier, so the list is now Ollama, vLLM, LM Studio, DeepSeek and Gemini — local first, cloud optional. If the provider you want is missing, the pattern is in server/src/llm-providers.ts and it is a genuinely small PR. One Docker container, MIT licensed, your games stay on your LAN: https://github.com/SikamikanikoBG/patzer https://github.com/SikamikanikoBG/patzer