smallwords: MIT-licensed Python lib syncing controlled vocab across GBNF, JSON Schema, validators

Empty-Reflection4280 · reddit · 2026-10-16

A new MIT-licensed Python package, smallwords, compiles a single controlled vocabulary and output shape into prompt guidance, GBNF, JSON Schema, and post-generation validation at once, eliminating constraint drift. The author demoed it with Granite 4.2 via llama-server rewriting a missile-guidance monologue into simple/pirate/cowboy versions, each validated against both focused and full vocabularies. On PyPI with a full runnable script in the repo.

Original post →

More from coding & agent

coding & agent channel →