HomeLabHire Me
ml-ui111 components

Get started

IntroductionInstallation

UI

Dots

Dot AccordionDot CalendarDot CheckboxDot CodeDot CommandDot ContentsDot CountdownDot CrossingDot FuseDot GaugeDot InstallDot KnobDot LogosDot MenuDot PaginationDot PasswordDot Price RangeDot PricingDot ProgressDot QueueDot RatingDot Reading ProgressDot SelectDot SignupDot SliderDot StatusDot StepperDot SwitchDot TabsDot ToastDot TooltipFlip-Dot CounterLED Marquee

Dither

Dither AvatarDither BannerDither CompareDither GlobeDither PortraitDither SkeletonDither TrailDither UploadDot CookiesDot DialogDot KeysDot ReceiptDot VariantsLenticular Card

More

Pollen TrailSplit-FlapTheme Toggle

Text

Dither RotatorDot TypeEnigma TextInk Print

Data viz

Dots

Contribution FieldDot BarsDot ChartDot Waffle

Dither

Dither DensityDither MapDither Stack

Media

Dots

Dot EqualizerDot WaveformVoice Note

Dither

Dither Scrubber

AI

Agent StepsAnswer VersionsCitation ChipConfidence GlassContext MeterDiffusion ImageDiffusion TextDither MaskDoc ReaderDot DictationGenerate ButtonGhost TextModel PickerPrompt BarResponse ActionsRevising TextSpoken ReplyThinking OrbThinking TraceToken MeterToken StreamWord Alternatives

Useful

Arrival TimeBest ShotCareer LineForgiving SearchGesture PadHeard AsHonest PinImage PaletteLikeness GridNear Miss SearchRain DropsSoft CorrectSpending SortSticker LiftTaste Ledger

Backgrounds

ButterfliesDandelionsDuck PondFirefliesKoi PondLight WellMarigoldsTrain WindowWhite Blossom

ml-ui / AI

Token Meter

While a response streams, its speed reads large in the 5 x 7 dot face with a dot sparkline of it over the request beside it, and a line of figures under it: the model, the time to the first token, the tokens so far and, given prices, what it's cost. When the response finishes the meter settles on its average speed. Feed it the running token count as it streams.

Needs: None. Canvas 2D. You pass the counts from your streaming client.

Customize

Props

PropTypeDefaultDescription
tokensnumberrequiredOutput tokens so far.
inputTokensnumber0Tokens in the prompt, for the cost.
startedAtnumber–When the request was sent, in ms.
firstTokenAtnumber–When the first token arrived, in ms.
donebooleanfalseThe response has finished.
price{ input: number; output: number }–Dollars per million tokens, for the cost.
modelstring–The model's name, first on the line of figures.
tonestring–The speed and its sparkline. The page's accent by default.
pitchnumber3Size of one dot in px.
classNamestring–Class on the meter.
styleCSSProperties–Style on the meter.
← Thinking TraceToken Stream →