My AI stack is a set of layers, and each layer has one job. A layer can be replaced without rewriting the layers around it. That is what provider independence means in practice: the apps and agents I use do not depend on one model provider, one server, or one interface, because each of those sits behind a boundary that stays the same when the part behind it changes.
This post is a map. It names each layer in plain words, says what I use for it, and points to the project page that shows it in detail. The technical pages link back here for the terms, so they can stay focused on how each piece works.
The Layers
1. Hardware and platform
This layer is the machines and the software that keeps them running. Models need GPUs, storage that every server can reach, and a repeatable way to deploy services. I run all of this in my homelab: Proxmox VE for virtual machines, Ceph for shared storage, Docker Swarm stacks deployed through Portainer, and Ansible for host configuration. The platform is described in Praxis, my homelab. How I upgrade it with an AI agent while making each decision myself is in AI-assisted Proxmox and Ceph upgrades.
2. Model servers and generation
This layer runs the models. A model server loads a model into GPU memory and answers requests. I use Ollama for language models and ComfyUI for image and video generation. Both share the same GPUs, so they have to take turns. The language model side is in local model serving for provider independence. The image and video side, including the header loops on this site, is in generated header loops with ComfyUI. Takeflow is an experimental application for defining and reviewing those generation jobs.
3. Gateway
The gateway is the one address every app and agent calls. It decides which model server or hosted provider answers each request. I use LiteLLM. Because every client calls the gateway and not a provider, moving a workload from a local model to a hosted one is a configuration change in one place. This is also in local model serving.
4. Interfaces
This layer is where requests start. For people, the interface is Open WebUI, a chat application that lists local and hosted models side by side. For agents, it is Claude Code in my repositories and Hermes Agent, which I am testing with one profile per work topic in Taproot.
5. Tool access
An agent can only read or change a system if it is given a tool for it. MCP is the standard way I give agents those tools. I started with read-only access, scoped to what each agent needs. That work is in MCP servers for the homelab.
6. Method and context
A model knows nothing about my work until it is told. This layer is the written method and rules the agents load at the start of a session. The method is Topic Focused Workflow, packaged as an agent skill. The rules for each repository live in context files, which I keep short and split by purpose, as described in managing AI agent context files.
7. Visibility
This layer records what happened. Langfuse traces each model call: which model ran, for which workflow, with what input and output. Grafana, Loki and Prometheus cover the servers underneath: logs, metrics and dashboards. The tracing design is in LLM observability with Langfuse.
8. Guardrails
This layer decides what an agent is allowed to do. Agents get credentials scoped to the resources a task needs. Hooks check tool calls before they run. Deploys go through CI, not through an agent’s own commands. People approve changes. The details are in guardrails for AI-operated infrastructure. This website is one place those guardrails apply: the AI-maintained personal website describes how an agent makes the edits here and I decide what is published.
How a Request Moves Through the Stack
person agent
(Open WebUI) (Claude Code, Hermes Agent)
| | \
| | +--> tools via MCP
v v (read-only first)
+----------------------------------+
| gateway (LiteLLM) | ----> traces to Langfuse
+----------------------------------+
| |
v v
local model server hosted provider
(Ollama) (by configuration)
|
v
GPU
A person or an agent sends a request through an interface. The gateway picks a model server, local or hosted. The local server runs the model on a GPU. The gateway sends a trace of the call to Langfuse. When an agent needs to read or act on another system, it calls a tool through MCP, separately from the model request.
Terms Used on These Pages
Open-weight model. A model whose trained parameters are published, so anyone can download it and run it on their own hardware.
Quantization. Storing a model’s parameters at lower precision so it takes less memory and runs on smaller GPUs, at some cost in quality.
GPU memory (VRAM). The memory on the graphics card. A model has to fit in it to run quickly, so it limits which models a GPU can serve.
Context window. The amount of text a model can consider at once, including the prompt, any documents, and its own reply.
Tokens. The pieces of text a model reads and writes. Limits and prices are counted in tokens.
Reasoning or thinking mode. A setting where the model works through a problem before it answers. The thinking uses part of the output budget.
Inference. Running a trained model to produce an answer, as opposed to training it.
OpenAI-compatible API. The request format OpenAI published for its chat models, which most providers and open-source servers now accept. Clients that speak it can switch servers without code changes.
Gateway. A service between clients and model servers that routes each request, holds the keys, and records usage.
Provider independence. Being able to change which provider or server answers requests through configuration, without changing the apps.
Trace, session, generation. In Langfuse, a trace is one unit of work, such as answering one message. A generation is one model call inside it. A session groups the traces that belong to one conversation or task.
Agent. Software that uses a model to decide on steps and take actions with tools, not only to reply. My post breaking down the AI agent term separates the different things the word can mean.
Agent skill. A packaged set of instructions an agent loads for a specific kind of task.
MCP (Model Context Protocol). An open standard for connecting agents to tools and data sources, so one tool server can work with many agents.
LoRA. A small add-on trained on top of a model to teach it a specific style or subject without retraining the whole model.
Diffusion model. The kind of model most image and video generators use. It starts from random noise and removes it step by step until an image matches the prompt.
Image-to-video and first/last-frame video. Image-to-video starts a clip from a given image. First/last-frame video is given both the opening and closing image and generates the motion between them.
GitOps. Keeping the desired state of systems in a Git repository and having deployments follow that repository, so every change is reviewed and recorded.
Least-privilege access. Giving each person, service or agent only the permissions its task needs.
What This Means If You Are Choosing a Stack
Put a gateway in front of your providers early. If every app calls one provider’s SDK directly, switching providers means changing every call site. With a gateway, it is one configuration change.
Trace from the first day. Without traces, you cannot compare models, find where an agent failed, or see what a workflow costs. Adding tracing later means rebuilding history you do not have.
Give agents read-only tools first. Read access lets an agent investigate and propose. Scope each tool to what the agent needs, and add write access only where a task requires it.
Keep the method in files the agents load. Rules that live only in someone’s head, or in a chat history, are not applied the same way twice. Rules in a skill or context file are.
Decide early which workloads must stay local. Confidential or regulated data, sites without reliable internet, and work that needs repeatable results may rule out a hosted provider. The gateway lets the rest move freely. My reasoning is in Why I run AI and infrastructure locally.
Keep people approving changes. An agent can draft, plan and run checks. A person should approve what changes a live system, and the system should enforce that, not only the prompt.
If you want a more precise vocabulary for what an agent is, start with breaking down the AI agent term. If you are planning a stack like this and want to talk it through, contact me.