Bug: High-frequency token calculations cause input lag

Currently, every time a character is entered into the input field, the token calculator restarts a full calculation cycle—note, for every single character entered.

This leads to an issue: even in newly created conversations, after just a few rounds of simple dialogue, when token usage approaches 40,000, inputting characters becomes severely laggy. It becomes completely impossible to type at a normal, fluid pace.

:sweat_smile: Could the calculation frequency be reduced, or could computation be deferred until submission?
(Is token calculation truly necessary during the input phase? :smiling_face_with_tear:)

1 Like

Hello @james
Welcome to the forum!!

I just tested this with 132,742 tokens and didn’t experience any lag or issues; it is working as expected on my end. Please let me know if you are still facing this issue.

Thanks