A series on building a company's IT with containers and open source
Every company is being asked "what's our AI strategy?" right now. For most small companies, the honest answer is: "a per-seat subscription to a public chatbot, and hoping nobody pastes the customer list into it."
Inner Bits has a different answer. An assistant that runs on the company's own hardware, signs in with the company's own identity, logs who used what, and can look things up in the company's own systems. Built entirely from free software and open-weight models.
Three layers
people ──> Open WebUI (chat, Keycloak sign-in)
editors ──> VS Code + Continue
│
▼
LiteLLM (gateway: keys, budgets, logs, routing)
│
▼
Ollama on the Windows host (GPU), localhost only
Ollama: the models
Ollama runs natively on Windows rather than in a container, so it can use the GPU directly. It serves llama3.1, qwen2.5-coder, mistral, nomic-embed-text for embeddings, and a tiny coder model for autocomplete.
A note for my fellow FSF members before you write in: Ollama is free software, but most of these models are open-weight, not free software. Their licences come with conditions, and you can't rebuild them from source. They're still the most free option available for running AI on your own hardware, and I'll take "runs on my machine, under my control" over "runs on someone else's, under their terms" every day.
Ollama listens on localhost only. Post 9 explains why: for a while it was cheerfully answering anyone on the tailnet with no authentication, and the network scanner caught it. Containers still reach it through Docker's host gateway.
LiteLLM: one gateway to rule them all
LiteLLM is an OpenAI-compatible gateway in front of the models. Nothing talks to Ollama directly any more, Open WebUI included. Everything goes through LiteLLM, which gives an IT department what it actually wants from AI:
- Virtual keys per client (Open WebUI, VS Code, the knowledge graph), each limited to certain models, with optional budgets;
- A log of every request, stored in PostgreSQL and visible in Grafana and Superset;
- One place to add a model, local or (later, if ever) a cloud provider;
- Prometheus metrics for requests, failures and rate limits.
Its admin UI signs in through Keycloak. The master key is the break-glass.
Open WebUI: the chat for everyone
Open WebUI is the chat. It signs in through Keycloak, lab-admins get its admin role automatically, and it sees models only through LiteLLM. It also sends traces and metrics, so it shows up in the same monitoring as everything else. If the AI is slow, I find out the same way I find out anything is slow.
For developers, Continue in VS Code uses the same LiteLLM models for chat and edits, with its own virtual key, plus a small model straight from Ollama for autocomplete, where speed matters more than wisdom.
Apps as tools: MCP
A chatbot that can only chat is a party trick. What makes it useful at work is when it can look things up. The Model Context Protocol (MCP) lets the assistant call tools, and several of the lab's apps now have MCP servers registered in Open WebUI:
| Tool server | What the assistant can do |
|---|---|
| Grafana | Read dashboards and alerts; run Prometheus and Loki queries |
| SonarQube | Read code-quality findings |
| n8n | Run workflows marked for MCP |
| Cognee | Remember and recall company knowledge |
So "why was Keycloak slow last night?" turns into a Loki query and a Prometheus query, answered from real data instead of vibes.
Every tool server uses read-only or narrowly scoped credentials (Grafana's is a Viewer service account), and the tools are admin-only by default. An AI with write access to production is a decision I want to make on purpose, not discover in a log.
Two practical notes: tool calling needs a model that was trained for it (llama3.1 and qwen behave, others mostly hallucinate tools that don't exist), and GitLab isn't connected yet, because its MCP server needs an OAuth dance that Open WebUI's server-side calls can't do.
Cognee: a company memory
The newest member is Cognee, which turns text and documents into a knowledge graph plus vector embeddings, all computed locally through LiteLLM. Through MCP, the assistant can remember, recall and forget. Like a colleague who actually reads the wiki.
The honest trade-offs: each remember runs entity extraction on the local GPU and takes a minute or two per paragraph, and Cognee is rate-limited so the chat doesn't starve. Change the embedding model, and the vector size changes, so everything has to be fed in again. It's the least mature corner of the lab, and the most fun to watch.
I also looked at another "context lake" product for this job, and dropped it when the project got archived. With younger open-source projects, check for a pulse before you commit.
Why bother, when a subscription is easier?
For a company, a private assistant answers the awkward questions a public one raises:
- Where does the data go? Nowhere. Prompts and documents stay on company hardware.
- Who used it, for what, and how much? Every request is logged per key and per user.
- Who can use it? Whoever is in the right Keycloak group, and nobody once they leave.
- What can it reach? Exactly the tools IT registered, with the scopes IT chose.
What you give up is model quality. Local 7–8B models are good at summarising, drafting, code help and tool calls. They're not frontier models, and they won't pretend to be. LiteLLM turns that into a routing decision rather than a rebuild: a cloud model could sit behind the same gateway, with the same keys and the same logging, for the jobs that need it. Following my own rule, that's a paid option I'll only reach for when there's genuinely no alternative.
Next, the finale: what all of this costs, what the same company would pay in SaaS or on Hetzner, Azure and AWS, and what I'd tell myself on day one.
Read next: Company in a Box, Part 11 of 11: What it costs vs. SaaS and the cloud
Comments
Post a Comment