OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Infrastructure & Serving

Lleaves

Lleaves is a Python library that uses LLVM to compile trained LightGBM decision-tree models into optimized machine code for prediction. Its interface is a subset of LightGBM.Booster, and it supports both low-latency single-row and high-throughput batch inference.

Independent OpenViST project profile, based on linked sources.

Lleaves — Inference acceleration for trained LightGBM decision trees
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Lleaves when an existing trained LightGBM tree model needs a compiled prediction path, especially when single-row latency, batch throughput or native binary integration matters.

Who it is for

  • Machine-learning engineers running trained LightGBM models in prediction-heavy workloads.
  • Python developers seeking compiled inference for single predictions or batches.
  • Developers integrating generated model binaries with native callers such as C benchmarks.

Documented uses

  • Compile a saved LightGBM model for prediction.
  • Run single-row or batch predictions with the compiled model.
  • Cache generated native binaries to avoid repeating compilation.
  • Link generated model binaries from native code to avoid Python inference overhead.
Before you choose

Requirements & limits

The README documents installation with pip or uv on Linux and macOS. The repository specifies an MIT license.

  • Lleaves depends on llvmlite and numpy; LLVM is statically linked.
  • The lleaves.Model interface is a subset of LightGBM.Booster, rather than a claim of full interface equivalence.
  • Caching stores ELF binaries on Linux and Mach-O binaries on macOS.
  • Generated binaries can be linked from native callers, but the function signature may change between major versions.
  • Published benchmark results use specified datasets and an Intel i7-4770 Haswell; measured performance may differ for other workloads and hardware.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Compile a trained LightGBM model

Create an optimized machine-code model from a saved LightGBM model file.

Before you start

  • A trained LightGBM model saved to a model file.
  • Python on Linux or macOS.
  • Lleaves, with llvmlite and numpy dependencies.

Steps

  1. Install lleaves with the command below or the command below.

    Documented command
    pip install lleaves
    Documented command
    uv add lleaves
  2. Load the saved model with lleaves.Model(model_file=...).

  3. Call compile() on the model.

Expected outcome

A compiled model that can be used for prediction through lleaves.

Guide limitations

  • Installation is documented for Linux and macOS.
  • The documented example does not specify model-format or feature compatibility beyond trained LightGBM models.
Source-based practical guide

Cache a compiled model binary

Reuse a generated native binary on subsequent compilation calls.

Before you start

  • A trained LightGBM model and lleaves installed on Linux or macOS.
  • A filepath for the generated binary.

Steps

  1. Create a lleaves.Model for the trained model.

  2. Call compile(cache=) using the chosen filepath.

  3. On a later call, use compile(cache=) to load the stored binary instead of compiling again.

Expected outcome

The first call stores an ELF file on Linux or a Mach-O file on macOS; later calls using the same filepath skip compilation and load that binary.

Guide limitations

  • The documented cache behavior is tied to the same filepath.
  • The project notes that the generated-binary function signature may change between major versions.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
12 November 2026
Original website title
siboehm/lleaves · Official homepage title · retained in its source language