Switch: A Unified Harness for Decision‑Model Agents
· GlobeWire Daily Editorial Desk · Source: github.com

Image: GitHub · Photo source · Resized and letterboxed to 16:9; no AI generation
Switch is a lightweight framework that lets developers wrap any decision‑model—such as Jev or llama.cpp—into a reusable harness. The core idea is to expose a domain‑specific state machine to the model, turning the state into a set of typed questions. The model then selects one answer from a finite list, and Switch translates that choice into a tool call that advances the state.
How It Works
- Domain: The user defines a domain (e.g., chess, rubric judging, support‑ticket routing). The domain supplies:
- *State*: a JSON snapshot of the task.
- *Question function*: generates the next question(s) the model must answer.
- *Transition function*: computes the next state from the model’s answers.
- *View function* (optional): formats the state into a token‑budgeted prompt.
- Case: A single instance of a domain task, stored in a folder.
- Run Loop: Switch repeatedly:
- Calls the view function to produce the prompt.
- Sends the prompt to the decision model.
- Receives a probability‑annotated answer.
- Applies the transition function to obtain the next state.
- Stops when no questions remain or a safety limit is hit.
Practical Uses
- Rubric Judge: Instead of feeding an entire PDF into the model, Switch navigates the document, pulling only relevant pages and images. This reduces context waste and speeds up grading.
- Chess Engine: The framework can play against random moves, Stockfish, or itself, demonstrating how a decision model can be guided by a simple move‑selection interface.
- WikiRace: A domain that races from one Wikipedia article to another by following links, showcasing Switch’s flexibility.
Integration
Switch requires Node.js 22.18+. Install via npm: ```bash npm install @osolmaz/switch ``` The repository contains examples and a viewer package that can replay runs step‑by‑step in the browser.
Future Outlook
While Jev is currently weak at chess and rubric judging, the framework allows fine‑tuning of open decision models on narrow domains. A domain‑specific model can achieve comparable performance to a general chat model at a fraction of the cost.
Verification
To verify an announcement, clone the repo, run `pnpm install`, and execute `pnpm run example`. The output will show a trace file that can be replayed without invoking the model, confirming the harness logic.
Key Takeaways
- Switch abstracts the decision‑model API into a clean, domain‑centric interface.
- It reduces context overhead by fetching only necessary data.
- The framework is extensible to any finite‑choice task.
- Fine‑tuning on a narrow domain can yield cost‑effective, high‑performance agents.
AI-assisted reporting; source claims are attributed and have not been independently verified.
More to read
Trending on GlobeWire Daily
Selected from recent coverage and related topics; not live search rankings.
Madhya Pradesh Government Plans Revenue Generation from 117-Year-Old Edward Villa in Mumbai Through Leasing
iPhone 18 Pro Named TechRadar Product of the Year 2026
Google Project Suncatcher Runs Gemma 4 AI on Orbiting Satellite and Receives First Response
Gender Disparities in Eye Care Access Across India Examined
Satellite Images Show Cyclone Arnab Weakening Over India As New System Brews
Expanding Green and Blue Spaces Crucial for India's Economic and Public Health, Reports Indicate


