Ollama provider and plain-text document support; all defaults flipped to gemma4
Adds Ollama as a third LLM provider and extends the document pipeline to handle Markdown and plain-text files. The useful parts are well-isolated - but the fork also flips every model default to gemma4 and runs a schema migration to match, which breaks any deployment without a local Ollama server.
backend/src/lib/llm/ollama.ts implements streamOllama and completeOllamaText against Ollama's /api/chat endpoint with streaming, tool-call normalization, and a thinking channel. The provider router gains an ollama branch keyed on model IDs starting with gemma4. OLLAMA_BASE_URL defaults to http://localhost:11434. On the frontend, modelAvailability.ts treats Ollama as always-available - no API key check.
The text-document additions are in backend/src/lib/documentFormats.ts - four exports: ALLOWED_DOCUMENT_TYPES, contentTypeForDocument, decodeTextDocument, and isTextDocumentType. The documents route handles md/markdown/txt files inline and skips PDF rendering. extractStructureTree produces an outline from Markdown headings or non-empty lines, capped at 30. A new TextDocumentView.tsx component renders the content via react-markdown + remark-gfm.
Separately, the commit flips DEFAULT_MAIN_MODEL, DEFAULT_TITLE_MODEL, and DEFAULT_TABULAR_MODEL all to gemma4 and ships migration 001_default_gemma4.sql to rewrite the user_profiles.tabular_model column default in the database. A fresh deployment without an Ollama server running at port 11434 will have no working main model.
The commit also upgrades TypeScript to 6.0.3 with a Node.js engine constraint of >=25.9.0 <26, which tightens the runtime requirement.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?