--- id: treelite version: "4.7.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # treelite — Treelite: Universal model exchange format for decision tree forests License: permissive · Maintenance: active · Downloads: 675.0K/mo ## 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 above — 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 pip install treelite uv add treelite 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_current - Install friction: medium - Maintenance: active - Downloads: 675.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags decision tree model serialization, tree forest exchange format, model persistence for tree ensembles, cross-platform tree model storage, decision tree model interchange, model-serialization, tree-forests, interoperability [View on SkillFed](https://skillfed.io/packages/treelite) · [View on PyPI](https://pypi.org/project/treelite/)