- 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
- JsonSchemaParser: Fixed additionalProperies and oneOf edge cases
- [135] Updated Haystack V2 integration with latest API
- Pickling improvements for easier multiprocessing support
- SequenceParser performance optimization
- JsonSchemaParser: number parsing supports exponents
- Supporting tokenizers with multiple eos token ids
- Added default max Json array length to help LLMs avoid infinite loops. See README for details.
- Updated EXLlamaV2 example to updated API
- [#113] TRTLLM Support: Fixing type incompatibility in certain cases / library versions
- [#100] JsonSchemaParser: Added allOf support
- [#99] JsonSchemaParser: Fixed edge case that would allow leading comma in JSON Array
- [#102] JsonSchemaParser: Fixed Array of Enums not producing multiple values
- Allowing control of LM Format Enforcer's heuristics via env var / configuration objects. See the 'Configuration options' section of the 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!
- [#88] ExllamaV2 optimizations
- 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)
- #83 - Supporting added model tokens
- 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
- #68 Added NVIDIA TensorRT-LLM Support, NVIDIA's contribution by Ahmet Erdem. Thanks!
- Much faster TokenizerData initialization, new JSON freetext token caching algorithm.
- More robust error reporting.
- #67 Updating vLLM integration to support v0.3.0
- #63 JSONSchemaParser: Empty list cannot be closed after a newline
Several JsonSchemaParser
improvements:
- #32 Added limited support for regex-constrained string in JSON using the
pattern
field. Seetest_phone_number_in_string()
. - #54 Fixed regression bug caused by limited-length JSON string caching.
- #53 Fixed problems with arrays of union types.
- 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 differentTokenEnforcer
instances. The sample notebooks have been updated to take advantage of this option. - Performance improvement: Long sequences will see up to 5x
TokenEnforcer
runtime footprint reduction.
- Bug fixes
- vLLM performance improvements
- Sample notebooks don't require huggingface account anymore
- Added ExLlamaV2 integration
- JSON Schema: Added support for union types. In pydantic, both
key: int | str
andkey: Union[int, str]
formats are supported - JSON Schema: Added support for schemaless JSON mode.
JsonSchemaParser(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
- Fixed unescaped newlines being allowed in json freetext fields
- RegexParser and JsonSchemaParser can now output all of the characters that exist in the tokenzier
- Added "Known issues and limitations" section to the README
- Fixed a bug in JsonSchemaParser where sometimes illegal commas were allowed
- JSON Schema : Supports empty arrays and escape characters in strings
- Regex : Performance improvement in some cases
- Added
UnionParser
andSequenceParser
to allow combining parsers
- Made 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)
- Added support for the analyser in llama.cpp, updated example notebook
- JsonSchemaParser now take list min/max items into consideration
- Improved JsonSchemaParser whitespace support
- Improved RegexParser performance, especially in regular expressions with
.+
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.
- Introduced
lmformatenforcer.integrations
module which will have the integrations with inference engines. - Added llama-cpp-python integration to the library in
lmformatenforcer.integrations.llamacpp
- Breaking API Change: Moved
'build_transformers_prefix_allowed_tokens_fn', 'generate_enforced'
fromlmformatenforcer
tolmformatenforcer.integrations.transformers
.