#181 · Primary category: LLM Application Frameworks

rellm

huggingface-transformers llm transformers

Exact structure out of any language model completion.

Project last updated:08/10/23

GitHub Stars

510

Forks

24

Contributors

3

License

MIT

Why we included this project

Anyone who has built an app on top of a language model knows the pain of parsing half-formed JSON or stray punctuation from completions. ReLLM tackles that at the source: before each token is generated, it masks any logit that would break a regex you supply, so the model simply cannot drift from the pattern. In practice that means you can force JSON or XML shapes, pin dates and numbers to a specific format, or fill a blank inside a fixed sentence template, without post-processing or retraining. It plugs into the HuggingFace transformers generation loop with a small pip install, and the same masking trick also keeps small models more coherent. It is a focused utility, not a framework, which is exactly what you want when deterministic structure on top of a generative model.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category