Model server API

Local model servers expose an HTTP API, often compatible with OpenAI's chat format. An application calls it with a base URL, a model name, and messages; switching servers or providers then amounts to changing the URL and the model.

Example

curl http://localhost:11434/v1/chat/completions -d '{"model":"m","messages":[{"role":"user","content":"Hi"}]}'

Related concepts

The whole glossary