What's Changed
Happy new year! This release contains a significant overhaul of many elements of guidance, including:
- Visualization Overhaul: Guidance's in-line visualizations have been rewritten from scratch. TL;DR: We added a lot of code to support better model metrics and visualization. Check it out:
-
Significantly Faster, Rust-based Grammar Engine: Guidance's core grammar processing has been fully migrated to the llguidance Rust library. Our grammar processing is now significantly faster -- state of the art across frameworks -- and fixes some key, subtle bugs in the earlier processing engine. All constrained decoding code will now run much faster.
-
Increased JSON schema coverage: We've spent a lot of time focusing on JSON schema support in guidance, and now have leading coverage of JSON schema constraint types via guidance's
json
function. -
And lots more general quality of life improvements! See below for full list of PRs and changelogs. Thank you to all the existing and new contributors that made this possible!
- [WIP] Replace EarleyParser with lexeme-based rust implementation by @hudson-ai in #951
- Update README.md with new grammar-enabled endpoint details (Azure AI) by @Harsha-Nori in #998
- [Test] Enable Azure Guidance endpoints in test matrix by @riedgar-ms in #999
- [Test] Move Azure Guidance in CI by @riedgar-ms in #1000
- [Bug] del
f._self_call_placeholder_
even when callingf
raises exception by @hudson-ai in #994 - [mypy] Improve types in _grammar.py by @riedgar-ms in #1002
- [Build] CI & Notebook Workaround by @riedgar-ms in #1005
- [Feature] Allow
oneOf
in JSON schemas (with limited support) by @hudson-ai in #982 - Use
json_string
kwarg fromllguidance 0.1.7
to properly escape json string patterns by @hudson-ai in #1008 - Remove
Placeholder
andreplace_grammar_node
in favor of pointer-like container object by @hudson-ai in #1007 - [Feature] Support
required
properties in JSON schemas by @hudson-ai in #1009 - [Housekeeping] Clean up Enums to make JSON features more transparent by @hudson-ai in #1011
- [Doc] Fix typos in README and tutorials notebooks by @gfesatidis in #1012
- fix test_ll for new llguidance with working advance_parser() by @mmoskal in #1013
- [Bug] Ensure
grammar.match
raises appropriately on incomplete input by @hudson-ai in #1016 - Support boolean JSON schemas by @hudson-ai in #1015
@overload
theguidance
decorator in order to improve static type-checking by @hudson-ai in #1014- JSON string 'format' kwarg by @hudson-ai in #984
- Strip anchors from JSON regexes by @hudson-ai in #1027
- JSON reserved keywords by @hudson-ai in #1032
- "required" JSON keys are validated against "additionalProperties" if they are missing from "properties" by @hudson-ai in #1029
- [Bug] Make
_self_call_placeholder_
thread-safe by @hudson-ai in #1034 - add test for "nullable bug" by @mmoskal in #1025
- Make the tests pass with larger tokenizers by @mmoskal in #1037
- [Feature] Support for JSON
minimum
,maximum
,exclusiveMinimum
, andexclusiveMaximum
by @hudson-ai in #1023 - [Feature] Allow
@guidance
to decorate methods by @hudson-ai in #1035 - [Bug] [Feature] Fix issue #1039 by exposing
And
,Not
regex operators fromllguidance
by @hudson-ai in #1043 - [WIP] Try to get PR Gate working again... by @hudson-ai in #1048
- [Feature] Enable user-passed
separators
keyword toguidance.json
by @hudson-ai in #1044 - fix typos in README by @Saibo-creator in #1056
- [Feature] Expand JSON
$ref
resolution by @hudson-ai in #1061 - [JSON] Raise exceptions when "sibling" keywords are unhandled by @hudson-ai in #1063
- [Feature] Allow json-loads-able strings to be passed as schema by @hudson-ai in #1028
- [Hotfix] Echo forced to false on terminal detection. by @nopdive in #1067
- [Keeping House] Split JSON tests into multiple files by @hudson-ai in #1072
- [Feature] [JSON] Broader support of
allOf
JSON keyword by @hudson-ai in #1070 - [BUG] Reset role blocks when
model.reset
is called by @hudson-ai in #1073 - [Optimization] Advance parser concurrently with model forward pass by @hudson-ai in #1065
- Update README.md by @culmat in #1045
- [Feature] Add qwen2.5 chat templates by @xruifan in #1066
- Expose fastforward and backtrack llguidance flags by @Harsha-Nori in #1075
- [Bug] Fix for environment detection in barebones environments. by @nopdive in #1076
- Update setup.py to limit llguidance version by @hudson-ai in #1080
- update to llguidance 0.4.1 by @mmoskal in #1081
- fix current failures in pytest when run locally by @paulbkoch in #1083
- Force Transformers engine to return float logits by @JC1DA in #1086
- Bump runners from macos-12 to macos-14 by @hudson-ai in #1088
- update llguidance to 0.5.0 by @mmoskal in #1087
- Use
llguidance
JSON grammar by @hudson-ai in #1085 - Upgrade llguidance to
0.5.1rc0
by @hudson-ai in #1090 - Interactivity Overhaul (User Interface & Model Instrumentation & Network Comms) by @nopdive in #1054
New Contributors
- @gfesatidis made their first contribution in #1012
- @Saibo-creator made their first contribution in #1056
- @culmat made their first contribution in #1045
- @xruifan made their first contribution in #1066
- @JC1DA made their first contribution in #1086
Full Changelog: 0.1.16...0.2.0