|
3 | 3 | import { useProcessingState } from '$lib/hooks/use-processing-state.svelte'; |
4 | 4 | import { isLoading } from '$lib/stores/chat.svelte'; |
5 | 5 | import { fade } from 'svelte/transition'; |
6 | | - import { Check, Copy, Package, X } from '@lucide/svelte'; |
| 6 | + import { |
| 7 | + Check, |
| 8 | + Copy, |
| 9 | + Package, |
| 10 | + X, |
| 11 | + Gauge, |
| 12 | + Clock, |
| 13 | + WholeWord, |
| 14 | + ChartNoAxesColumn |
| 15 | + } from '@lucide/svelte'; |
7 | 16 | import { Button } from '$lib/components/ui/button'; |
8 | 17 | import { Checkbox } from '$lib/components/ui/checkbox'; |
9 | 18 | import { INPUT_CLASSES } from '$lib/constants/input-classes'; |
|
160 | 169 | </div> |
161 | 170 | {/if} |
162 | 171 |
|
163 | | - {#if displayedModel()} |
164 | | - <span class="mt-6 mb-4 inline-flex items-center gap-1 text-xs text-muted-foreground"> |
165 | | - <Package class="h-3.5 w-3.5" /> |
| 172 | + <div class="info my-6 grid gap-4"> |
| 173 | + {#if displayedModel()} |
| 174 | + <span class="inline-flex items-center gap-2 text-xs text-muted-foreground"> |
| 175 | + <span class="inline-flex items-center gap-1"> |
| 176 | + <Package class="h-3.5 w-3.5" /> |
166 | 177 |
|
167 | | - <span>Model used:</span> |
| 178 | + <span>Model used:</span> |
| 179 | + </span> |
168 | 180 |
|
169 | | - <button |
170 | | - class="inline-flex cursor-pointer items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75" |
171 | | - onclick={handleCopyModel} |
172 | | - > |
173 | | - {displayedModel()} |
| 181 | + <button |
| 182 | + class="inline-flex cursor-pointer items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75" |
| 183 | + onclick={handleCopyModel} |
| 184 | + > |
| 185 | + {displayedModel()} |
174 | 186 |
|
175 | | - <Copy class="ml-1 h-3 w-3 " /> |
176 | | - </button> |
177 | | - </span> |
178 | | - {/if} |
| 187 | + <Copy class="ml-1 h-3 w-3 " /> |
| 188 | + </button> |
| 189 | + </span> |
| 190 | + {/if} |
| 191 | + |
| 192 | + {#if currentConfig.showMessageStats && message.timings && message.timings.predicted_n && message.timings.predicted_ms} |
| 193 | + {@const tokensPerSecond = (message.timings.predicted_n / message.timings.predicted_ms) * 1000} |
| 194 | + <span class="inline-flex items-center gap-2 text-xs text-muted-foreground"> |
| 195 | + <span class="inline-flex items-center gap-1"> |
| 196 | + <ChartNoAxesColumn class="h-3.5 w-3.5" /> |
| 197 | + |
| 198 | + <span>Statistics:</span> |
| 199 | + </span> |
| 200 | + |
| 201 | + <div class="inline-flex flex-wrap items-center gap-2 text-xs text-muted-foreground"> |
| 202 | + <span |
| 203 | + class="inline-flex items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75" |
| 204 | + > |
| 205 | + <Gauge class="h-3 w-3" /> |
| 206 | + {tokensPerSecond.toFixed(2)} tokens/s |
| 207 | + </span> |
| 208 | + <span |
| 209 | + class="inline-flex items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75" |
| 210 | + > |
| 211 | + <WholeWord class="h-3 w-3" /> |
| 212 | + {message.timings.predicted_n} tokens |
| 213 | + </span> |
| 214 | + <span |
| 215 | + class="inline-flex items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75" |
| 216 | + > |
| 217 | + <Clock class="h-3 w-3" /> |
| 218 | + {(message.timings.predicted_ms / 1000).toFixed(2)}s |
| 219 | + </span> |
| 220 | + </div> |
| 221 | + </span> |
| 222 | + {/if} |
| 223 | + </div> |
179 | 224 |
|
180 | 225 | {#if message.timestamp && !isEditing} |
181 | 226 | <ChatMessageActions |
|
0 commit comments