--- title: "Playground Studio" version: 3.8.40 lastUpdated: 2026-06-28 --- # Playground Studio > **Feature:** Playground Studio — unified AI testing workspace for `/dashboard/playground`. > **Plans:** `17-playground-studio-redesign.plan.md` + `_orchestration/master-plan-group-C.md` > **Status:** Released in v3.8.6 --- ## Overview Playground Studio transforms `/dashboard/playground` from a simple Monaco-based editor into a full-featured testing workspace. It replaces the legacy `page.tsx` with a `PlaygroundStudio` shell that renders four tabs and a shared config pane. ``` ┌ Playground ──────────────────────────────────────────────────────────┐ │ [💬 Chat] [⚖ Compare] [{} API] [🔧 Build] 142↑ 38↓ · $0.002 │ ├──────────────────────────────────────────┬───────────────────────────┤ │ {active tab content} │ ─ Config │ │ │ Endpoint [chat ∨] │ │ │ Model [gpt-5.4 ∨] │ │ │ System [textarea] │ │ │ Temp ▕▕▔▔ 0.7 │ │ │ Presets [▾ load][save] │ │ │ [✨ Improve prompt] │ └──────────────────────────────────────────┴───────────────────────────┘ ``` --- ## Tabs ### Chat Tab Evolves `ChatPlayground.tsx` into a multi-turn streaming workbench: - Full markdown rendering via `MarkdownMessage.tsx` (code blocks, tables, lists, links). - System prompt sourced from the shared Config pane. - Token/cost per message (prompt + completion tokens). - Regenerate last response. - Sends to `POST /v1/chat/completions` with SSE streaming. ### Compare Tab The key differentiator for a proxy: run 1 prompt across up to **4 models in parallel**. - Up to 4 columns, each independently streaming from `/v1/chat/completions`. - `+ Add model` button (Cmd+K shortcut) to add columns. - `Run all ▶` triggers all streams simultaneously via `Promise.all` + per-column `AbortController`. - Global **Cancel all** aborts every in-flight stream. - Per-column `ProviderMetrics` shows TTFT, TPS, tokens, and estimated cost in real time. - Metrics labelled **"client-side estimate"** (D12) — measured from first SSE chunk. ### API Tab Preserves 100% of the original Monaco editor for power users (D14): - 10 endpoints: chat completions, completions, embeddings, images, audio, speech, transcriptions, moderations, rerank, search. - Multimodal file upload. - SSE streaming with real-time output. - Wrapped as `ApiTab.tsx` (lazy-loaded, `ssr: false`). ### Build Tab Tools/function calling and structured output UI: - `ToolsBuilder.tsx` — add/edit/remove `tools[]` with JSON schema editor per tool. Validates parameters via `ToolDefinitionSchema` (Zod). - `StructuredOutputEditor.tsx` — toggle JSON mode + JSON schema editor. Validates response against schema via `StructuredOutputSchema` (Zod). - Sends request to `/v1/chat/completions` with `tools[]` and/or `response_format`. --- ## Config Pane (Shared) `StudioConfigPane.tsx` — always visible, collapsible. | Field | Component | Notes | | -------------- | --------------------- | ---------------------------------------------------------------------- | | Endpoint | `` | free text, e.g. `openai/gpt-4o` | | System prompt | `