CMD + K

lm-format-enforcer

Anaconda Verified

Enforce the output format (JSON Schema, Regex etc) of a language model

Installation

To install this package, run one of the following:

Conda
$conda install main::lm-format-enforcer

Usage Tracking

0.10.12
1 / 8 versions selected
Downloads (Last 6 months): 0

Description

Language models are able to generate text, but when requiring a precise output format, they do not always perform as instructed. Various prompt engineering techniques have been introduced to improve the robustness of the generated text, but they are not always sufficient. This project solves the issues by filtering the tokens that the language model is allowed to generate at every timestep, thus ensuring that the output format is respected, while minimizing the limitations on the language model.

About

Summary

Enforce the output format (JSON Schema, Regex etc) of a language model

Last Updated

Jan 7, 2026 at 21:29

License

MIT

Total Downloads

36

Supported Platforms

linux-64
linux-aarch64
macOS-arm64
win-64