L Loach Docs
Ctrl K

Providers & connections

Loach talks to providers over HTTP. When the model dropdown is empty or every request fails, the problem is almost always reachability, authentication or key storage.

Ollama is installed but Loach can’t see it

Test connection in Settings → Providers says Connection failed, the model picker lists Ollama as Not running, or the model dropdown is empty even though ollama list works in a terminal.

  1. Make sure Ollama is running. If it’s installed on this computer, click Start Ollama in the model picker, or turn on Auto-launch Ollama in Settings → Providers so Loach starts it each time it opens. Otherwise: on Windows, the Ollama tray icon needs to be active; on Linux, the ollama service must be started; on macOS, launch the Ollama menu-bar app or run ollama serve from a terminal.
  2. Open Settings → Providers and check the Ollama base URL. The default is http://localhost:11434. If you run Ollama on another machine or a custom port, change it here, then click Test connection. A 404 there means the URL has a path on it: use the server’s address alone (http://localhost:11434, not …/v1 or …/api). A 401 or 403 comes from a proxy in front of Ollama asking for a login - Loach sends Ollama no credentials, so point it at Ollama directly.
  3. Click Refresh in the Models tab (or the refresh button at the top of the model picker). The list re-queries Ollama’s /api/tags endpoint.
  4. If Ollama runs on another host, make sure its firewall allows inbound connections on the chosen port and that OLLAMA_HOST=0.0.0.0 is set on the server side (Ollama binds to localhost by default).

“Start Ollama” shows an error

Clicking Start Ollama in the model picker ends in a red message under the button.

OpenAI says “invalid key” or returns 401

You added an OpenAI-compatible API key but every request fails with 401 (“API key invalid or expired”).

  1. Re-enter the key under OpenAI API key in Settings → Providers and click Save. Keys are stored in the operating system’s credential store, not on disk. Leading and trailing spaces are trimmed before saving, so a sloppy copy-paste isn’t the problem - a truncated one can be.
  2. Confirm the key is active on your provider’s dashboard and has not been rotated.
  3. If you’re using a custom OpenAI-compatible endpoint (vLLM, LM Studio, LiteLLM, OpenRouter, Groq), make sure the API base URL is the one its docs give - usually ending in /v1 (LiteLLM’s is http://localhost:4000; the presets dropdown at the end of the field fills in the common ones) - and that the endpoint accepts the same Authorization: Bearer … header the real OpenAI API uses.
  4. A server on another machine reached over plain http:// never gets the key: Loach only sends it over https://, or over http:// to this computer, so it can’t be read off the network. Put the server behind HTTPS, or turn off its key requirement if it’s on a network you trust. In a chat, the error then says “API key withheld because the base URL is http:// to another machine” rather than “API key invalid or expired”; Test connection reports it as a plain 401.

An OpenAI chat fails with “HTTP 400 Bad Request”

A chat on an OpenAI-compatible provider fails with OpenAI HTTP 400 Bad Request followed by the server’s own error.

Some models refuse request fields Loach sets on its own - OpenAI’s reasoning models (the o-series, GPT-5) reject max_tokens and any temperature but their default. When the server’s 400 names such a field (max_tokens, temperature, top_p, the frequency or presence penalty, seed or stream_options), Loach adjusts it and retries by itself - max_tokens becomes max_completion_tokens, the others are left out - so those never reach you as an error. A 400 that still shows is about something else: the server’s message after the status says what it refused.

Key won’t save on Linux

Saving the key shows a Couldn’t save API key error, or when you reopen Settings the key field shows the sk-… placeholder instead of •••••••• (stored). (The field itself is always blank - a saved key is never shown back.)

Loach uses the system Secret Service to store secrets. On minimal Linux installs (server-style, some tiling window managers) there is no Secret Service running.

  1. Install and start gnome-keyring or KWallet - whichever fits your desktop environment.
  2. Make sure a login session is unlocked so the keyring is available to user processes.
  3. Re-enter the key. Loach connects to the Secret Service again on each try, so a keyring that started after Loach is picked up without a restart; restart Loach if saving still fails.

On Windows, a key longer than 1,280 characters is refused with OpenAI API key is unusually long (N chars) - refusing to store, because Credential Manager can’t hold it. Check that you copied the key and nothing else.

On a managed Windows machine, see Windows - saving a key or the app lock fails.

Models list shows no models

Ollama is reachable but the list is empty.

You haven’t pulled any models yet. In the Models tab, click Pull model, type a tag (for example llama3.1:8b), and wait for the download to finish. The Models tab refreshes on its own when the download completes; if the chat-header picker doesn’t list the model yet, click the refresh button at the top of its menu.

The API models are missing from the picker

The API group in the model picker says Not connected or No models, it emptied after you cleared your key, or the model you want isn’t listed.