Claude and Gemini backends replaced by a local OpenAI-compatible provider
andrsschultz deleted both LLM provider files and replaced them with a single `local.ts` that routes all calls to a `LOCAL_LLM_BASE_URL` endpoint. The streaming implementation handles reasoning models and multi-round tool use, and is the one part of this commit worth cherry-picking.
backend/src/lib/llm/claude.ts and gemini.ts are gone. The new local.ts (265 lines) targets any OpenAI-compatible endpoint - LOCAL_LLM_BASE_URL defaults to http://127.0.0.1:11434/v1, which is Ollama's default. LOCAL_LLM_MODEL, LOCAL_LLM_API_KEY, and LOCAL_LLM_MAX_TOKENS=16384 configure it. @anthropic-ai/sdk and @google/genai are removed from the backend package.
The streaming code handles content deltas, reasoning_content/reasoning fields for models that emit them, and tool-call chunks - accumulating function.name and function.arguments by index through applyToolCallDelta. Tool-use loops up to maxIterations (default 10). That logic is solid and would port cleanly as an additional provider route.
On the frontend, the BYOK key-management UI is stripped: ApiKeyMissingModal.tsx is deleted, account/models/page.tsx goes from ~215 lines to a stub, and the apiKeys parameter is removed from chat, tabular, and settings call chains. The user_profiles schema drops the claude_api_key and gemini_api_key columns.
Do not pull the deletions or the schema migration. Add local.ts as a third option in index.ts alongside the existing Claude and Gemini routes. Keep the BYOK UI and the model catalog.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?