Vercel's WebGPU lexer retrained: top-25 language accuracy jumps to 92.2%

shuding · x · 2026-11-15

Vercel engineer shuding shipped gpu-lexer v0.0.5, an experimental language-agnostic syntax highlighter powered by WebGPU. It uses one small learned model for every language, returning display-oriented source spans without language arguments or bundled grammar packs.

After retraining, weighted accuracy across the top 25 languages rose from 86.77% to 92.20%. The project is open source under MIT (92 stars), exports a single parse(code) API, requires WebGPU in a secure browser context, and returns UTF-16 offsets compatible with JavaScript string slicing. The author is collecting failing cases via GitHub issues for further fine-tuning.

Related event: Vercel Engineer Open-Sources gpu-lexer, WebGPU Highlighting Accuracy Hits 92.2%(2 posts)→

Original post →

More from coding & agent

coding & agent channel →