How to use any OpenAI-compatible server
This guide shows how to run mini-me on a model server that has no dedicated provider — the OpenAI API itself, vLLM, LM Studio, OpenRouter, a company gateway — with the generic openai provider. It assumes the server speaks the OpenAI chat-completions protocol and supports tool calls.
Steps
-
Point the agent at the server, in its YAML:
provider: openai model: my-model # as the server names it: GET <baseUrl>/models baseUrl: http://localhost:8000/v1 # omit it for the OpenAI API contextWindow: 32768 # the window the server serves: this provider cannot ask for it -
If the server needs a key, export it — it never goes in the YAML:
export OPENAI_API_KEY=sk-…Another variable name:
apiKeyEnv: MY_GATEWAY_KEY. -
Start mm as usual (
mm agent.yaml,mm -tui agent.yaml,mm -acp). Checked with llmman's OpenAI address used as a generic server: the start-up probe lists the models, and abashtool call runs:🛠️ bash: echo hello-from-openai-provider │ hello-from-openai-provider 🤖 The command printed: `hello-from-openai-provider`
mm init --provider openai --base-url <address> writes such a file for you (see Create an agent with mm init).
Variants
- The OpenAI API. No
baseUrl,OPENAI_API_KEYexported, a model such asgpt-5-mini. Its reasoning models accept only the default temperature and takemax_completion_tokensinstead ofmax_tokens: write those insampling, and remove a key the API refuses. (Not measured in this repository.) - The key is refused. The start-up warning says
openai: <baseUrl> refused the key (HTTP 401) — export OPENAI_API_KEY. - Nothing answers. The warning says
openai: nothing answers at <baseUrl> — check baseUrl: …: the address must be the OpenAI-compatible one, usually ending in/v1. - A server mm has a provider for. Prefer it (
dmr,llamacpp,llmman,ollama): those know how the server reads a long prompt, turns reasoning off for a summary, unloads a model, and tell the window size. The generic provider does none of that.
See also
- Configuration reference — provider defaults: what
openaisends and does not - Providers — explanation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|