treelite
Treelite: Universal model exchange format for decision tree forests
What it is and what it does
Treelite is a model exchange and serialization library designed to store and transmit decision tree forests in a standardized format. It acts as a bridge for C++ applications and other tools to work with trained tree models without reimplementing the forest logic. The package depends on numpy, scipy, and packaging, and supports Python 3.8 through 3.10 across macOS, Linux, and Windows.
The library is intended for scenarios where you need to persist tree models to disk, share them across systems, or integrate them into C++ pipelines. It provides a universal format that decouples model storage from the training framework, making it useful in production environments where model portability and interoperability matter.
Use it for:
- Serialize trained tree ensemble models from Python for deployment in C++ production systems.
- Exchange decision tree forests between different machine learning frameworks or applications.
- Store trained tree models in a portable format for long-term archival or version control.
- Integrate pre-trained tree models into C++ services without re-training or format conversion.
- Enable cross-platform model sharing in teams using heterogeneous development environments.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Treelite serializes and exchanges decision tree forest models in a universal format, enabling C++ applications and other tools to store and transmit trained tree models efficiently.
Yes, if you need to serialize tree models for C++ integration or cross-platform exchange. The package is actively maintained, has no known vulnerabilities, and carries a permissive license. Install friction is moderate due to compiled wheels, but pre-built binaries exist for common platforms. Not necessary if your workflow stays within a single Python framework.
Install
treelite on PyPI
pip
pip install treeliteuv
uv add treelitepoetry
poetry add treeliteInstalling treelite
Before you install
Medium install friction due to compiled wheels for multiple platforms (macOS, Linux, Windows). Active maintenance with a recent release (161 days ago) and steady repository activity.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects.
Quickstart
pip install treelite
import treelite
# Load or create a tree model and serialize it
model = treelite.Model.load('model.txt')
model.export_lib('output')
Requires Python 3.8 or later; compiled wheels available for common platforms but may require compilation on unsupported architectures.
Verify before relying
- Whether the package provides Python APIs for programmatic tree construction or only serialization/loading of externally-trained models.
- Performance characteristics and typical use patterns for large-scale model interchange.
- Compatibility with specific tree training frameworks (XGBoost, LightGBM, etc.) beyond generic forest formats.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 3 — numpy, packaging, scipy |
| Maintenance | actively maintained — 161 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 674,951/month — #5,386 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: treelite-4.7.0-py3-none-macosx_10_15_x86_64.macosx_11_0_x86_64.macosx_12_0_x86_64.whl; treelite-4.7.0-py3-none-macosx_12_0_arm64.whl; treelite-4.7.0-py3-none-manylinux2014_aarch64.whl; treelite-4.7.0-py3-none-manylinux2014_x86_64.whl; treelite-4.7.0-py3-none-win_amd64.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
interchangeInterchange provides data types and interchange…
permissive · top 15,000 on PyPI
treelite-runtimeTreelite-runtime provides a Python runtime for…
permissive · top 15,000 on PyPI
ydfYDF trains, evaluates, and interprets decision…
permissive · top 15,000 on PyPI
tensorflow-decision-forestsTrains and deploys decision forest models…
permissive · top 15,000 on PyPI
dtreevizdtreeviz renders decision trees from…
permissive · top 15,000 on PyPI
treeinterpreterDecomposes scikit-learn decision tree and…
permissive · top 15,000 on PyPI
py_treespy_trees implements behaviour trees in Python,…
permissive · top 15,000 on PyPI
coremltoolsConverts trained machine learning models from…
permissive · top 5,000 on PyPI
sklearn2pmmlConverts fitted Scikit-Learn pipelines to PMML…
agpl · top 15,000 on PyPI
skope-rulesSkope-rules learns interpretable logical rules…
permissive · top 15,000 on PyPI