skillfed

treelite

Treelite: Universal model exchange format for decision tree forests

treelite v4.7.0 675.0K downloads/30d#5,386 on PyPI828
Permissive license Apache-2.0 Active released

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 treelite

uv

uv add treelite

poetry

poetry add treelite

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

decision tree model serializationtree forest exchange formatmodel persistence for tree ensemblescross-platform tree model storagedecision tree model interchange
model-serializationtree-forestsinteroperability

More Artificial Intelligence packages