Skip to content

Commit 0d2b00f

Browse files
committed
Add tok/s info to message and thread stats
1 parent 4c38d83 commit 0d2b00f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

llms/ui/modules/chat/ChatBody.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ export const MessageUsage = {
337337
•
338338
{{ $fmt.humanifyNumber(usage.tokens) }} tokens
339339
<span v-if="usage.cost">&#183; {{ $fmt.tokenCostLong(usage.cost) }}</span>
340-
<span v-if="usage.duration"> in {{ $fmt.humanifyMs(usage.duration * 1000) }}</span>
340+
<span v-if="usage.duration"> in {{ $fmt.humanifyMs(usage.duration * 1000) }} <span v-if="usage.tokens > 0 && usage.duration > 0">({{ Math.round(usage.tokens / usage.duration) }} tk/s)</span></span>
341341
</span>
342342
</div>
343343
`,
@@ -955,7 +955,7 @@ export const ChatBody = {
955955
956956
<div v-if="currentThread.stats && currentThread.stats.outputTokens" class="text-center text-gray-500 dark:text-gray-400 text-sm">
957957
<span :title="$fmt.statsTitle(currentThread.stats)">
958-
{{ currentThread.stats.cost ? $fmt.costLong(currentThread.stats.cost) + ' for ' : '' }} {{ $fmt.humanifyNumber(currentThread.stats.inputTokens) }} → {{ $fmt.humanifyNumber(currentThread.stats.outputTokens) }} tokens over {{ currentThread.stats.requests }} request{{currentThread.stats.requests===1?'':'s'}} in {{ $fmt.humanifyMs(currentThread.stats.duration * 1000) }}
958+
{{ currentThread.stats.cost ? $fmt.costLong(currentThread.stats.cost) + ' for ' : '' }} {{ $fmt.humanifyNumber(currentThread.stats.inputTokens) }} → {{ $fmt.humanifyNumber(currentThread.stats.outputTokens) }} tokens over {{ currentThread.stats.requests }} request{{currentThread.stats.requests===1?'':'s'}} in {{ $fmt.humanifyMs(currentThread.stats.duration * 1000) }} <span v-if="currentThread.stats.outputTokens > 0 && currentThread.stats.duration > 0">({{ Math.round(currentThread.stats.outputTokens / currentThread.stats.duration) }} tk/s)</span>
959959
</span>
960960
<CompactThreadButton :currentThread="currentThread" />
961961
</div>

0 commit comments

Comments
 (0)