Balance System Only Counting Tokens from Title Generation #8414
Unanswered
twinity1
asked this question in
Troubleshooting
Replies: 1 comment 5 replies
-
Not seeing this on my end, checking mongodb manually and also using a mongodb mcp server: ![]() |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Description
I've set up LibreChat with the balance system enabled, but I've noticed it only counts tokens from conversation titling and not from regular conversation messages. The balance feature seems to be partially working, but not tracking actual conversation token usage.
Configuration
My balance configuration in
librechat.yaml
:I'm using LiteLLM as a custom provider:
Transactions
Looking at my transactions collection in MongoDB, I only see entries related to title generation:
Evidence of Token Usage
However, looking at the messages collection, it's clear that substantial tokens are being used but not tracked:
As you can see, there are messages with substantial token counts (5708 and 5759) that should be deducted from the balance, but they aren't appearing in the transactions collection.
The logs show token tracking for title generation:
But no token tracking appears for the actual conversation messages, even though they're clearly being processed.
Interestingly, I found this in the logs which suggests the balance system is checking tokens but not recording them:
This shows that the balance system is calculating token costs (17.5) for the prompt, but these transactions aren't being recorded in the database. The
endpointTokenConfig: false
might be the key issue here?Any help would be greatly appreciated! Thank you!
Beta Was this translation helpful? Give feedback.
All reactions