Formatron

Latest version: v0.4.10

Safety actively analyzes 714973 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.4.3

- Bug fix: typing.Literal["xxx"] will now work correctly with JsonExtractor
- Top level array is now supported in json schema with JsonExtractor

0.4.2

- logits processors now support `is_completed()`
- Formatters sequence can now be sparce; in other words, it is possible now to constrain some sequences in one batch but leave others unconstrained.

0.4.1

- Significantly improved `vllm` integrations' speed
- Update kbnf dependency to `v0.3.10`

0.4.0

Summary
- faster `Formatter` compilation
- Refactors to make internal implementation and public API cleaner
- Native support for basic json schema(all `type` keyword constraints and recursion)
- Basic support for substring extraction
What's changed
- Removed `grammar_generators` package completely.
- `JsonExtractor` class is moved to `formats.json` package.
- `FormatterBuilder.schema()` is removed.
- Added `FormatterBuilder.json()` which is simpler to use than `FormatterBuilder.schema()`.
- `RegexExtractor` is moved from `extractor` to `formats.regex`
- `kbnf_representation` is renamed to `kbnf_reference` and `nonterminal` is renamed to `kbnf_definition` for clarity in `Extractor`.
- `NonterminalExtractor` is added to better illustrate the differences in interfaces&implementation between `LiteralExtractor` and other extractors.
- `LiteralExtractor` is private now,
- Bug fix: JsonExtractor will no longer produce `None` when parsing json where some keys/values contain `{` or `}`.
- Make `Formatron` compatible with the newest `vllm==0.6.0` and `exllamav2==0.2.1`.
- Faster constrained decoding with `exllamav2` integration thanks to turboderp 's optimizations in his `exllamav2` library.
- Faster `kbnf.Vocabulary` creation by turboderp in https://github.com/Dan-wanna-M/formatron/pull/10
- Update docs, benchmarks and comments accordingly.

**Full Changelog**: https://github.com/Dan-wanna-M/formatron/compare/v0.3.4...v0.4.0

0.3.4

- Bug fix: directly import `formatron.formatter` with pip installed package no longer produces `ModuleNotFoundError`

0.3.3

- Bug fix: exllamav2 integration will now correctly end generation with exactly one eos token

Page 2 of 3

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.