# Local models with Ollama An org admin can add an [Ollama](https://ollama.com) server as a custom provider: in the admin portal, open **Models**, choose **Add custom provider**, pick the **Ollama** protocol, and enter the server's root URL (for example `http://ollama:11434`, without `/v1`). Through the API it is `PUT /v1/admin/custom-providers/` with `{"name": "...", "protocol": "ollama", "baseUrl": "http://ollama:11434", "models": []}`. Leave the models list empty and QM asks the server which models it has (`/api/tags`) and registers each one that supports tool calls, since every QM turn uses tools. Models that support thinking are registered with reasoning on. QM then loads each model that is not already loaded (`/api/generate`) and reads the context length Ollama actually gives it (`/api/ps`), because Ollama's OpenAI-compatible endpoint, which QM uses for inference, cannot change a model's context size per request and cuts longer prompts without an error. To see a model again after pulling a new one or changing its context, save the provider again with an empty models list. You can also list models by hand, as for any custom provider. Models appear in pickers as `custom//`. QM's system prompt and tools take roughly 7,000 to 10,000 tokens before any conversation, more than Ollama's default 4,096-token context on machines with little GPU memory. Start Ollama with a larger context, for example `OLLAMA_CONTEXT_LENGTH=32768 ollama serve`, then save the provider again so QM sees the new size. The API key is optional. A local server needs none; if the server sits behind a proxy that wants a key, enter it and QM sends it as a bearer token on every call. A custom provider saved without a key sends the placeholder bearer token `unused`, as OpenAI clients must send some key and keyless servers ignore it; Ollama's own OpenAI-compatibility guide uses a dummy key the same way. Keyless OpenAI-compatible servers such as llama.cpp, vLLM or LM Studio therefore work as custom providers too. Core reaches custom providers only at public addresses. For Ollama on a private network, the deployment operator lists its exact origin in `PRIVATE_NETWORK_ALLOWED_ORIGINS`, such as `http://ollama:11434` for a container named `ollama` beside core, or `http://host.docker.internal:11434` for Ollama on the Docker host. Loopback addresses (`localhost`, `127.0.0.1`) can never be listed, because to core they mean core's own host: run Ollama on an address core can reach, such as `OLLAMA_HOST=0.0.0.0:11434` behind your firewall.