skillfed

treelite-runtime

Treelite runtime

treelite-runtime v3.9.1 165.2K downloads/30d#10,529 on PyPI828
Permissive license Apache-2.0 Active released

What it is and what it does

Treelite-runtime is a Python wrapper around a C++ runtime for executing decision tree forest models. It loads pre-compiled tree models serialized in Treelite's universal format and performs inference on new data. The package is designed to be lightweight and fast, relying on numpy and scipy for numerical operations.

The runtime does not train or compile models—it only executes them. Users must first export a tree model to Treelite's serialized format using the main Treelite library, then load and run predictions with this runtime package. It is primarily useful for production inference pipelines where model serving speed and portability across platforms matter.

Use it for:

  • Serving tree-based models in production with low-latency inference requirements.
  • Deploying models across heterogeneous platforms (Linux, macOS, Windows) using a single serialized format.
  • Embedding fast tree inference in Python applications without retraining or recompiling models.
  • Benchmarking or comparing inference performance of tree models across different runtime implementations.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Treelite-runtime provides a Python runtime for loading and executing decision tree forest models that have been serialized in the Treelite format, enabling fast inference on tree-based models.

Yes, if you have a pre-compiled Treelite model and need fast, portable inference in Python. The package is stable, permissively licensed, and actively maintained. Install friction is moderate due to platform-specific wheels, but that is handled transparently by pip. Not useful without an existing Treelite model file.

Install

treelite-runtime on PyPI

pip

pip install treelite-runtime

uv

uv add treelite-runtime

poetry

poetry add treelite-runtime

Installing treelite-runtime

Before you install

Medium install friction due to platform-specific wheels across macOS, Linux, and Windows. Active maintenance with last commit on 2026-08-12 and production-stable status; latest release was 2023-09-13, indicating a mature package with stable API.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

pip install treelite-runtime
import treelite_runtime
predictor = treelite_runtime.Predictor('model.so')
predictions = predictor.predict(data)

Requires a pre-compiled Treelite model file (.so on Linux/macOS, .dll on Windows); the runtime does not compile or train models, only executes them.

Verify before relying

  • Whether the package works with current versions of numpy and scipy beyond the stated Python 3.7–3.8 classifier support.
  • Performance characteristics and typical inference latency compared to other tree runtime formats.
  • Whether model files from older Treelite versions remain compatible with runtime 3.9.1.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.7)
Install friction medium — platform-specific wheel
Runtime dependencies 2 — numpy, scipy
Maintenance actively maintained — 1,066 days since the last release
Last repo commit
First released
Downloads 165,158/month — #10,529 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: treelite_runtime-3.9.1-py3-none-macosx_10_15_x86_64.macosx_11_0_x86_64.macosx_12_0_x86_64.whl; treelite_runtime-3.9.1-py3-none-macosx_12_0_arm64.whl; treelite_runtime-3.9.1-py3-none-manylinux2014_x86_64.whl; treelite_runtime-3.9.1-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.7Programming Language :: Python :: 3.8

Tags

decision tree model inferencetree forest runtimemodel serialization formatfast tree predictiontreelite model execution
model-inferencetree-ensembleproduction-ml

More Artificial Intelligence packages