Top-K Tokens

“The capital of France is”
  • “Paris”64.3%
  • “the”18.7%
  • “located”8.1%
  • “also”4.2%
About this piece

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.

Usage

The import and the props worth knowing about, in one place.

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

<Ai16
  surface="card"
  bordered={false}
  inverted={false}
  context="The capital of France is"
  tokens={[
    {
      "token": "Paris",
      "probability": 0.643
    },
    {
      "token": "the",
      "probability": 0.187
    },
    {
      "token": "located",
      "probability": 0.081
    },
    {
      "token": "also",
      "probability": 0.042
    }
  ]}
/>

More AI pieces

View all AI

"where is my order?"

order_status
shipping_eta
refund_request
docstop_k = 5
lang:ensection:guides
142 tok/s
The quick brown fox
Context window92.0K / 200K
Implementing rate limits with Redis
0.92

Use INCR with an EXPIRE TTL to build a fixed-window limiter that resets every minute.

Query
Retrieve
Rerank
Answer