Deemwar Monads & Abstractions

A 14 MB brain that knows 1,050 commands

spot-router turns a typed request into one of 1,050 commands in about 4 ms, on CPU, offline. It is a small static-embedding model in pure Go. Spot runs the command itself when the router is sure and hands everything else to a bigger AI.

~4 ms per lookup, CPU
8.4 MB int8 model
72% / 88% top-1 / top-3
1,050 commands

What it does

Spot is a Spotlight-style launcher for Mac and Windows, with a daemon and CLI on Linux. Type play rajini jailer 2 song and increase volume: Spot plays the first YouTube result and raises the volume in about 1 second. No AI call happens on that path.

The router does one job. It reads your words and names the command. It does not write text, chat or plan.

Two rankers, one fused list, one gate.

How a lookup works

  1. 1

    Embed

    Model2Vec potion-base-8M, fine-tuned

    The router looks up a vector for each word piece and takes the mean. No transformer runs at query time, so a CPU answers in about 4 ms.

  2. 2

    Match words

    BM25

    A word-match ranker scores the same request. It tolerates typos and prefixes.

  3. 3

    Fuse

    reciprocal-rank fusion, k=60

    The two ranked lists merge by rank, not by raw score, so neither scale dominates.

  4. 4

    Decide

    the router

    When the router is sure, Spot runs the command directly.

  5. not sure → Claude or Codex, kept warm · look → act → check → answer, each step shown in the panel

How it got better

Fine-tuning uses contrastive loss (MultipleNegativesRankingLoss) on (phrasing → command) pairs and takes about 1 minute on a Mac CPU. A small LLM generated 10,527 natural phrasings: Tanglish, typos and questions.

Stock58% / 72%
Fine-tune64% / 80%
+ phrasings72% / 88%

First guess / in the top 3, on 50 held-out real requests.

Where it still misses

RequestShould go to
make it loudervolume up
shut upmute
who is the prime minister of indiathe AI, not a command

A wrong first guess costs nothing when the gate holds: the request goes to the AI instead of running the wrong thing.

Why not a small chat model

Function callingNothing under 50 MB does it reliably.
Classification is enoughPicking a tool is choosing one of 1,050 labels.
The slow path got fasterClaude round-trip: 9.6 s → 3.3 s once kept warm and 120 unused skills (about 9k tokens per prompt) left the prompt.

Use it

spot-router "make it louder" prints JSON. spot-router --serve answers one query per stdin line. It runs on macOS, Linux (x64, arm64, arm, including the Raspberry Pi) and Windows.

Guardrails

Get it

spot.deemwar.com (downloads page, being built now).

Sources: spot-router evaluation on 50 held-out requests; Spot build notes (binary size, model size, latency, training time).