Top-K Tokens

Debugger-style panel showing the language model's next-token probabilities, with the top candidate highlighted and bars scaled to softmax weight.

next_tokentop 5
The capital of France is
  • Paris64.3%
  • the18.7%
  • located8.1%
  • also4.2%
  • a2.1%

Requires shadcn/ui initialized. Run npx shadcn@latest init if you haven't.

Import & use
import { Ai16 } from "@/components/beste/piece/ai16";

<Ai16
  title="next_token"
  context="The capital of France is"
  topPrefix="top"
  tokens={[
    {
      "token": "Paris",
      "probability": 0.643
    },
    {
      "token": "the",
      "probability": 0.187
    },
    {
      "token": "located",
      "probability": 0.081
    },
    {
      "token": "also",
      "probability": 0.042
    },
    {
      "token": "a",
      "probability": 0.021
    }
  ]}
/>