genlm/genlm-control
Controlled text generation with programmable constraints
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.
Stars
179
Forks
20
Language
Python
License
Apache-2.0
Category
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.
Related tools
gokmengokhan/deo-llm-reframing
Replication materials: Testing Distance-Engagement Oscillation as a prompting framework for...
PCI-ORG/PCI-Personnel
Policy Change Index for Personnel (PCI-Personnel)
Intelligent-CAT-Lab/AlphaTrans
Artifact repository for the paper "AlphaTrans: A Neuro-Symbolic Compositional Approach for...
madaan/self-refine
LLMs can generate feedback on their work, use it to improve the output, and repeat this process...
slashrebootofficial/simulated-metacognition-in-open-source-llms
This repository archives artifacts (prompts, configs, logs, and scripts) from a series of...