genlm/genlm-control

Controlled text generation with programmable constraints

47
/ 100
Emerging

Implements sequential Monte Carlo (SMC) sampling to enforce constraints from regex patterns, JSON schemas, or custom potential functions on token generation. Supports multiple LLM backends (GPT-2, Llama, etc.) through a unified interface and uses async/await for efficient batch processing of candidate sequences. Constraints are coerced to operate on token sequences via composable potential functions that guide the sampling process.

179 stars.

No Package No Dependents
Maintenance 13 / 25
Adoption 10 / 25
Maturity 9 / 25
Community 15 / 25

How are scores calculated?

Stars

179

Forks

20

Language

Python

License

Apache-2.0

Last pushed

Mar 09, 2026

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/llm-tools/genlm/genlm-control"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.