A 'decide' primitive: natural-language switch statements via on-device browser LLMs

cocktailpeanut · x · 2026-09-21

cocktailpeanut proposes a disruptive idea: a "Nano Jev" built directly into the browser as a JS method, which naturally implies open weights by default.

Chrome already supports on-device LLMs via Gemini Nano and the LanguageModel API, but this goes further. LLMs produce unknown-length sequential output requiring streaming; a small predetermined output space can run in parallel, making latency deterministic — so the whole inference fits in a single clause. He introduces a new primitive "decide": looks like switch, but the closure is async and can call async methods, letting you use natural language queries instead of switch without any third-party API.

Related event: Developer Proposes 'decide' Primitive for Browser-side AI(2 posts)→

Original post →

More from coding & agent

coding & agent channel →