L Loach Docs
Ctrl K

Provider selection

Loach is a chat client, not a model. Out of the box it speaks two protocols: Ollama for local models running on your machine, and any OpenAI-compatible endpoint for hosted or self-hosted services. You can keep both wired up at once and switch between them at will.

Local: Ollama

The default backend. Loach talks to an ollama serve process over HTTP and probes it as soon as the app starts, so the models you’ve pulled are in the model picker without a refresh. The picker checks again whenever you change a base URL or key, and has its own refresh button. If Ollama is not running, the picker lists it as Not running and offers to start it for you (see below); the Models tab shows the connection error.

When the chosen model supports them, streaming, multimodal images and thinking-mode reasoning are passed through to the daemon without extra configuration. By default Loach looks for Ollama at http://localhost:11434 - change the Ollama base URL in Settings → Providers if it lives on another machine or port.

Starting Ollama from Loach

You do not have to run ollama serve by hand:

Cloud or self-hosted: OpenAI-compatible

Any endpoint that implements the OpenAI /chat/completions API works. That includes the real OpenAI API, plus vLLM, LM Studio, LiteLLM, OpenRouter, Groq and other proxies. Set the API base URL and OpenAI API key in Settings → Providers; the key is optional for local servers such as llama.cpp, LM Studio and vLLM.

A presets dropdown at the end of the base URL field one-clicks the URL to the documented endpoint for OpenAI, llama.cpp (llama-server), LM Studio, vLLM, or LiteLLM - handy when you switch between local proxies and hosted services.

The catalog is fetched with the saved key - or without one when the base URL points somewhere other than the OpenAI default, since local servers accept keyless requests. With the default URL and no key, Loach skips the catalog request instead of collecting 401s, and clearing the key empties the API model list so the pickers never offer a model that can only fail at send time.

API keys are saved into the OS credential store (Windows Credential Manager, macOS Keychain or the Linux Secret Service), not written into the SQLite database, and never handed to the app’s web view - the Settings field only shows whether a key is stored. The key is sent only over https://, or over http:// to this computer; an http:// server elsewhere on your network gets requests without it. Windows Credential Manager can’t hold a key longer than 1,280 characters, so Loach refuses one up front (“OpenAI API key is unusually long … - refusing to store”). On Linux, a Secret Service that wasn’t running yet when Loach first needed it is connected on the next save or read, without a restart; until then a local server’s catalog is still listed, as if no key were stored.

Some servers need special handling, which Loach does on its own:

Test connection

Each provider section exposes a one-click probe so you can verify a base URL (and API key) before opening a chat:

A failed test adds a hint under the raw error when it recognises the cause: an unreachable server, a URL that doesn’t parse, an unauthorized key, a /models path that wasn’t found, or a blocked link-local address. The Ollama test sends no credentials, so there a 401 or 403 points at a proxy in front of Ollama that asks for a login (aim Loach at Ollama directly), and a 404 means /api/tags wasn’t found - use the server’s address without a path, such as http://localhost:11434 rather than …/v1 or …/api.

The model picker

Every chat has a model dropdown in its header, labelled with the current model and provider. It lists both providers’ catalogs grouped by provider: Ollama, with a green tick when it’s running or an amber warning when it isn’t, and API, which lists every model the endpoint returns (or Not connected when there is no key). A long list scrolls, and typing a model’s first letters jumps to it. With no Ollama models and no API key, a Configure providers… entry opens Settings → Providers. Picking a model:

You can also switch from the composer: /model <name> takes an exact name or a unique part of one - write ollama/<name> or openai/<name> when both providers serve the same id - a bare /model opens this picker, and /list models shows what’s available. /unload frees the chat’s Ollama model from memory; it loads again with your next message. See Slash commands.

Heads up

You can switch providers mid-conversation. The chat keeps its full message history; only future replies use the new model. Use this freely to compare answers across models without copy-pasting context.

When a request fails

A failed reply ends with a one-line warning that names the provider and base URL, then says what went wrong in plain words - for example “Ollama (http://localhost:11434) - could not reach the endpoint. Is it running and the URL correct?” The common cases:

Anything else is shown as the provider’s own error text.