llguidance 1.4.0__tar.gz → 1.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. {llguidance-1.4.0 → llguidance-1.5.0}/.github/workflows/rust.yml +19 -1
  2. {llguidance-1.4.0 → llguidance-1.5.0}/CHANGELOG.md +14 -0
  3. {llguidance-1.4.0 → llguidance-1.5.0}/Cargo.lock +201 -8
  4. {llguidance-1.4.0 → llguidance-1.5.0}/PKG-INFO +9 -3
  5. {llguidance-1.4.0 → llguidance-1.5.0}/README.md +7 -1
  6. llguidance-1.5.0/docs/toolcalls.md +235 -0
  7. {llguidance-1.4.0 → llguidance-1.5.0}/parser/Cargo.toml +6 -1
  8. llguidance-1.5.0/parser/benches/compute_mask.rs +194 -0
  9. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/grammar.rs +2 -6
  10. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/parser.rs +6 -5
  11. {llguidance-1.4.0 → llguidance-1.5.0}/pyproject.toml +1 -1
  12. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/_lib.pyi +20 -0
  13. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/mlx.py +1 -1
  14. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/numpy.py +19 -0
  15. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/torch.py +19 -0
  16. {llguidance-1.4.0 → llguidance-1.5.0}/python/torch_tests/test_matcher.py +68 -0
  17. {llguidance-1.4.0 → llguidance-1.5.0}/python_ext/Cargo.toml +1 -1
  18. {llguidance-1.4.0 → llguidance-1.5.0}/python_ext/src/llmatcher.rs +54 -6
  19. {llguidance-1.4.0 → llguidance-1.5.0}/python_ext/src/parserlimits.rs +1 -1
  20. {llguidance-1.4.0 → llguidance-1.5.0}/python_ext/src/py.rs +4 -4
  21. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/Cargo.toml +1 -1
  22. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/src/svob.rs +32 -1
  23. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/src/toktree.rs +26 -3
  24. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_hf_downloader/Cargo.toml +1 -1
  25. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_hf_tokenizers/Cargo.toml +4 -1
  26. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_hf_tokenizers/src/lib.rs +171 -15
  27. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_tiktoken/Cargo.toml +1 -1
  28. {llguidance-1.4.0 → llguidance-1.5.0}/.github/workflows/code-coverage.yml +0 -0
  29. {llguidance-1.4.0 → llguidance-1.5.0}/.github/workflows/wheels.yml +0 -0
  30. {llguidance-1.4.0 → llguidance-1.5.0}/.gitignore +0 -0
  31. {llguidance-1.4.0 → llguidance-1.5.0}/CODE_OF_CONDUCT.md +0 -0
  32. {llguidance-1.4.0 → llguidance-1.5.0}/Cargo.toml +0 -0
  33. {llguidance-1.4.0 → llguidance-1.5.0}/LICENSE +0 -0
  34. {llguidance-1.4.0 → llguidance-1.5.0}/SECURITY.md +0 -0
  35. {llguidance-1.4.0 → llguidance-1.5.0}/SUPPORT.md +0 -0
  36. {llguidance-1.4.0 → llguidance-1.5.0}/c_sample/Makefile +0 -0
  37. {llguidance-1.4.0 → llguidance-1.5.0}/c_sample/README.md +0 -0
  38. {llguidance-1.4.0 → llguidance-1.5.0}/c_sample/c_sample.cpp +0 -0
  39. {llguidance-1.4.0 → llguidance-1.5.0}/docs/de_recursing.md +0 -0
  40. {llguidance-1.4.0 → llguidance-1.5.0}/docs/fast_forward.md +0 -0
  41. {llguidance-1.4.0 → llguidance-1.5.0}/docs/json_schema.md +0 -0
  42. {llguidance-1.4.0 → llguidance-1.5.0}/docs/mask_plot.png +0 -0
  43. {llguidance-1.4.0 → llguidance-1.5.0}/docs/optimizations.md +0 -0
  44. {llguidance-1.4.0 → llguidance-1.5.0}/docs/parametric.md +0 -0
  45. {llguidance-1.4.0 → llguidance-1.5.0}/docs/special_tokens.md +0 -0
  46. {llguidance-1.4.0 → llguidance-1.5.0}/docs/syntax.md +0 -0
  47. {llguidance-1.4.0 → llguidance-1.5.0}/docs/toktrie.md +0 -0
  48. {llguidance-1.4.0 → llguidance-1.5.0}/json_stats/Cargo.toml +0 -0
  49. {llguidance-1.4.0 → llguidance-1.5.0}/json_stats/expected_maskbench.json +0 -0
  50. {llguidance-1.4.0 → llguidance-1.5.0}/json_stats/jstats.sh +0 -0
  51. {llguidance-1.4.0 → llguidance-1.5.0}/json_stats/scripts/split-stats.sh +0 -0
  52. {llguidance-1.4.0 → llguidance-1.5.0}/json_stats/scripts/split_plot.py +0 -0
  53. {llguidance-1.4.0 → llguidance-1.5.0}/json_stats/src/json_stats.rs +0 -0
  54. {llguidance-1.4.0 → llguidance-1.5.0}/json_stats/src/lib.rs +0 -0
  55. {llguidance-1.4.0 → llguidance-1.5.0}/json_stats/src/stats.rs +0 -0
  56. {llguidance-1.4.0 → llguidance-1.5.0}/parser/LICENSE +0 -0
  57. {llguidance-1.4.0 → llguidance-1.5.0}/parser/README.md +0 -0
  58. {llguidance-1.4.0 → llguidance-1.5.0}/parser/build.rs +0 -0
  59. {llguidance-1.4.0 → llguidance-1.5.0}/parser/cbindgen.toml +0 -0
  60. {llguidance-1.4.0 → llguidance-1.5.0}/parser/grammars/character.json +0 -0
  61. {llguidance-1.4.0 → llguidance-1.5.0}/parser/grammars/json.json +0 -0
  62. {llguidance-1.4.0 → llguidance-1.5.0}/parser/llguidance.h +0 -0
  63. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/api.rs +0 -0
  64. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/constraint.rs +0 -0
  65. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/from_guidance.rs +0 -0
  66. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/lexer.rs +0 -0
  67. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/lexerspec.rs +0 -0
  68. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/mod.rs +0 -0
  69. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/perf.rs +0 -0
  70. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/regexvec.rs +0 -0
  71. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/earley/slicer.rs +0 -0
  72. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/factory.rs +0 -0
  73. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/ffi.rs +0 -0
  74. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/ffi_par.rs +0 -0
  75. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/grammar_builder.rs +0 -0
  76. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/hashcons.rs +0 -0
  77. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/README.md +0 -0
  78. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/compiler.rs +0 -0
  79. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/context_ref.rs +0 -0
  80. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/context_simple/context.rs +0 -0
  81. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/context_simple/draft.rs +0 -0
  82. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/context_simple/mod.rs +0 -0
  83. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/formats.rs +0 -0
  84. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/mod.rs +0 -0
  85. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/numeric.rs +0 -0
  86. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/schema.rs +0 -0
  87. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json/shared_context.rs +0 -0
  88. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/json_validation.rs +0 -0
  89. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/lark/README.md +0 -0
  90. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/lark/ast.rs +0 -0
  91. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/lark/common.rs +0 -0
  92. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/lark/compiler.rs +0 -0
  93. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/lark/lexer.rs +0 -0
  94. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/lark/mod.rs +0 -0
  95. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/lark/parser.rs +0 -0
  96. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/lib.rs +0 -0
  97. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/logging.rs +0 -0
  98. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/matcher.rs +0 -0
  99. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/output.rs +0 -0
  100. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/panic_utils.rs +0 -0
  101. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/regex_rewrite.rs +0 -0
  102. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/stop_controller.rs +0 -0
  103. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/substring.rs +0 -0
  104. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/tokenizer_json.rs +0 -0
  105. {llguidance-1.4.0 → llguidance-1.5.0}/parser/src/tokenparser.rs +0 -0
  106. {llguidance-1.4.0 → llguidance-1.5.0}/plan.md +0 -0
  107. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/__init__.py +0 -0
  108. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/_grammar_from.py +0 -0
  109. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/_struct_tag.py +0 -0
  110. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/_tokenizer.py +0 -0
  111. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/_util.py +0 -0
  112. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/cli.py +0 -0
  113. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/gbnf_to_lark.py +0 -0
  114. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/hf.py +0 -0
  115. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/llamacpp.py +0 -0
  116. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/py.typed +0 -0
  117. {llguidance-1.4.0 → llguidance-1.5.0}/python/llguidance/tiktoken.py +0 -0
  118. {llguidance-1.4.0 → llguidance-1.5.0}/python/mypy.ini +0 -0
  119. {llguidance-1.4.0 → llguidance-1.5.0}/python/torch_tests/__init__.py +0 -0
  120. {llguidance-1.4.0 → llguidance-1.5.0}/python/torch_tests/test_bitmask.py +0 -0
  121. {llguidance-1.4.0 → llguidance-1.5.0}/python/torch_tests/test_hf.py +0 -0
  122. {llguidance-1.4.0 → llguidance-1.5.0}/python/torch_tests/test_llamacpp.py +0 -0
  123. {llguidance-1.4.0 → llguidance-1.5.0}/python/torch_tests/test_tiktoken.py +0 -0
  124. {llguidance-1.4.0 → llguidance-1.5.0}/python_ext/src/lib.rs +0 -0
  125. {llguidance-1.4.0 → llguidance-1.5.0}/python_ext/src/llamatokenizer.rs +0 -0
  126. {llguidance-1.4.0 → llguidance-1.5.0}/python_ext/src/llinterpreter.rs +0 -0
  127. {llguidance-1.4.0 → llguidance-1.5.0}/python_ext/src/pyjson.rs +0 -0
  128. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/Cargo.toml +0 -0
  129. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/README.md +0 -0
  130. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/cli.sh +0 -0
  131. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/blog.sample.json +0 -0
  132. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/blog.schema.json +0 -0
  133. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/blog.schema.ll.json +0 -0
  134. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/README.md +0 -0
  135. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/arithmetic.gbnf +0 -0
  136. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/c.gbnf +0 -0
  137. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/chess.gbnf +0 -0
  138. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/english.gbnf +0 -0
  139. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/japanese.gbnf +0 -0
  140. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/json.gbnf +0 -0
  141. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/json_arr.gbnf +0 -0
  142. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/list.gbnf +0 -0
  143. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/from-llama.cpp/vllm-sql.gbnf +0 -0
  144. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/lark.lark +0 -0
  145. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/rfc.lark +0 -0
  146. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/rfc.xml +0 -0
  147. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/data/ulysses.md +0 -0
  148. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/gtest.sh +0 -0
  149. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/lark.sh +0 -0
  150. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/run.sh +0 -0
  151. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/src/lib.rs +0 -0
  152. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/src/minimal.rs +0 -0
  153. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/src/sample_parser.rs +0 -0
  154. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/common_lark_utils/mod.rs +0 -0
  155. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_json_arrays.rs +0 -0
  156. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_json_enum_const.rs +0 -0
  157. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_json_objects.rs +0 -0
  158. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_json_primitives.rs +0 -0
  159. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_json_schema_combinations.rs +0 -0
  160. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_json_string_format.rs +0 -0
  161. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_json_x_guidance.rs +0 -0
  162. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_lark.rs +0 -0
  163. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_ll.rs +0 -0
  164. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_raw_parser.rs +0 -0
  165. {llguidance-1.4.0 → llguidance-1.5.0}/sample_parser/tests/test_stop.rs +0 -0
  166. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/annotate_asm.js +0 -0
  167. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/bump.py +0 -0
  168. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/cbindgen.sh +0 -0
  169. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/checklinks.py +0 -0
  170. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/checklinks.sh +0 -0
  171. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/ci-publish.py +0 -0
  172. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/disasm.sh +0 -0
  173. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/gbnf_to_lark.py +0 -0
  174. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/gen-testcase.py +0 -0
  175. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/git-version.sh +0 -0
  176. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/install-deps.sh +0 -0
  177. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/jsonschema-stats.js +0 -0
  178. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/remote-guidance-test.sh +0 -0
  179. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/rust-size.js +0 -0
  180. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/rust_size.py +0 -0
  181. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/test-guidance.sh +0 -0
  182. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/tokenizer_test.py +0 -0
  183. {llguidance-1.4.0 → llguidance-1.5.0}/scripts/update-git.py +0 -0
  184. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/LICENSE +0 -0
  185. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/README.md +0 -0
  186. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/src/bytes.rs +0 -0
  187. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/src/lib.rs +0 -0
  188. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/src/recognizer.rs +0 -0
  189. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/src/rng.rs +0 -0
  190. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/src/tokenv.rs +0 -0
  191. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie/tests/test_svob.rs +0 -0
  192. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_hf_downloader/LICENSE +0 -0
  193. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_hf_downloader/src/lib.rs +0 -0
  194. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_hf_tokenizers/LICENSE +0 -0
  195. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_tiktoken/LICENSE +0 -0
  196. {llguidance-1.4.0 → llguidance-1.5.0}/toktrie_tiktoken/src/lib.rs +0 -0
@@ -42,24 +42,42 @@ jobs:
42
42
  - name: Install python test dependencies
43
43
  run: ./scripts/install-deps.sh
44
44
 
45
- # these three steps are equivalent to just ./scripts/test-guidance.sh
45
+ - name: Disk Space Check
46
+ run: df -h .
47
+
48
+ # The three test steps are equivalent to just ./scripts/test-guidance.sh
46
49
  # but we want to run them separately to get better timings/logs/etc
47
50
 
48
51
  - name: Run Rust tests
49
52
  run: ./scripts/test-guidance.sh --rust
50
53
 
54
+ - name: Disk Space Check
55
+ run: df -h .
56
+
51
57
  - name: Run MaskBench
52
58
  run: ./scripts/test-guidance.sh --mb
53
59
 
60
+ - name: Disk Space Check
61
+ run: df -h .
62
+
54
63
  - name: Run Python Guidance tests
55
64
  run: ./scripts/test-guidance.sh --py
56
65
 
66
+ - name: Disk Space Check
67
+ run: df -h .
68
+
57
69
  - name: Build sdist
58
70
  run: maturin build --sdist --zig
59
71
 
72
+ - name: Disk Space Check
73
+ run: df -h .
74
+
60
75
  - name: Build wheel
61
76
  run: maturin build --zig
62
77
 
78
+ - name: Disk Space Check
79
+ run: df -h .
80
+
63
81
  - name: Upload sdist and wheel artifact
64
82
  uses: actions/upload-artifact@v4
65
83
  with:
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  If a release doesn't introduce any interesting changes (build fixes etc.), it's skipped.
6
6
 
7
+ #### [v1.5.0](https://github.com/guidance-ai/llguidance/compare/v1.4.0...v1.5.0) 2026-02-02
8
+
9
+ - [FIX] Coerce `Metaspace` prepend_scheme to `never` [`#272`](https://github.com/guidance-ai/llguidance/pull/272)
10
+ - Speed up toktrie add_bias (~3% improvement) [`#264`](https://github.com/guidance-ai/llguidance/pull/264)
11
+ - Thanks @omarkilani!
12
+ - Add discord & email to readme [`#273`](https://github.com/guidance-ai/llguidance/pull/273)
13
+ - Add parallel token consumption API (consume_token_par) [`#271`](https://github.com/guidance-ai/llguidance/pull/271)
14
+ - Thanks @alecsolder!
15
+ - Add toolcalls doc [`#270`](https://github.com/guidance-ai/llguidance/pull/270)
16
+ - Fix typo in README.md [`#269`](https://github.com/guidance-ai/llguidance/pull/269)
17
+ - Thanks @juliendenize!
18
+ - Mark immutable pyclasses as frozen [`#260`](https://github.com/guidance-ai/llguidance/pull/260)
19
+ - Thanks @ngoldbaum!
20
+
7
21
  #### [v1.4.0](https://github.com/guidance-ai/llguidance/compare/v1.3.0...v1.4.0) 2025-11-18
8
22
 
9
23
  - Update pyo3 dependency to latest version to support python 3.14t [`#255`](https://github.com/guidance-ai/llguidance/pull/255)
@@ -40,6 +40,21 @@ dependencies = [
40
40
  "memchr",
41
41
  ]
42
42
 
43
+ [[package]]
44
+ name = "alloca"
45
+ version = "0.4.0"
46
+ source = "registry+https://github.com/rust-lang/crates.io-index"
47
+ checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4"
48
+ dependencies = [
49
+ "cc",
50
+ ]
51
+
52
+ [[package]]
53
+ name = "anes"
54
+ version = "0.1.6"
55
+ source = "registry+https://github.com/rust-lang/crates.io-index"
56
+ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
57
+
43
58
  [[package]]
44
59
  name = "anstream"
45
60
  version = "0.6.19"
@@ -229,6 +244,12 @@ version = "1.10.1"
229
244
  source = "registry+https://github.com/rust-lang/crates.io-index"
230
245
  checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
231
246
 
247
+ [[package]]
248
+ name = "cast"
249
+ version = "0.3.0"
250
+ source = "registry+https://github.com/rust-lang/crates.io-index"
251
+ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
252
+
232
253
  [[package]]
233
254
  name = "castaway"
234
255
  version = "0.2.3"
@@ -253,6 +274,33 @@ version = "1.0.1"
253
274
  source = "registry+https://github.com/rust-lang/crates.io-index"
254
275
  checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
255
276
 
277
+ [[package]]
278
+ name = "ciborium"
279
+ version = "0.2.2"
280
+ source = "registry+https://github.com/rust-lang/crates.io-index"
281
+ checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"
282
+ dependencies = [
283
+ "ciborium-io",
284
+ "ciborium-ll",
285
+ "serde",
286
+ ]
287
+
288
+ [[package]]
289
+ name = "ciborium-io"
290
+ version = "0.2.2"
291
+ source = "registry+https://github.com/rust-lang/crates.io-index"
292
+ checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"
293
+
294
+ [[package]]
295
+ name = "ciborium-ll"
296
+ version = "0.2.2"
297
+ source = "registry+https://github.com/rust-lang/crates.io-index"
298
+ checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
299
+ dependencies = [
300
+ "ciborium-io",
301
+ "half",
302
+ ]
303
+
256
304
  [[package]]
257
305
  name = "clap"
258
306
  version = "4.5.40"
@@ -352,6 +400,41 @@ dependencies = [
352
400
  "cfg-if",
353
401
  ]
354
402
 
403
+ [[package]]
404
+ name = "criterion"
405
+ version = "0.8.1"
406
+ source = "registry+https://github.com/rust-lang/crates.io-index"
407
+ checksum = "4d883447757bb0ee46f233e9dc22eb84d93a9508c9b868687b274fc431d886bf"
408
+ dependencies = [
409
+ "alloca",
410
+ "anes",
411
+ "cast",
412
+ "ciborium",
413
+ "clap",
414
+ "criterion-plot",
415
+ "itertools 0.13.0",
416
+ "num-traits",
417
+ "oorandom",
418
+ "page_size",
419
+ "plotters",
420
+ "rayon",
421
+ "regex",
422
+ "serde",
423
+ "serde_json",
424
+ "tinytemplate",
425
+ "walkdir",
426
+ ]
427
+
428
+ [[package]]
429
+ name = "criterion-plot"
430
+ version = "0.8.1"
431
+ source = "registry+https://github.com/rust-lang/crates.io-index"
432
+ checksum = "ed943f81ea2faa8dcecbbfa50164acf95d555afec96a27871663b300e387b2e4"
433
+ dependencies = [
434
+ "cast",
435
+ "itertools 0.13.0",
436
+ ]
437
+
355
438
  [[package]]
356
439
  name = "crossbeam-deque"
357
440
  version = "0.8.6"
@@ -377,6 +460,12 @@ version = "0.8.21"
377
460
  source = "registry+https://github.com/rust-lang/crates.io-index"
378
461
  checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
379
462
 
463
+ [[package]]
464
+ name = "crunchy"
465
+ version = "0.2.4"
466
+ source = "registry+https://github.com/rust-lang/crates.io-index"
467
+ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
468
+
380
469
  [[package]]
381
470
  name = "darling"
382
471
  version = "0.20.11"
@@ -791,6 +880,17 @@ dependencies = [
791
880
  "tracing",
792
881
  ]
793
882
 
883
+ [[package]]
884
+ name = "half"
885
+ version = "2.7.1"
886
+ source = "registry+https://github.com/rust-lang/crates.io-index"
887
+ checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
888
+ dependencies = [
889
+ "cfg-if",
890
+ "crunchy",
891
+ "zerocopy",
892
+ ]
893
+
794
894
  [[package]]
795
895
  name = "hashbrown"
796
896
  version = "0.15.4"
@@ -1136,6 +1236,15 @@ version = "1.70.1"
1136
1236
  source = "registry+https://github.com/rust-lang/crates.io-index"
1137
1237
  checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
1138
1238
 
1239
+ [[package]]
1240
+ name = "itertools"
1241
+ version = "0.13.0"
1242
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1243
+ checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
1244
+ dependencies = [
1245
+ "either",
1246
+ ]
1247
+
1139
1248
  [[package]]
1140
1249
  name = "itertools"
1141
1250
  version = "0.14.0"
@@ -1241,9 +1350,10 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
1241
1350
 
1242
1351
  [[package]]
1243
1352
  name = "llguidance"
1244
- version = "1.4.0"
1353
+ version = "1.5.0"
1245
1354
  dependencies = [
1246
1355
  "anyhow",
1356
+ "criterion",
1247
1357
  "derivre",
1248
1358
  "indexmap",
1249
1359
  "instant",
@@ -1260,7 +1370,7 @@ dependencies = [
1260
1370
 
1261
1371
  [[package]]
1262
1372
  name = "llguidance_py"
1263
- version = "1.4.0"
1373
+ version = "1.5.0"
1264
1374
  dependencies = [
1265
1375
  "anyhow",
1266
1376
  "bytemuck",
@@ -1516,6 +1626,12 @@ version = "1.70.1"
1516
1626
  source = "registry+https://github.com/rust-lang/crates.io-index"
1517
1627
  checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad"
1518
1628
 
1629
+ [[package]]
1630
+ name = "oorandom"
1631
+ version = "11.1.5"
1632
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1633
+ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
1634
+
1519
1635
  [[package]]
1520
1636
  name = "openssl"
1521
1637
  version = "0.10.73"
@@ -1572,6 +1688,16 @@ version = "0.5.2"
1572
1688
  source = "registry+https://github.com/rust-lang/crates.io-index"
1573
1689
  checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e"
1574
1690
 
1691
+ [[package]]
1692
+ name = "page_size"
1693
+ version = "0.6.0"
1694
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1695
+ checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da"
1696
+ dependencies = [
1697
+ "libc",
1698
+ "winapi",
1699
+ ]
1700
+
1575
1701
  [[package]]
1576
1702
  name = "parking_lot"
1577
1703
  version = "0.12.4"
@@ -1625,6 +1751,34 @@ version = "0.3.32"
1625
1751
  source = "registry+https://github.com/rust-lang/crates.io-index"
1626
1752
  checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
1627
1753
 
1754
+ [[package]]
1755
+ name = "plotters"
1756
+ version = "0.3.7"
1757
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1758
+ checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747"
1759
+ dependencies = [
1760
+ "num-traits",
1761
+ "plotters-backend",
1762
+ "plotters-svg",
1763
+ "wasm-bindgen",
1764
+ "web-sys",
1765
+ ]
1766
+
1767
+ [[package]]
1768
+ name = "plotters-backend"
1769
+ version = "0.3.7"
1770
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1771
+ checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a"
1772
+
1773
+ [[package]]
1774
+ name = "plotters-svg"
1775
+ version = "0.3.7"
1776
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1777
+ checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670"
1778
+ dependencies = [
1779
+ "plotters-backend",
1780
+ ]
1781
+
1628
1782
  [[package]]
1629
1783
  name = "portable-atomic"
1630
1784
  version = "1.11.1"
@@ -1790,7 +1944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1790
1944
  checksum = "2964d0cf57a3e7a06e8183d14a8b527195c706b7983549cd5462d5aa3747438f"
1791
1945
  dependencies = [
1792
1946
  "either",
1793
- "itertools",
1947
+ "itertools 0.14.0",
1794
1948
  "rayon",
1795
1949
  ]
1796
1950
 
@@ -2062,6 +2216,15 @@ version = "1.0.20"
2062
2216
  source = "registry+https://github.com/rust-lang/crates.io-index"
2063
2217
  checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
2064
2218
 
2219
+ [[package]]
2220
+ name = "same-file"
2221
+ version = "1.0.6"
2222
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2223
+ checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
2224
+ dependencies = [
2225
+ "winapi-util",
2226
+ ]
2227
+
2065
2228
  [[package]]
2066
2229
  name = "sample_parser"
2067
2230
  version = "0.1.0"
@@ -2402,6 +2565,16 @@ dependencies = [
2402
2565
  "zerovec",
2403
2566
  ]
2404
2567
 
2568
+ [[package]]
2569
+ name = "tinytemplate"
2570
+ version = "1.2.1"
2571
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2572
+ checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"
2573
+ dependencies = [
2574
+ "serde",
2575
+ "serde_json",
2576
+ ]
2577
+
2405
2578
  [[package]]
2406
2579
  name = "tokenizers"
2407
2580
  version = "0.21.2"
@@ -2416,7 +2589,7 @@ dependencies = [
2416
2589
  "esaxx-rs",
2417
2590
  "fancy-regex 0.14.0",
2418
2591
  "getrandom 0.3.3",
2419
- "itertools",
2592
+ "itertools 0.14.0",
2420
2593
  "log",
2421
2594
  "macro_rules_attribute",
2422
2595
  "monostate",
@@ -2499,7 +2672,7 @@ dependencies = [
2499
2672
 
2500
2673
  [[package]]
2501
2674
  name = "toktrie"
2502
- version = "1.4.0"
2675
+ version = "1.5.0"
2503
2676
  dependencies = [
2504
2677
  "anyhow",
2505
2678
  "bytemuck",
@@ -2510,7 +2683,7 @@ dependencies = [
2510
2683
 
2511
2684
  [[package]]
2512
2685
  name = "toktrie_hf_downloader"
2513
- version = "1.4.0"
2686
+ version = "1.5.0"
2514
2687
  dependencies = [
2515
2688
  "anyhow",
2516
2689
  "hf-hub",
@@ -2521,10 +2694,11 @@ dependencies = [
2521
2694
 
2522
2695
  [[package]]
2523
2696
  name = "toktrie_hf_tokenizers"
2524
- version = "1.4.0"
2697
+ version = "1.5.0"
2525
2698
  dependencies = [
2526
2699
  "anyhow",
2527
2700
  "log",
2701
+ "rstest",
2528
2702
  "serde",
2529
2703
  "serde_json",
2530
2704
  "tokenizers",
@@ -2533,7 +2707,7 @@ dependencies = [
2533
2707
 
2534
2708
  [[package]]
2535
2709
  name = "toktrie_tiktoken"
2536
- version = "1.4.0"
2710
+ version = "1.5.0"
2537
2711
  dependencies = [
2538
2712
  "anyhow",
2539
2713
  "log",
@@ -2757,6 +2931,16 @@ version = "0.8.0"
2757
2931
  source = "registry+https://github.com/rust-lang/crates.io-index"
2758
2932
  checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64"
2759
2933
 
2934
+ [[package]]
2935
+ name = "walkdir"
2936
+ version = "2.5.0"
2937
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2938
+ checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
2939
+ dependencies = [
2940
+ "same-file",
2941
+ "winapi-util",
2942
+ ]
2943
+
2760
2944
  [[package]]
2761
2945
  name = "want"
2762
2946
  version = "0.3.1"
@@ -2919,6 +3103,15 @@ version = "0.4.0"
2919
3103
  source = "registry+https://github.com/rust-lang/crates.io-index"
2920
3104
  checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
2921
3105
 
3106
+ [[package]]
3107
+ name = "winapi-util"
3108
+ version = "0.1.11"
3109
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3110
+ checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
3111
+ dependencies = [
3112
+ "windows-sys 0.60.2",
3113
+ ]
3114
+
2922
3115
  [[package]]
2923
3116
  name = "winapi-x86_64-pc-windows-gnu"
2924
3117
  version = "0.4.0"
@@ -1,14 +1,20 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llguidance
3
- Version: 1.4.0
3
+ Version: 1.5.0
4
4
  License-File: LICENSE
5
5
  Summary: Bindings for the Low-level Guidance (llguidance) Rust library for use within Guidance
6
6
  Author: Michal Moskal
7
7
  License-Expression: MIT
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
10
- Project-URL: repository, https://github.com/microsoft/llguidance
11
10
  Project-URL: issue_tracker, https://github.com/microsoft/llguidance/issues
11
+ Project-URL: repository, https://github.com/microsoft/llguidance
12
+
13
+ <div align="right">
14
+ <a href="https://discord.gg/cjPfAK43dz"><img src="https://img.shields.io/badge/Discord-Join%20Us-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
15
+ <a href="mailto:guidanceai@microsoft.com"><img src="https://img.shields.io/badge/Email-guidanceai%40microsoft.com-0078D4?logo=microsoft-outlook&logoColor=white" alt="Email"></a>
16
+ <img src="https://img.shields.io/badge/Hours-10am--2pm%20Pacific-gray" alt="Hours">
17
+ </div>
12
18
 
13
19
  # Low-level Guidance (llguidance)
14
20
 
@@ -35,7 +41,7 @@ Project-URL: issue_tracker, https://github.com/microsoft/llguidance/issues
35
41
  ## About
36
42
 
37
43
  This library implements constrained decoding (also called constrained sampling or
38
- structured outputs) for Large Langauge Models (LLMs).
44
+ structured outputs) for Large Language Models (LLMs).
39
45
  It can enforce arbitrary context-free grammar on the output of LLM
40
46
  and is fast - on the order of 50μs of CPU time per token
41
47
  (for 128k tokenizer) with negligible startup costs.
@@ -1,3 +1,9 @@
1
+ <div align="right">
2
+ <a href="https://discord.gg/cjPfAK43dz"><img src="https://img.shields.io/badge/Discord-Join%20Us-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
3
+ <a href="mailto:guidanceai@microsoft.com"><img src="https://img.shields.io/badge/Email-guidanceai%40microsoft.com-0078D4?logo=microsoft-outlook&logoColor=white" alt="Email"></a>
4
+ <img src="https://img.shields.io/badge/Hours-10am--2pm%20Pacific-gray" alt="Hours">
5
+ </div>
6
+
1
7
  # Low-level Guidance (llguidance)
2
8
 
3
9
  <p align="center">
@@ -23,7 +29,7 @@
23
29
  ## About
24
30
 
25
31
  This library implements constrained decoding (also called constrained sampling or
26
- structured outputs) for Large Langauge Models (LLMs).
32
+ structured outputs) for Large Language Models (LLMs).
27
33
  It can enforce arbitrary context-free grammar on the output of LLM
28
34
  and is fast - on the order of 50μs of CPU time per token
29
35
  (for 128k tokenizer) with negligible startup costs.