lignum
Fast inference for LightGBM, XGBoost and CatBoost models, with predictions that are bit-identical to the library that trained them.
pip install pylignum
import lignum
model = lignum.load("model.txt") # LightGBM, XGBoost or CatBoost file, detected from its content
preds = model.predict(X) # numpy, pandas, pyarrow, polars or a plain list
The package is installed as pylignum and imported as lignum.
What it does
-
Exact. Raw scores and probabilities equal the library's
predictbit for bit: NaN and zero-as-missing, categorical splits, XGBoost's float32 arithmetic and CatBoost's CTRs included. Named columns (pandas, Arrow) are checked against the model's feature names, so a reordered DataFrame raises instead of predicting wrong. -
Fast to predict. A cache-friendly interpreter for any batch size, and an optional compiled mode that turns LightGBM and XGBoost trees into native code with the system C compiler in a few seconds:
model.compile(library="model.so") # once, where a compiler is available model = lignum.load("model.bin", compiled="model.so") # production: no compiler needed
model.autotune(X_sample)measures both on your data and uses each where it is faster. -
CatBoost with categorical features. One-hot, CTRs and combinations of categories; categories come as strings or integers from pandas, numpy object arrays, lists, pyarrow or polars. 1.2-3x faster than CatBoost on batches and 7-27x on single rows.
-
Fast to start.
model.save("model.bin")writes a binary file that loads by memory mapping in well under a millisecond. -
Arrow input without copies.
predictreads pyarrow tables and batches, polars data frames and any object with the Arrow PyCapsule interface directly; dictionary columns are categories. -
C API for services in other languages, with Arrow input as well.
Supported models
- LightGBM:
model.txtand JSON; numeric and categorical splits, multiclass. - XGBoost: JSON and UBJSON; float32 semantics, categorical splits, multiclass.
- CatBoost:
.cbmand JSON; symmetric trees, one-hot and CTR categories, multiclass, Poisson and Tweedie.
Models lignum cannot predict exactly (LightGBM linear trees and random forests, XGBoost multi-target models, linear boosters and DART models that dropped trees, CatBoost non-symmetric trees and text features, objectives whose output transform lignum does not know) are rejected at load time.
Requirements
Python 3.10 or newer, numpy. Wheels are available for Linux (x86_64, aarch64), macOS 15+ (arm64, x86_64) and Windows (x64); other platforms build from source with a C++20 compiler. The compiled mode needs a C compiler at compile time only (cc on Linux and macOS; Visual Studio, MinGW gcc or clang on Windows).
Links
- Documentation: https://misterekkk.github.io/lignum/
- Benchmarks: https://misterekkk.github.io/lignum/benchmarks/
- Release notes: https://github.com/misterekkk/lignum/blob/main/CHANGELOG.md
- Source and issues: https://github.com/misterekkk/lignum
Licensed under the Apache License 2.0 (versions up to 0.2.0: MIT).
Metadata
Release files for pylignum 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pylignum-0.4.2.tar.gz | 2.1 MB | With provenance | Details for pylignum-0.4.2.tar.gz |
Built distributions (wheels)
Total release size: 17.3 MB
Release files / pylignum-0.4.2.tar.gz
| Download URL | pylignum-0.4.2.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52ca2f6abf87a689cc75e7dcb94cffd538c14ccdcd3db95b2dd9fc6cdd7d98d9
|
|
BLAKE2b-256 checksum How to use checksums |
bdfec4765066a71176c9107c024c3c19fae5d59cedaa9c4aed7f89b2c5842e14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp312-abi3-win_amd64.whl
| Download URL | pylignum-0.4.2-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 900.0 kB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e00a0b52a972e70ef0d0fcd14aa8c0dc9bc4fe89ae715bc079b267385727731e
|
|
BLAKE2b-256 checksum How to use checksums |
ebb64a64c8cc60375cce9bc647606fe86c48126cf22ff64ee35fe4110d02909b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pylignum-0.4.2-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ce958a92c57fb996406a8e1d18adae5a918a62594df596e3dfb0445c3105e7d7
|
|
BLAKE2b-256 checksum How to use checksums |
fb0c09cf2ab1f43470e55dc2839a44c0e0605620bbe0c70e77193b175d2bb3ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pylignum-0.4.2-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
be21bc4e0fd816959891679274ac52aa19b8c8855b3c87856be1cd1dd693f847
|
|
BLAKE2b-256 checksum How to use checksums |
11b5afa5ca34bd9dc80014967826d609bbd451368aca24ec072fa1008da95e06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp312-abi3-macosx_15_0_x86_64.whl
| Download URL | pylignum-0.4.2-cp312-abi3-macosx_15_0_x86_64.whl |
|---|---|
| Size | 959.1 kB |
| Tags | CPython 3.12 abi3 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
7694847b06d759ea1f17a356b956a094d068f9e1b709f3956ce33b30d24f326c
|
|
BLAKE2b-256 checksum How to use checksums |
d44776379e9a622be8b4a41257670067fb1c363b4c6675df89670a60456d925c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp312-abi3-macosx_15_0_arm64.whl
| Download URL | pylignum-0.4.2-cp312-abi3-macosx_15_0_arm64.whl |
|---|---|
| Size | 714.2 kB |
| Tags | CPython 3.12 abi3 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
70d55f9f52fbc4d3482f8679b5dc2201df92d893823e643311d454886fd53c59
|
|
BLAKE2b-256 checksum How to use checksums |
abb5aaee9f863b071b72fbf094d73db45c175a9d01e315b9968db23d455b1e94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp311-cp311-win_amd64.whl
| Download URL | pylignum-0.4.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 900.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cc576ec3066778608381ed0a8187562e3d7e798834a7fddb6c1fa0f7ca452a03
|
|
BLAKE2b-256 checksum How to use checksums |
dee726b9ee18ff55126e90dacd9602b1f819145ed2cf00a560c57cd1ceb3877f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pylignum-0.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8eae120ca218e3c15a88b80d1916fa4d6c73ae60fbbed201fe0e309bb4b6d40b
|
|
BLAKE2b-256 checksum How to use checksums |
25f355c87b8b14fc23d85506c570a52801f05408e15026c9e26e37cd7975fc86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pylignum-0.4.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
decfea355f811d07c02fd008d74a1e055ad083b07ad2dc4aff3214a139e5c70e
|
|
BLAKE2b-256 checksum How to use checksums |
d525c2f6a2463860f4da2e9b5a8bd8b3c1e270c243be5debca98f01b7c90fcb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp311-cp311-macosx_15_0_x86_64.whl
| Download URL | pylignum-0.4.2-cp311-cp311-macosx_15_0_x86_64.whl |
|---|---|
| Size | 960.5 kB |
| Tags | CPython 3.11 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
f27cb23f299241fb080fc2a37a0eb468503360d08f94ddcadc60af49b7b61598
|
|
BLAKE2b-256 checksum How to use checksums |
8ff0d1a5c4c323004d4cb393fffd1fb4ba7de601b9415ab71c8081361ba74764
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp311-cp311-macosx_15_0_arm64.whl
| Download URL | pylignum-0.4.2-cp311-cp311-macosx_15_0_arm64.whl |
|---|---|
| Size | 715.9 kB |
| Tags | CPython 3.11 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
01d28c35fc80991c5e58fec0ab3a7c971df8920aada1ef0e5e59b7eec0dec710
|
|
BLAKE2b-256 checksum How to use checksums |
11a82a7c3176ad138ff1a234663126cf1b88e2d79538439fe3d3beca435c54fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp310-cp310-win_amd64.whl
| Download URL | pylignum-0.4.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 900.2 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
976ba21ea727d8602ff1575d91b349835d2151cabba36362fc02c2411e6bf06d
|
|
BLAKE2b-256 checksum How to use checksums |
7d424aeff0f6c4e952f14ac3fd1569ce1416ec902f3de0cba17999da7d6ba301
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pylignum-0.4.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
4ec5550d28bc89d222b450283182650efaad82af35be53e197b38d5cec227c2d
|
|
BLAKE2b-256 checksum How to use checksums |
fed37b5a9fdce73231e3d7517f2fcca446052d37a82a95e3296e8786c67024fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pylignum-0.4.2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
43b5e46de557476c9e1de45363d65f01f004e60196799b6365f89cbde7877865
|
|
BLAKE2b-256 checksum How to use checksums |
f33e29d74b6b53003e1362f2892f2e12c6634357a0e1639ae7f722885be238be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp310-cp310-macosx_15_0_x86_64.whl
| Download URL | pylignum-0.4.2-cp310-cp310-macosx_15_0_x86_64.whl |
|---|---|
| Size | 961.0 kB |
| Tags | CPython 3.10 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
6ec5644ba6c356b33d932e5cc1ed9da730c222814fdb35737f7c2b439a49d7b6
|
|
BLAKE2b-256 checksum How to use checksums |
d939a10f06566f4c01024ef610b705c5ea088abc07603e2c897ae2d463b3b8fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / pylignum-0.4.2-cp310-cp310-macosx_15_0_arm64.whl
| Download URL | pylignum-0.4.2-cp310-cp310-macosx_15_0_arm64.whl |
|---|---|
| Size | 716.2 kB |
| Tags | CPython 3.10 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
688cb3b1c1803b08ea9e7d891a10de136a38a8ee644a9c43c81395f984be0d09
|
|
BLAKE2b-256 checksum How to use checksums |
d4dff9cd4c56d68109715918489d20ca73faba5f2daaefbc7194757bbeb32bea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logSecurity for pylignum 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 16 files in this release have been uploaded with provenance metadata.
Attestation for pylignum-0.4.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.