OpenAI-compatible endpoints discard llama.cpp reasoning_content from Chat Completions responses
Hello folks, I'm using llm against a local llama.cpp endpoint serving Qwen3.8.
The server returns model reasoning successfully via the DeepSeek-style field:
choices.message.reasoning_contentand in streamed responses as:
choices.delta.reasoning_contentUnfortunately, llm displays/logs the prompt and final response but does not display reasoning on STDERR or store it in llm logs.
Expected behavior
For OpenAI-compatible Chat Completions endpoints, preserve:
- non-streaming
choices[].message.reasoning_content - streaming
choices[].delta.reasoning_content
as LLM reasoning content / ReasoningPart, such that it is:
- printed to STDERR during
llm prompt/llm chat - available in
llm logs - represented in
llm logs --json
Actual behavior
Only the normal assistant content is displayed and logged. No reasoning is shown on STDERR, included in log output, or visible in JSON logs.
Verification
Direct request to llama-server:
curl -sS http://127.0.0.1:8000/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "Qwen3.8-27B-UD-Q4_K_XL.gguf",
"stream": false,
"messages": [
{
"role": "user",
"content": "Explain the result briefly."
}
]
}' | jq '.choices.message'Returns both fields:
{
"content": "…final answer…",
"reasoning_content": "…reasoning trace…"
}The streamed curl test also returns delta.reasoning_content.
Server configuration
Relevant llama-server flags:
--jinja
--reasoning on
--reasoning-effort medium
--reasoning-format deepseekEnvironment
llmversion:llm, version 0.33llama.cpp commit:
b10470Model:
Qwen3.8-27B-UD-Q4_K_XL.ggufEndpoint:
http://127.0.0.1:8000/v1Operating system:
7.0.0-1019-nvidia #19~24.04.2-Ubuntu aarch64Invocation/configuration:
- model_id: qwen38 model_name: /opt/models/Qwen3.8-27B-UD-Q4_K_XL.gguf api_base: "http://localhost:8000" supports_tools: true
I have verified that no --hide-reasoning / -R option is in use.
PS: Thank you for this tool, it really is fantastic, and thank you for all the pelicans, they make reading Hacker News a bit more fun.
Source: simonw/llm