NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2498 most downloaded on PyPI
Enforce the output format (JSON Schema, Regex etc) of a language model
Last release 1 years ago
24 Aug 2025
Release timing varies
gaps range from 9 days to 5 months
Most releases are documented
notes for 47 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
78 releases · first in 2023
One column per quarter.
Minor fixes for vLLM V1 integration
Minor fixes for vLLM V1 integration
…based, for smooth vLLM V1 integration. This is a breaking change if you directly use the TokenEnforcer.get_allowed_tokens() function as its return typ…
Added use_bitmask flag to TokenEnforcerTokenizerData which causes the allowed tokens data to be torch tensor bitmask based, for smooth vLLM V1 integration. This is a breaking change if you directly use the TokenEnforcer.get_allowed_tokens() function as its return type has changed.
Minor improvements required for vLLM V1 Engine support
Fixed support for newer versions of transformer library
Added support of multiple types for a field in json schema (Contributed by Guillaume Calmettes )
Added new sample: Extracting structured data from vision models
Fixed support for tokenizers with larger vocabularies than the models. Enables visual models such as Llama3.2
[135] Updated Haystack V2 integration with latest API
Pickling improvements for easier multiprocessing support
SequenceParser performance optimization
Added default max Json array length to help LLMs avoid infinite loops. See README for details.
[#113] TRTLLM Support: Fixing type incompatibility in certain cases / library versions
[#100] JsonSchemaParser: Added allOf support
Added ability to config parsing heuristics via environment variables. See Configuration Options in README
[#95] Added anyOf support to JsonSchemaParser, making function calls possible.
Updated README with vLLM OpenAI Server Inference integration
[#80] JSONSchemaParser List would allow opening comma before first element if there was a whitespace before it
[#93] Improved JSONSchemaParser performance, unit tests run twice as fast! Joint effort with Ari Weinstein. Thanks!
Bugfix in ExllamaV2 sample notebook that generated garbage data after the response.
[#87] Allow regex to exit to forcestopparser when receiving a pad/eos token after having been in a final state. Thanks Josh C!
[#27] Improving vLLM class support (AsyncLLMEngine etc)
Improved support for out-of-token-vocabulary characters
- #80 - Fixed bug where comma could start json list - #34 - Fixed llama-cpp-python low max_tokens default in sample
Fixed build errors in certain edge cases
Much faster TokenizerData initialization, new JSON freetext token caching algorithm.
- #67 Updating vLLM integration to support v0.3.0 - #63 JSONSchemaParser: Empty list cannot be closed after a newline
Several JsonSchemaParser improvements:
Performannce improvement: Limited-length JSON strings will also enjoy caching. Thanks Jarno Elonen for the contribution!
Performance improvement: Introduced TokenEnforcerTokenizerData that allows reusing the tokenizer preprocessing data between different TokenEnforcer in
TokenEnforcerTokenizerData that allows reusing the tokenizer preprocessing data between different TokenEnforcer instances. The sample notebooks have been updated to take advantage of this option.TokenEnforcer runtime footprint reduction.- Bug fixes
Sample notebooks don't require huggingface account anymore
- Added ExLlamaV2 integration
JSON Schema: Added support for union types. In pydantic, both key: int | str and key: Union[int, str] formats are supported
key: int | str and key: Union[int, str] formats are supportedJsonSchemaParser(None) will now create a parser that accepts any valid JSON.Added official vLLM integration that doesn't require monkey patching.
JSON Schema : Supports string min/max length limitation
Community PR: Fixed SequenceParser bug
- Added haystack integration
Fixed llama.cpp integration to be able to generate unicode characters in json freetext fields
RegexParser and JsonSchemaParser can now output all of the characters that exist in the tokenzier
JSON Schema : Supports empty arrays and escape characters in strings
UnionParser and SequenceParser to allow combining parsersMade it easier to report bugs in the library
Introduced FormatEnforcerAnalyzer to allow all inference engines to be analyzed in a unified way. (Was previously only available for transformers)
Improved JsonSchemaParser whitespace support
.+ and .* sections.Modified example in main README to be able to run end to end in Google Colab
Added integration with the LlamaIndex library (huggingface and llama.cpp backends) via sample notebook.
LlamaIndex library (huggingface and llama.cpp backends) via sample notebook.Introduced `lmformatenforcer.integrations` module which will have the integrations with inference engines.
lmformatenforcer.integrations module which will have the integrations with inference engines.lmformatenforcer.integrations.llamacpp'build_transformers_prefix_allowed_tokens_fn', 'generate_enforced' from lmformatenforcer to lmformatenforcer.integrations.transformers.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →