This commit is contained in:
Tim Baek
2026-02-01 07:59:02 +04:00
parent a4ad34841b
commit 96f106319e
2 changed files with 44 additions and 1 deletions

View File

@@ -107,6 +107,7 @@ from open_webui.utils.filter import (
)
from open_webui.utils.code_interpreter import execute_code_jupyter
from open_webui.utils.payload import apply_system_prompt_to_body
from open_webui.utils.response import normalize_usage
from open_webui.utils.mcp.client import MCPClient
@@ -3121,10 +3122,11 @@ async def process_chat_response(
else:
choices = data.get("choices", [])
# 17421
# 17421 - Normalize usage data to standard format
usage = data.get("usage", {}) or {}
usage.update(data.get("timings", {})) # llama.cpp
if usage:
usage = normalize_usage(usage)
await event_emitter(
{
"type": "chat:completion",