Skip to main content

Timber

Ollama for classical ML models. Compile XGBoost, LightGBM, scikit-learn, CatBoost & ONNX models into native C99 inference code. One command to load, one command to serve.

Get Started →GitHub ★
336×Faster P50 Latency
533×Higher Throughput
91µsHTTP Inference
48KBCompiled Artifact
5Frameworks

Three commands. Native speed.

Timber compiles your trained model to optimized C99, caches the shared library locally, and serves it over an Ollama-compatible REST API. Python never touches the inference hot path.

Terminal
# Install
pip install timber-compiler

# Load & compile a model
timber load model.json --name fraud-detector

# Serve it
timber serve fraud-detector

# Query it
curl http://localhost:11434/api/predict \
-d '{"model": "fraud-detector", "inputs": [[1.0, 2.0, ...]]}'

Why Timber?

5 Framework Parsers

XGBoost, LightGBM, scikit-learn, CatBoost, and ONNX. Auto-detected from file extension and content.

6 Optimizer Passes

Dead leaf elimination, constant folding, threshold quantization, branch sorting, pipeline fusion, vectorization analysis.

3 Code Backends

C99 for servers & embedded, WebAssembly for browsers & edge, MISRA-C for safety-critical (automotive, medical).

Ollama-Style Serving

timber load → timber serve. REST API on port 11434. Same developer experience as Ollama, but for classical ML.

Zero Dependencies

Generated code needs only a C99 compiler. No runtime libraries, no dynamic allocation, no recursion. Thread-safe by design.

Audit Trails

Every compilation produces a deterministic JSON audit report with SHA-256 hashes, pass logs, and timing. Built for regulated industries.

How It Works

Timber treats your trained model as a program specification and compiles it through a classical compiler pipeline.

Model Artifact→ Parse →Timber IR→ Optimize (6 passes) →Optimized IR→ Emit →C99 / WASM→ Compile →.so / .dylib→ Serve →HTTP API
Read the Docs →