Llm

Managing Documents with Local LLMs and Self-Hosted Apps

Managing Documents with Local LLMs and Self-Hosted Apps

7 min read

I stopped relying on cloud AI services for document management. Instead, I run a self-hosted stack of Paperless-ngx, Paperless-GPT, and Paperless AI, backed by local LLMs through Ollama. Nothing leaves my network: academic records, certificates, invoices, tax filings, and receipts all stay on my own hardware.

This post documents the stack I built to manage documents locally: how Paperless-ngx serves as the central document hub, how Paperless-GPT handles OCR, how Paperless AI provides RAG-powered chat over the archive, and how everything connects to a local Ollama instance running Qwen 3, MiniCPM-V, and Llama 3.2.

Cost Optimization for LLM Systems: Spend Tokens Where They Matter

Cost Optimization for LLM Systems: Spend Tokens Where They Matter

3 min read

Ten thousand requests a day at a cent each is $100 daily — and enterprise scale turns that into five figures fast. Optimization isn’t corner-cutting; it’s spending tokens where they matter. Budgets, fallbacks, local inference break-evens, and caching form the practical stack, roughly in that order of effort.

Model Routing: Stop Using One Model for Everything

Model Routing: Stop Using One Model for Everything

4 min read

A 70B model summarizing an email burns money; a 3B model reviewing production code courts disaster. Routing matches task complexity to model capability across four strategies — capability, cost, latency, hybrid — each optimizing what hurts most. Production systems converge on hybrid; start there only after one model genuinely fails.

LLM Guardrails in Practice: Control the Risk, Not the Model

LLM Guardrails in Practice: Control the Risk, Not the Model

3 min read

Models hallucinate, leak data, emit harmful content, and refuse legitimate requests. Guardrails constrain behavior without removing capability — but only the guardrails that match real risk earn their latency. The discipline is knowing which ones matter and which are noise.

Multi-Model System Design: The Right Model for the Right Task

Multi-Model System Design: The Right Model for the Right Task

3 min read

Running a 70B model to summarize an email wastes money; running a 3B model to review production code courts disaster. Multi-model design isn’t about collecting models — it’s about architecture that puts the right model on the right task at the right time, with the simplest pattern that survives the constraints.