[GH-ISSUE #24294] issue: Analytics token count stays at 0 for streaming responses, but works with non-streaming (LiteLLM + Azure OpenAI | Completions API) #58921

Closed
opened 2026-05-06 00:27:52 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @DediCATeD88 on GitHub (May 1, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24294

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.9.2

Ollama Version (if applicable)

No response

Operating System

Debian 12 (Docker host)

Browser (if applicable)

Chrome

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When using streaming responses, token usage should still be persisted and shown correctly in Admin Analytics per user, just like it is when streaming is disabled.

Actual Behavior

With streaming enabled, Admin Analytics shows the correct message count per user, but token count stays at 0.

With streaming disabled, token counting works immediately and correctly.

This happens reproducibly in my setup:
Open WebUI -> Completions API -> LiteLLM -> Azure OpenAI.

I also tested LiteLLM with always_include_stream_usage: true, but this did not change the behavior.

Steps to Reproduce

  1. Deploy Open WebUI v0.9.2
  2. Configure Open WebUI to use LiteLLM as OpenAI-compatible backend via Completions API
  3. Configure LiteLLM to route requests to Azure OpenAI.
  4. Open Open WebUI Admin Analytics.
  5. Use a model through the normal chat UI with streaming enabled.
  6. Send one or more test prompts.
  7. Check Admin Analytics per user:
    • message count increases
    • token count remains 0
  8. Disable streaming for the same setup/model.
  9. Send another test prompt.
  10. Check Admin Analytics again:
  • token count is now recorded correctly

Logs & Screenshots

No frontend error is visible to the user.

Additional Information

No response

Originally created by @DediCATeD88 on GitHub (May 1, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/24294 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.9.2 ### Ollama Version (if applicable) _No response_ ### Operating System Debian 12 (Docker host) ### Browser (if applicable) Chrome ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When using streaming responses, token usage should still be persisted and shown correctly in Admin Analytics per user, just like it is when streaming is disabled. ### Actual Behavior With streaming enabled, Admin Analytics shows the correct message count per user, but token count stays at 0. With streaming disabled, token counting works immediately and correctly. This happens reproducibly in my setup: Open WebUI -> Completions API -> LiteLLM -> Azure OpenAI. I also tested LiteLLM with `always_include_stream_usage: true`, but this did not change the behavior. ### Steps to Reproduce 1. Deploy Open WebUI `v0.9.2` 2. Configure Open WebUI to use LiteLLM as OpenAI-compatible backend via Completions API 3. Configure LiteLLM to route requests to Azure OpenAI. 4. Open Open WebUI Admin Analytics. 5. Use a model through the normal chat UI with **streaming enabled**. 6. Send one or more test prompts. 7. Check Admin Analytics per user: - message count increases - token count remains 0 8. Disable streaming for the same setup/model. 9. Send another test prompt. 10. Check Admin Analytics again: - token count is now recorded correctly ### Logs & Screenshots No frontend error is visible to the user. ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-06 00:27:52 -05:00
Author
Owner

@Classic298 commented on GitHub (May 4, 2026):

likely fixed by 989d5fd4e2 and a32d26e61d

Testing wanted on dev

<!-- gh-comment-id:4374929351 --> @Classic298 commented on GitHub (May 4, 2026): likely fixed by https://github.com/open-webui/open-webui/commit/989d5fd4e2ce285edf4475a1e13f0981a78d3821 and https://github.com/open-webui/open-webui/commit/a32d26e61d24d9f63650faed5cb8909ed90af661 Testing wanted on dev
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#58921