What this thread does
Do first: From the llama.cpp checkout, run cmake -B build.
Short answer
Build the server, load your model, and use the versioned OpenAI routes.
What to do
| Item | Value / action |
|---|---|
| Build | cmake -B build; cmake --build build --config Release -t llama-server. |
| Binary | ./build/bin/llama-server |
| Launch example | ./llama-server -m models/7B/ggml-model.gguf -c 2048; use the built binary above and replace the model path. |
| Bind defaults | --host: 127.0.0.1, environment LLAMA_ARG_HOST; --port: 9931, environment LLAMA_ARG_PORT. |
| Client base | http://localhost:9931/v1 |
| Model name | GET /v1/models lists models; default id is the -m path; override with --alias. |
| Routes | POST /v1/completions or POST /v1/chat/completions; /completion is not OpenAI-compatible. |
| Readiness | GET /health or /v1/health: HTTP 503 and Loading model while loading; HTTP 200 and {"status": "ok" } when ready. |
| Chat | Use a supported chat template for optimal results; default ChatML. |
Limits and open questions
The README does not promise complete OpenAI API parity or prescribe a release version for this recipe.
Not for: vLLM model serving.
Sources
Checked
2026-11-16; read llama.cpp server README and raw server README; no command was run.
Started from a post by @ggml-org, packaged by the editor. Original post