A "decide" Primitive: Browser On-Device AI as a Native JS Control Flow
cocktailpeanut · x · 2026-09-21
Developer cocktailpeanut proposes embedding a "Nano Jev" — small-output-space generative judgment — directly into the browser as a JS method, which would imply open weights by default.
The logic: Chrome already supports on-device LLMs via Gemini Nano and the LanguageModel API, but LLMs emit variable-length sequences, forcing streaming for acceptable UX. Small predetermined output spaces can generate in parallel with deterministic, predictable latency, so the entire inference fits in a single clause.
He introduces a new primitive, decide, that looks like a switch statement but with async closures you can call async methods inside — embedding on-device AI judgment directly into language control flow.
Related event: Developer Proposes 'decide' Primitive for Browser-side AI(2 posts)→
More from coding & agent
- Agent-generated code is a Jenga tower: you can ship it but never maintain it — ryunuck · 2026-09-21
- ReCouPLe: Reason-Augmented Preference Learning Boosts Reward Accuracy 1.5x Under Shift — burny_tech · 2026-09-21
- Siri + Home Assistant + ChatGPT Voice: an automated grocery and meal-planning pipeline — athyuttamre · 2026-09-21
- 99.7% cache hits: engineered DeepSeek Harness with self-hosted GLM-5.3 — burny_tech · 2026-09-21
- Same AI agent scores 97% or 39% depending on how you define success — hugobowne · 2026-09-21
- Solo dev open-sources 4 systems projects, asks engineers to roast them — Accomplished_Row1433 · 2026-09-21