From 6e8b3d9e8e3e0caf472d9e03e80fcf0586f2571c Mon Sep 17 00:00:00 2001 From: Kit Rhett Aultman Date: Sun, 18 Jan 2026 14:09:58 -0500 Subject: [PATCH] llm_client_backend: add object type to completion marker The OpenAI chat completion API shows that streaming chat completion chunks should have the object type "chat.completion.chunk" in the completion marker chunk. Without this, some parsers of the OpenAI API don't handle chat completion streaming responses from this server. This commit fixes the lack of an object type, keeps compliance with the described API in the OpenAI docs (see https://platform.openai.com/docs/api-reference/chat/create), and ensures parsers like the Home Assistant HomeLLM addon work with it. --- backend/llm_client_backend.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/llm_client_backend.py b/backend/llm_client_backend.py index d4f00c1..5dba3dc 100644 --- a/backend/llm_client_backend.py +++ b/backend/llm_client_backend.py @@ -284,6 +284,7 @@ class LlmClientBackend(BaseModelBackend): } # Add normal completion marker yield { + "object": "chat.completion.chunk", "choices": [{ "delta": {}, "finish_reason": "stop"