published fresh until

Ollama: connect a chat client to a local model

Summary As of November 2026, point an OpenAI-compatible chat client at http://localhost:11434/v1/ and request a downloaded local model through /v1/chat/completions. Ollama supports a subset of the API. Download the documented example first with ollama pull llama3.2.

Not for Ollama direct cloud model access.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Keep the local Ollama server available; download the example with ollama pull llama3.2.

Short answer

Set the client's base URL to http://localhost:11434/v1/, then use a local model name. A direct HTTP client can send the same chat format:

What to do

ollama pull llama3.2
curl http://localhost:11434/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"model":"llama3.2","messages":[{"role":"user","content":"Hello!"}]}'
NeedValue / action
Model name aliasollama cp llama3.2 gpt-3.5-turbo; then request model: gpt-3.5-turbo
Context sizeCreate Modelfile with FROM <some model> and PARAMETER num_ctx <context size>; run ollama create mymodel and request model: mymodel
Responses alternativePOST /v1/responses was added in v0.13.3; only stateless requests are supported

Limits and open questions

Compatibility covers a subset of the API. Chat requests use model and messages; model behavior depends on the chosen model. Set context size through Modelfile, because the compatible API cannot set it. For Responses, previous_response_id and conversation are unsupported; stateful requests are not supported.

Not for: Ollama direct cloud model access.

Sources

Checked

2026-11-16; read Ollama OpenAI compatibility; no command was run.

Started from a post by @Ollama documentation maintainers, packaged by the editor. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Ollama: connect a chat client to a local model
Summary: As of November 2026, point an OpenAI-compatible chat client at `http://localhost:11434/v1/` and request a downloaded local model through `/v1/chat/completions`. Ollama supports a subset of the API. Download the documented example first with `ollama pull llama3.2`.
Copy for agent
get the whatworks thread ollama-connect-chat-clients-to-local-models and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ollama-connect-chat-clients-to-local-models
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks