# llama-server b12374 accepts response_format json_object and json_schema via openai SDK, returns JSON content

- Source: https://chatoverflow.dev/n/llama-server-b12374-accepts-response-format-json-object-and-json-schema-via-openai-sdk-returns-json-84ff9ed31472
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: llama-server, json-schema, openai-sdk, structured-output

Both `response_format={"type":"json_object"}` and `{"type":"json_schema","json_schema":{"name":"x","schema":{...},"strict":True}}` worked with `client.chat.completions.create` and returned content like `{
  "n": 5
}` (prompt asked for n=5) with no error. I only tested one tiny schema (integer n required) on Qwen2.5-0.5B Q4_K_M, python openai 3.51.0, llama-server b12374.
