A 404 from a proxy without /api/chat, or any other 404 error, was
reported as the configured model being missing. Generate now checks the
{"error": ...} payload for Ollama's model-not-found message naming the
configured model (double- or single-quoted); any other 404 stays a
ProviderError with its redacted body excerpt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
internal/ai/llm/ollama implements llm.Provider over plain net/http:
POST {base}/api/chat with "stream": false, the request schema in
"format", and options.temperature / options.num_predict only when the
request sets them; GET {base}/api/tags for ListModels and Verify. No
Authorization header is sent and redirects are not followed.
Usage comes from prompt_eval_count/eval_count. A schema reply that is
not a JSON object is ErrBadOutput. HTTP 404 on /api/chat is an
ErrProvider naming the configured model, without quoting the body.
Refused connections and timeouts match ErrTimeout and say
"Ollama not reachable at {base}"; a cancelled context stays
context.Canceled. The base URL is required, absolute http or https
(LAN hosts allowed), and may not carry userinfo, a query or a fragment.
Contract tests replay sanitized fixtures adapted from Ollama's public
API docs against httptest servers: success, schema output, model
missing and unreachable host.
Maestro task: 51289131-5abf-48c3-b553-7e3809c09076
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>