Token Inspector
ProNewInspect token boundaries, vocabulary IDs and byte lengths directly inside a passage.
Installation
pnpm dlx shadcn@latest add @viewport/token-inspector
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| tokens* | Token[]Tokenization produced by the caller's tokenizer, in text order. | — |
| encoding* | stringDisplay name of the tokenizer or vocabulary used. | — |
Accessibility
- Tokens are individually named buttons. Whitespace is rendered literally and described in the inspector.