0.2.0
版本发布时间: 2025-01-08 04:46:31
guidance-ai/guidance最新发布版本:0.3.0(2025-09-10 05:18:26)
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
jsonfunction. -
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 https://github.com/guidance-ai/guidance/pull/951
- Update README.md with new grammar-enabled endpoint details (Azure AI) by @Harsha-Nori in https://github.com/guidance-ai/guidance/pull/998
- [Test] Enable Azure Guidance endpoints in test matrix by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/999
- [Test] Move Azure Guidance in CI by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/1000
- [Bug] del
f._self_call_placeholder_even when callingfraises exception by @hudson-ai in https://github.com/guidance-ai/guidance/pull/994 - [mypy] Improve types in _grammar.py by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/1002
- [Build] CI & Notebook Workaround by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/1005
- [Feature] Allow
oneOfin JSON schemas (with limited support) by @hudson-ai in https://github.com/guidance-ai/guidance/pull/982 - Use
json_stringkwarg fromllguidance 0.1.7to properly escape json string patterns by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1008 - Remove
Placeholderandreplace_grammar_nodein favor of pointer-like container object by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1007 - [Feature] Support
requiredproperties in JSON schemas by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1009 - [Housekeeping] Clean up Enums to make JSON features more transparent by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1011
- [Doc] Fix typos in README and tutorials notebooks by @gfesatidis in https://github.com/guidance-ai/guidance/pull/1012
- fix test_ll for new llguidance with working advance_parser() by @mmoskal in https://github.com/guidance-ai/guidance/pull/1013
- [Bug] Ensure
grammar.matchraises appropriately on incomplete input by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1016 - Support boolean JSON schemas by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1015
@overloadtheguidancedecorator in order to improve static type-checking by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1014- JSON string 'format' kwarg by @hudson-ai in https://github.com/guidance-ai/guidance/pull/984
- Strip anchors from JSON regexes by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1027
- JSON reserved keywords by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1032
- "required" JSON keys are validated against "additionalProperties" if they are missing from "properties" by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1029
- [Bug] Make
_self_call_placeholder_thread-safe by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1034 - add test for "nullable bug" by @mmoskal in https://github.com/guidance-ai/guidance/pull/1025
- Make the tests pass with larger tokenizers by @mmoskal in https://github.com/guidance-ai/guidance/pull/1037
- [Feature] Support for JSON
minimum,maximum,exclusiveMinimum, andexclusiveMaximumby @hudson-ai in https://github.com/guidance-ai/guidance/pull/1023 - [Feature] Allow
@guidanceto decorate methods by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1035 - [Bug] [Feature] Fix issue #1039 by exposing
And,Notregex operators fromllguidanceby @hudson-ai in https://github.com/guidance-ai/guidance/pull/1043 - [WIP] Try to get PR Gate working again... by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1048
- [Feature] Enable user-passed
separatorskeyword toguidance.jsonby @hudson-ai in https://github.com/guidance-ai/guidance/pull/1044 - fix typos in README by @Saibo-creator in https://github.com/guidance-ai/guidance/pull/1056
- [Feature] Expand JSON
$refresolution by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1061 - [JSON] Raise exceptions when "sibling" keywords are unhandled by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1063
- [Feature] Allow json-loads-able strings to be passed as schema by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1028
- [Hotfix] Echo forced to false on terminal detection. by @nopdive in https://github.com/guidance-ai/guidance/pull/1067
- [Keeping House] Split JSON tests into multiple files by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1072
- [Feature] [JSON] Broader support of
allOfJSON keyword by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1070 - [BUG] Reset role blocks when
model.resetis called by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1073 - [Optimization] Advance parser concurrently with model forward pass by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1065
- Update README.md by @culmat in https://github.com/guidance-ai/guidance/pull/1045
- [Feature] Add qwen2.5 chat templates by @xruifan in https://github.com/guidance-ai/guidance/pull/1066
- Expose fastforward and backtrack llguidance flags by @Harsha-Nori in https://github.com/guidance-ai/guidance/pull/1075
- [Bug] Fix for environment detection in barebones environments. by @nopdive in https://github.com/guidance-ai/guidance/pull/1076
- Update setup.py to limit llguidance version by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1080
- update to llguidance 0.4.1 by @mmoskal in https://github.com/guidance-ai/guidance/pull/1081
- fix current failures in pytest when run locally by @paulbkoch in https://github.com/guidance-ai/guidance/pull/1083
- Force Transformers engine to return float logits by @JC1DA in https://github.com/guidance-ai/guidance/pull/1086
- Bump runners from macos-12 to macos-14 by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1088
- update llguidance to 0.5.0 by @mmoskal in https://github.com/guidance-ai/guidance/pull/1087
- Use
llguidanceJSON grammar by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1085 - Upgrade llguidance to
0.5.1rc0by @hudson-ai in https://github.com/guidance-ai/guidance/pull/1090 - Interactivity Overhaul (User Interface & Model Instrumentation & Network Comms) by @nopdive in https://github.com/guidance-ai/guidance/pull/1054
New Contributors
- @gfesatidis made their first contribution in https://github.com/guidance-ai/guidance/pull/1012
- @Saibo-creator made their first contribution in https://github.com/guidance-ai/guidance/pull/1056
- @culmat made their first contribution in https://github.com/guidance-ai/guidance/pull/1045
- @xruifan made their first contribution in https://github.com/guidance-ai/guidance/pull/1066
- @JC1DA made their first contribution in https://github.com/guidance-ai/guidance/pull/1086
Full Changelog: https://github.com/guidance-ai/guidance/compare/0.1.16...0.2.0