Skip to content

Repository files navigation

Switchyard Studio

Separate local chat interface for Switchyard with a collapsible routing sidebar. Requires Python 3.11 or newer; no Python package dependencies. Running inference also requires a built switchyard-server with support for the selected algorithm.

Switchyard chat interface with ensemble model choices in the left sidebar and a coding workflow conversation on the right

Actual interface with a simulated demo response; no live credentials or private endpoints are shown.

  1. Choose a routing algorithm and edit the prefilled model boxes in the left sidebar.
  2. Connect your gateway, then click Start router.
  3. Send a message in the chat composer. Collapse the sidebar to focus on the conversation.
python3 server.py

Open http://127.0.0.1:4780. Paste your key and click Connect to discover models. The key stays in page memory and is sent to the local backend for discovery and to the managed router through its process environment; it is never saved in TOML. Existing environment credentials are also supported and never returned to the browser.

The app detects the gateway from OPENAI_BASE_URL or a sibling Switchyard checkout's dev-server/config.toml, and detects its built executable. If nothing is found, enter a gateway URL including /v1 under Advanced. With both a detected URL and environment credential, the catalog loads automatically. Settings live only in the page for this first version.

Choose Ensemble, Escalation, Capability, or Single model in the sidebar. Model boxes are prefilled with editable SOL, Opus 5, and Astra presets; these IDs are starting points, not a guarantee of gateway availability. Connecting loads the catalog and reconciles unchanged presets with matching model IDs. Click Start router, then chat. Enter sends; Shift+Enter adds a newline. Requests run through the actual native router and your selected algorithm. Conversation history and a stable session ID are retained for escalation; New chat resets both. Responses show the served model, latency, finish reason, and usage (terminal usage only, not aggregate internal call costs).

The dashboard owns one native router, bound to a free loopback port. Its OpenAI-compatible base URL and route ID appear when ready, so other local clients can call it too. The selected configuration is written to a temporary directory and cleaned up when stopped. Stop the router before applying edited settings. Closing the browser does not stop it; use Stop or shut down the dashboard. Shutdown terminates its child process. Live requests may be interrupted when stopping.

Runtime settings let you select an absolute path to a different branch's built switchyard-server. The app does not switch branches or build Rust. Only select trusted executables. Configuration export and dry-run validation remain available under secondary controls. Playground requests are text-only and buffered, with a five-minute timeout; this version does not execute tool calls.

Branches are build variants, not runtime algorithms: an older main build may reject ensemble fields, and escalation semantics can differ between builds. Validation exposes those differences. A successful dry-run validates configuration, not upstream model availability.

The UI supports a single route, two ensemble candidates, and a single gateway per deployment in this version. Model discovery uses the gateway's authenticated /models endpoint. No gateway URL is hard-coded. The local server rejects cross-origin API requests and binds only to loopback; this app is not intended to be exposed on a network.

Tests: python3 -m unittest -v and node test_defaults.cjs (requires Node.js). The native integration test skips unless a built server exists in the sibling Switchyard checkout.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages