gpo.zugaina.org

Search Portage & Overlays:

dev-python/xgrammar

Efficient, flexible structured generation engine for LLMs

Screenshots

  • xgrammar-0.2.5
    ~amd64
    cuda test python_single_target_python3_12 python_single_target_python3_13 python_single_target_python3_14 debug

    View      Download      Browse     License: Apache-2.0 BSD-2   
    Overlay: stuff
  • xgrammar-0.2.3
    ~amd64
    cuda test python_single_target_python3_12 python_single_target_python3_13 python_single_target_python3_14 debug

    View      Download      Browse     License: Apache-2.0 BSD-2   
    Overlay: stuff
  • xgrammar-0.2.2
    ~amd64
    cuda test python_single_target_python3_12 python_single_target_python3_13 python_single_target_python3_14 debug

    View      Download      Browse     License: Apache-2.0 BSD-2   
    Overlay: stuff

ChangeLog

commit 10839d49fba171f345990d5b18775828d64f1108
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sun Aug 23 13:14:34 2026 +0200

dev-python/xgrammar: depend on virtual/triton

commit d5280bb0fe58df648062dd8db009e50d5e7bc825
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Mon Aug 17 01:29:59 2026 +0200

dev-python/xgrammar: document gcc:15 JIT coupling on 0.2.3 and 0.2.5

The cuda? sys-devel/gcc:15 runtime dep and the bundled
cuda-host-compiler patch are coupled: the CUDA token-bitmask kernel is
JIT-compiled at import via torch.utils.cpp_extension, and the patch
hardcodes the /usr/bin/gcc-15 fallback that a CUDA bump must raise in
lockstep with this slot. cuda_gccdir cannot resolve it because JIT runs
on the user's machine at import, not at build time. 0.2.2 already
carried this note; add it to 0.2.3 and 0.2.5 so the coupling is not
silently lost on the newer ebuilds.

commit cdb3fa8d6d1cf11f0aa389279980e10915f278da
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sun Aug 16 11:18:49 2026 +0200

dev-python/xgrammar: document the gcc-slot coupling to the cuda host-compiler patch

The cuda? sys-devel/gcc:15 runtime slot and the /usr/bin/gcc-15 fallback in the cuda-
host-compiler patch must move together, but nothing said so, so a future CUDA bump
could raise the slot and leave the patch pointing at a gcc the new nvcc rejects.
Spell out the coupling and why cuda_gccdir cannot replace the fallback (the kernel
JIT-compiles on the user's machine at import, where the eclass helper is
unavailable).

commit fa565fb83641c9f04b3ea32f5a195a4dc5363057
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sun Aug 16 02:34:34 2026 +0200

dev-python/xgrammar: fix CUDA 13 runtime JIT

The CUDA bitmask backend JIT-compiles through PyTorch and otherwise inherits an
active compiler that CUDA 13 may reject. Declare the runtime CUDA toolchain and
translate the CUDA compiler overrides to the variables PyTorch actually consumes,
with the supported GCC slot as the default.

commit 1c31752e56402b2facb2b5bce4d731acb450e32b
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Fri Aug 14 10:25:40 2026 +0200

dev-python/xgrammar: enforce build backend floor

Upstream 0.2.5 requires scikit-build-core 0.10 or newer. The backend dependency
generated by distutils-r1 is unversioned, so add the source-declared floor
explicitly.

commit bf3ceef692d54e0c8e54b5bc5660b8a0d58d0b96
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Thu Aug 13 19:19:25 2026 +0200

dev-python/xgrammar: drop 0.1.33

The retained 0.1.34 release preserves the previous minor line without carrying this
superseded version.

commit 6ba5970a319837e8c0c561e5b26e02fbf310dbff
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Thu Aug 13 18:37:37 2026 +0200

dev-python/xgrammar: require compatible apache-tvm-ffi

The packaged-library lookup passes extra_lib_paths to load_lib_module. That keyword
was added in apache-tvm-ffi 0.1.11, so older permitted versions fail while importing
xgrammar.

commit 748ff7824d873f5ed8d40c51d1c7d4178d433489
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Mon Aug 3 23:05:54 2026 +0200

dev-python/xgrammar: add 0.2.2

Add the newest release compatible with transformers 5 and the vLLM 0.25/0.26
FFI sets. Mirror upstream's FFI floor so reverse consumers select their exact
coordinated runtime version.

commit 16e8544f84929ffcbcc3653935df79b2ac0f14d6
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Mon Aug 3 20:00:27 2026 +0200

dev-python/xgrammar: fix dependencies and FFI loading in 0.2.5

Load the binding from xgrammar itself, declare Triton and bundled picojson, and
require the TVM-FFI loader API used by the patch. Drop stale nanobind and sandbox
workarounds, respect toolchain flags, and enable offline tests.

commit cf7b01a870d928d0a8d18abcae928a8b7b7ec16c
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Mon Aug 3 19:45:54 2026 +0200

dev-python/xgrammar: fix dependencies and FFI loading in 0.2.3

Use TVM-FFI 0.1.11 library-path support to load the binding from xgrammar itself
instead of writing into tvm_ffi. Declare Triton and picojson, drop stale nanobind and
sandbox workarounds, respect toolchain flags, and enable offline tests.

commit 408830272a1243a12237d5b8c6642545d5d3c0b8
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Mon Aug 3 19:39:07 2026 +0200

dev-python/xgrammar: fix runtime deps and flags in 0.1.33

Declare Triton for the default GPU masking path and the bundled picojson license. Let
the Gentoo toolchain control optimization and LTO, and run the offline upstream test
subset.

commit 1b5f1baf79ab145b9aae28aebaedb158c50de7bb
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Fri Jul 24 11:42:13 2026 +0200

dev-python/xgrammar: drop 0.2.1, 0.2.2

commit f9b69ba6390de013c75fa8be5d41f29a9ad1f698
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Fri Jul 24 11:20:24 2026 +0200

dev-python/xgrammar: add 0.2.5

Upstream stopped publishing PyPI sdists at 0.2.4 (0.2.4 and 0.2.5 are
wheels-only), so switch SRC_URI from pypi_sdist_url to the GitHub release
tag and stage the dlpack git submodule (headers on XGRAMMAR_INCLUDE_PATH,
installed by the top-level CMakeLists) separately, since GitHub's archive
omits submodule contents. googletest and cpptrace stay unbuilt with our
options (XGRAMMAR_BUILD_CXX_TESTS / XGRAMMAR_ENABLE_CPPTRACE default OFF)
and picojson is vendored in-tree, so only dlpack needs staging.

Also add the transformers<5 cap the 0.2.5 pyproject declares (v5 breaks
tokenizer loading in TokenizerInfo.from_huggingface); 0.2.3 predated it.

commit 401e4935b892117921886e3ae834f637a9fdf880
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sat Jun 27 08:12:09 2026 +0200

dev-python/xgrammar: add 0.2.3

commit b8450a53362c4a32ebae4e421507fcf3979d5684
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Fri Jun 12 11:02:02 2026 +0200

dev-python/xgrammar: add 0.2.2

0.2.2 imports tvm_ffi at build time (cpp/tvm_ffi/CMakeLists.txt runs
find_package(tvm_ffi)), so add apache-tvm-ffi to BDEPEND. That import
also probes accelerator device nodes; addpredict /dev/kfd and /dev/accel
in python_compile so the sandboxed build does not abort.

commit 429bc05682cae092a171601c1106e2831f51b76b
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sat Jun 6 21:49:16 2026 +0200

dev-python/xgrammar: drop 0.2.0

commit f917a48f6c850849842f916c50b6c503735f2f80
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Tue May 19 19:07:09 2026 +0200

dev-python/xgrammar: add 0.2.1

Keep 0.2.0 alongside: vllm 0.21.0 pins xgrammar <1.0.0 and is still
the current installed ebuild; 0.2.1 is the current upstream release.

commit bf2a12a29f11cff35a2cea7c505a7e3e4353eb49
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sun May 17 00:52:23 2026 +0200

dev-python/xgrammar: symlink bindings into tvm_ffi/lib

xgrammar/load_binding.py calls tvm_ffi's load_lib_module() without
passing extra_lib_paths, so tvm_ffi searches only its own lib/ dirs
and a few PATH entries — none of which include xgrammar's
site-packages dir where the .so lives. Any consumer (e.g. vllm)
dies at xgrammar module init with "Cannot find library
libxgrammar_bindings.so".

Upstream's wheel apparently works by accident — tvm_ffi's wheel
layout differs from a normal site-packages install. Add a
python_install_all hook that creates a symlink at
${tvm_ffi}/lib/libxgrammar_bindings.so pointing at xgrammar's own
.so. Symlink is owned by this package's CONTENTS.

Workaround, not proper fix. Upstream-able fix is patching
xgrammar's load_binding.py to pass extra_lib_paths=[Path(__file__).
parent]. Switch when there's appetite for a maintained patch.

commit 85c23d2b00165f6205bd6e1348771e94e22746c9
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Wed May 13 14:35:39 2026 +0200

dev-python/xgrammar: disable py3.11

commit 15c140112432480f86acb1580b8b8c922c742347
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sun May 10 18:41:05 2026 +0200

dev-python/xgrammar: switch to DISTUTILS_SINGLE_IMPL

sci-ml/{pytorch,transformers} are SINGLE_IMPL; multi-impl consumer with
bare $ on them produces python_targets_python3_*(-)?
that the single-impl children can't expose. Both versions converted in
one pass.

commit 0a29dd42d85f2fa63bb3ddf5fd6f283cc4bdf98d
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Sun May 10 15:19:02 2026 +0200

dev-python/xgrammar: add 0.2.0

Upstream's `0.1.34+` line gained a hard dep on apache-tvm-ffi (TVM's
FFI shim). The previous 0.1.33 ebuild's stay-pin comment is now
obsolete: apache-tvm-ffi-0.1.11 lands in this overlay, so 0.2.0
solves on the consumer side (vllm pins >=0.1.32, <1.0.0; 0.2.0 fits).

Build-check skipped: xgrammar's CMake configure does
find_package(tvm_ffi) which requires apache-tvm-ffi already merged on
the host (its wheel installs the cmake config at
/usr/lib/python*/site-packages/tvm_ffi/share/cmake/tvm_ffi/). pkgcheck
passes; trust upstream metadata pending end-to-end pre-push validation.

Upstream also lists `triton` as a runtime dep on Linux x86_64, but
neither this overlay nor ::gentoo packages dev-python/triton, and the
xgrammar grammar-matching paths vllm exercises don't require it. Note
left inline; revisit if/when triton is packaged.

commit 74ffa9342744a2eafa46bdbfd553dbc2c58ef669
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Thu May 7 01:03:47 2026 +0200

dev-python/xgrammar: new package

MLC's structured-generation engine for LLMs (CMake/scikit-build-core
+ nanobind C++ extension). Required by dev-python/vllm at
>=0.1.32, <1.0.0.

Pinned to 0.1.33 because 0.1.34+ added a hard runtime dep on
apache-tvm-ffi which isn't packaged. nanobind pin (==2.5.0 upstream)
relaxed to >=2.5.0; built clean against ::gentoo's 2.12.0.

NonsolvableDepsInStable is policy noise — pytorch and transformers are
~amd64 only too.