explaingit

levantolabs/switchboard-poc

Analysis updated 2026-05-18

1TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

A proxy that reads each request and automatically routes it to the cheapest AI model that can handle it, using a single AI call to decide.

Mindmap

mindmap
  root((Switchboard))
    What it does
      Routes each prompt
      Picks cheapest model
      One Sage call decides
    Tech stack
      TypeScript
      Next.js
      Hono
      OpenRouter
    Use cases
      Cut AI API costs
      Drop in OpenAI proxy
      Tune routing policy
    Audience
      Developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Cut AI API costs by automatically sending easy requests to cheaper models and hard ones to stronger models.

USE CASE 2

Drop-in replace an OpenAI client's base URL to add automatic model routing with no other code changes.

USE CASE 3

Prototype and tune a routing policy by editing plain-English descriptions of what each model is good for.

USE CASE 4

Watch a live playground to see which model was picked for each prompt and why.

What is it built with?

TypeScriptNext.jsHonoOpenRouterNode.js

How does it compare?

levantolabs/switchboard-poc0xkinno/neuralvault0xmayurrr/ai-contractauditor
Stars111
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatehardeasy
Complexity3/54/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires API keys for both Levanto Sage and OpenRouter before it will route any requests.

In plain English

Switchboard is a proof of concept proxy server that automatically picks which AI model should answer each request. Instead of a developer hard coding which model to call, Switchboard sends the incoming prompt to a service called Levanto Sage, which reads the prompt and a short description of what each available model is good at, then chooses the cheapest model that can actually handle the task. The chosen model is then called through OpenRouter, a service that gives access to many different AI models through one API. The project speaks the same request format as OpenAI's API, so an existing app that already uses an OpenAI client library can switch to Switchboard by only changing the web address it points to, with no other code changes needed. The response includes a header showing which model was picked, how confident the routing decision was, and how long the decision took, and there is also a small web based chat playground that shows these decisions and their costs live. The entire routing logic lives in two small files: one that lists the available models along with a plain description of when each should be used, and one that asks Sage a single question to pick the best match. Changing which model handles which kind of task is done by editing that plain description, not by writing new code. If Sage cannot be reached, the system falls back to a fixed default model so requests still succeed. The project is organized into three parts: the core routing logic with no build step, a small server built with the Hono framework that exposes the proxy endpoints, and a Next.js based web playground. The author notes this runs as a single local process only, and that reported cost savings are illustrative rather than a strict benchmark, since a cheaper model can sometimes use more tokens to answer. No license is stated in the README.

Copy-paste prompts

Prompt 1
Help me set up Switchboard locally and point my OpenAI client at it.
Prompt 2
Show me how to add a new model to the catalog with its own use case description.
Prompt 3
Explain how the Sage routing call decides between models for a given prompt.
Prompt 4
Help me read the X-Switchboard-Decision response header to see routing confidence and cost.

Frequently asked questions

What is switchboard-poc?

A proxy that reads each request and automatically routes it to the cheapest AI model that can handle it, using a single AI call to decide.

What language is switchboard-poc written in?

Mainly TypeScript. The stack also includes TypeScript, Next.js, Hono.

How hard is switchboard-poc to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is switchboard-poc for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.