diff --git a/api/config.py b/api/config.py index adb4670a..5a635a8d 100644 --- a/api/config.py +++ b/api/config.py @@ -3082,6 +3082,7 @@ _SETTINGS_DEFAULTS = { "onboarding_completed": False, "send_key": "enter", # 'enter' or 'ctrl+enter' "show_token_usage": False, # show input/output token badge below assistant messages + "show_tps": False, # show tokens-per-second chip in assistant message headers "show_cli_sessions": False, # merge CLI sessions from state.db into the sidebar "sync_to_insights": False, # mirror WebUI token usage to state.db for /insights "check_for_updates": True, # check if webui/agent repos are behind upstream @@ -3207,6 +3208,7 @@ _SETTINGS_ENUM_VALUES = { _SETTINGS_BOOL_KEYS = { "onboarding_completed", "show_token_usage", + "show_tps", "show_cli_sessions", "sync_to_insights", "check_for_updates", diff --git a/docs/pr-media/1640/tps-toggle-off-default.png b/docs/pr-media/1640/tps-toggle-off-default.png new file mode 100644 index 00000000..ffefd438 Binary files /dev/null and b/docs/pr-media/1640/tps-toggle-off-default.png differ diff --git a/docs/pr-media/1640/tps-toggle-on-hot-apply.png b/docs/pr-media/1640/tps-toggle-on-hot-apply.png new file mode 100644 index 00000000..eb54b50a Binary files /dev/null and b/docs/pr-media/1640/tps-toggle-on-hot-apply.png differ diff --git a/static/boot.js b/static/boot.js index 598fcc57..d4e8bdd0 100644 --- a/static/boot.js +++ b/static/boot.js @@ -1238,6 +1238,7 @@ function applyBotName(){ _bootSettings=s; window._sendKey=s.send_key||'enter'; window._showTokenUsage=!!s.show_token_usage; + window._showTps=!!s.show_tps; window._showCliSessions=!!s.show_cli_sessions; window._soundEnabled=!!s.sound_enabled; window._notificationsEnabled=!!s.notifications_enabled; @@ -1271,6 +1272,7 @@ function applyBotName(){ }catch(e){ window._sendKey='enter'; window._showTokenUsage=false; + window._showTps=false; window._showCliSessions=false; window._soundEnabled=false; window._notificationsEnabled=false; diff --git a/static/index.html b/static/index.html index bcacc357..29061844 100644 --- a/static/index.html +++ b/static/index.html @@ -829,6 +829,13 @@
Displays input/output token count below each assistant reply. Also toggled with /usage.
+
+ +
Displays tokens per second in assistant message headers while streaming and after a response completes. Off by default.
+