Ollama provider and local file storage for self-hosted deployments

rglauco adds Ollama as a first-class LLM provider and rewrites the file storage layer to support on-disk storage without Supabase Storage or R2. Together these make a fully self-hosted Mike deployment viable.

infrastructuresecurity

The Ollama integration is a new backend/src/lib/llm/ollama.ts (317 lines) implementing the same streaming/completion interface as the existing cloud providers. It routes via OLLAMA_BASE_URL (default http://localhost:11434/v1), which also covers llama.cpp via LLAMACPP_BASE_URL. Three default model names appear in the UI picker (local-gemma-26b, local-llama3.3, local-deepseek-r1), but any model name passes through at runtime. The user_api_keys schema gains ollama as a valid provider value, and the frontend gets an Ollama-aware model selector and an account-page form for base URL and key configuration.

The storage change is a +243 line overhaul of backend/src/lib/storage.ts. Local disk becomes the default when R2 credentials aren't set; files live under ./uploads (configurable via LOCAL_STORAGE_PATH). A new backend/src/routes/localFiles.ts serves stored files through short-lived signed tokens generated by lib/localSignedTokens.ts, keeping the existing frontend download flow working without modification. Mode selection is env-var driven: R2 credentials present takes priority over local disk.

The commit also ships binary test PDFs in tabular/ fixture directories, roughly 5 MB of blobs that have no place in a production fork. Strip those before importing. The storage mode switching is conditional logic woven through storage.ts rather than a clean interface, so the whole branching mechanism comes along for the ride.

So what Worth pulling if you want Ollama support or need to run without cloud file storage. The Ollama provider is self-contained and easy to isolate. The storage layer is more coupled - adopting it means accepting the env-var-driven mode selection throughout `storage.ts`. Strip the test PDF fixtures before importing. This is the privacy/self-hosting half of rglauco's fork; the other half (local Postgres) is in the Docker Compose commit.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from rglauco/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
10d12e77 feat: added ollama provider and local storage for privacy Glauco 2026-05-09 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-221.md from inside the repo you want the changes in.

⬇ Download capture-thread-221.md