Model playground

A React block (a whole screen) in Beamline's AI workspace app.

Try one prompt on up to three models side by side: pick each model with its price and speed in view, set the system prompt, temperature and length once for all, run, and watch the answers write themselves while time to first token, speed, tokens and cost count up under each; when they finish, the fastest and the cheapest are marked.

Use it for

  • Choosing a model for a feature: the same prompt on two or three models, with quality, speed and cost side by side.
  • Tuning a system prompt or temperature before it ships.

Not for

Anatomy

  • header: title, Settings (a sheet on narrow screens), Add model (up to three), Clear
  • settings column: system prompt, temperature, maximum output length, JSON output; they apply to every model
  • one column per model: the model picker with remove, the run state in words, the answer, and its figures (first token, tokens per second, output tokens, cost)
  • verdict: when every model has finished, Fastest and Cheapest marks land on the winning columns
  • composer: the prompt, its token estimate and the cost across the chosen models, Run (⌘↵) or Stop while running
  • start: ready-made prompts in the empty columns until the first run

Variants

  • 0: room: models side by side from 48rem; below that one model at a time, switched by a segmented control that shows each model's state
  • 1: settings: a column from 64rem, a sheet below

States

  • empty (starter prompts)
  • waiting for the first token (time counts)
  • writing (answer streams, figures count up)
  • done (figures settle; verdict marks when all are done)
  • stopped (what was written stays, marked as stopped)
  • failed (the provider's reason and Retry for that model only)
  • model not on the plan (picker says why; Run skips nothing silently)
  • figure unknown (— not 0)

Keyboard

  • Tab: header actions, settings, each column's model picker and remove, the composer and Run
  • ⌘↵ or Ctrl+Enter in the prompt runs; Escape while running stops
  • Narrow: arrows move between models in the segmented control

Motion

Answers stream with the Response reveal; figures roll as they change; a column that finishes swaps its spinner for a check; Fastest and Cheapest rise onto their columns once; a starter prompt flies into the composer. Nothing moves once every model is done.

Props

PropTypeDefaultDescription
models (required)ModelOption[]—The catalogue the pickers choose from (id, label, provider, context, speed, price…).
outputs (required)PlaygroundOutput[]—One per column: { model, status: idle · waiting · streaming · done · stopped · error, text, error?, firstToken?, duration?, tokens?, cost? }.
onModelChange(index: number, modelId: string) => void—
onAddModel / onRemoveModel() => void / (index: number) => void—
prompt / defaultPrompt / onPromptChangestring—
settings / defaultSettings / onSettingsChangePlaygroundSettings—{ system, temperature, maxTokens, json }.
onRun(request: { prompt, settings, models: string[] }) => void—Start every column.
onStop() => void—
onRetry(index: number) => void—Run one failed column again.
onClear() => void—
suggestionsPromptSuggestion[]—Starter prompts shown before the first run.
maxModelsnumber3
currencystring"USD"
titlestring"Playground"
className / classNames / style / refstring / ModelPlaygroundClassNames / CSSProperties / Ref<HTMLElement>—className: Classes on the documented visual root; no override by default. classNames: Classes for the named visual parts; no overrides by default. style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default.
onAddModel(() => void)—
onRemoveModel((index: number) => void)—
promptstring—
defaultPromptstring—
onPromptChange((prompt: string) => void)—
settingsPlaygroundSettings—
defaultSettingsPlaygroundSettings—
onSettingsChange((settings: PlaygroundSettings) => void)—
classNamestring—Classes on the documented visual root; no override by default.
classNamesPartial<Record<"root" | "header" | "column" | "columns" | "composer" | "settings" | "fi…—Classes for the named visual parts; no overrides by default.
styleCSSProperties—Inline styles on the documented visual root; no overrides by default.
refRef<HTMLElement>—Receives the documented native target or imperative handle; omitted by default.

Built from

Dependencies

lucide-react

Import

import { ModelPlayground, PLAYGROUND_DEFAULTS } from "@beamline/model-playground";

Get it

Model playground is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in AI workspace

  • AI agent workspace: Threads, a conversation that opens on the thread's earlier turns (each with its trace, the tools the agent called, a cited answer and any table it…
  • Agent runs monitor: Every run of your agents in one place: success rate, run time, tokens and spend; the last runs as a strip of status blocks; a live table where running…
  • Agent monitor: Agents in production and on test. Monitor shows every agent or one over 24 hours, 7 or 14 days: runs, tokens, estimated cost and average run time counted…
  • Conversation history: Past conversations with an assistant, ready to pick up again: the list by day with bookmarks and unsent drafts, a search through every message that…
  • Knowledge base manager: What your assistant knows and whether it is fresh: sources with live sync status (syncing with progress, out of date, failed with the reason and Retry)…
  • Reading library: A read-it-later library: saved views that are live filters (a query with every unreadable part named, the number that matches now, saved with a name; a…
  • Artifact workbench: Where the things an assistant makes are checked before they leave: every document, piece of code, small app and data result from a conversation, each…
  • AI image studio: Write a prompt, pick a shape, a style and how many, and watch the variations generate side by side; each one opens full screen and can be upscaled or…
  • Voice agent: A voice agent in three layouts on one session: a workspace with the agent's orb large on a stage (the line being said shows under it, questions to ask…
  • Model inspector: A design model's objects without needing the 3D view: the model tree, where objects with the same name are told apart by id and path; the selected…
  • Model issues: Issues pinned to the objects of a design model. The queue says the scope beside every count (open in the project, on the loaded models, on this version)…
  • Agent builder: An agent's configuration beside an assistant that proposes tools. Ask for what the agent should do and the assistant's proposal lists each tool with why…
  • Workflow composer: A workflow drafted from a sentence and finished by hand. The prompt drafts steps that arrive one by one on the graph (a draft cut short keeps what came…
  • Data binding: Bind an object's properties to a view model. Each property says whether it is bound, incomplete or mismatched. A binding takes its source from the…

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.