Model discovery (implicit provider)
WhenOLLAMA_API_KEY (or an auth profile) is set and neither
models.providers.ollama nor another custom provider with api: "ollama" is
defined, OpenClaw discovers models from http://127.0.0.1:11434:
models.providers.ollama.models list selects manual models and
skips discovery. When Ollama is in the agent’s model scope, an explicit
self-hosted endpoint with models: [] remains eligible for discovery;
models.providers.ollama.apiKey alone does not select that provider for Gateway
model browsing.
Failed discovery records an unavailable or catalog-authentication failure and
keeps the last successful inventory for the same endpoint and credentials. A
successful empty response clears discovered models. Manual models stay separate.
Hosted https://ollama.com entries skip discovery because Ollama Cloud models
are provider-managed. Without an explicit Ollama endpoint, a custom provider
with api: "ollama" and a non-loopback baseUrl suppresses ambient localhost
discovery; list that custom provider’s models manually (see
Configuration). Loopback custom providers such as
http://127.0.0.2:11434 keep ambient local discovery eligible.
You can use a full ref such as ollama/<pulled-model>:latest without a
hand-written models.json entry; OpenClaw resolves it live. For signed-in
hosts, selecting an unlisted ollama/<model>:cloud ref validates that exact
model with /api/show and adds it to the runtime catalog only if Ollama
confirms metadata — typos still fail as unknown models.
Smoke tests
For a narrow text probe that skips the full agent tool surface:--file with an image for a lean vision-model probe (accepts PNG/JPEG/WebP;
non-image files are rejected before Ollama is called — use
openclaw infer audio transcribe for audio):
/model ollama/<model> is an exact user choice: if the
configured baseUrl is unreachable, the next reply fails with the provider
error instead of silently falling back to another configured model.
Isolated cron jobs add one local safety check before starting the agent turn:
if the selected model resolves to a local/private-network/.local Ollama
provider and /api/tags is unreachable, OpenClaw records that run as
skipped with the model in the error text. This endpoint check is cached for
5 minutes per host, so repeated cron jobs against a stopped daemon do not all
launch failing requests.
Live verification:
OPENCLAW_LIVE_OLLAMA_EMBEDDINGS=1 since a
cloud key may not authorize /api/embed):