Skip to main content

CLI Reference

All Timber commands and their options.

timber load <model_path>

Compile and cache a model locally.

timber load model.json
timber load model.json --name fraud-detector
timber load pipeline.pkl --format sklearn
OptionDefaultDescription
--name NAMEFilename stemName to register the model as
--format FMTAuto-detectForce input format: xgboost, lightgbm, sklearn, catboost, onnx

What it does:

  1. Auto-detects (or uses forced) format
  2. Parses model into Timber IR
  3. Runs 6 optimization passes
  4. Emits C99 source code
  5. Compiles a native shared library (.so / .dylib)
  6. Caches everything in ~/.timber/models/<name>/

timber serve <name>

Serve a loaded model over HTTP.

timber serve my-model
timber serve my-model --port 8080
timber serve my-model --host 127.0.0.1 --port 9000
OptionDefaultDescription
--host HOST0.0.0.0Bind address
--port PORT11434Bind port

The server exposes:

  • POST /api/predict — run inference
  • POST /api/generate — alias for predict (Ollama compat)
  • GET /api/models — list loaded models
  • GET /api/model/:name — model metadata
  • GET /api/health — health check

timber list

List all cached models in a table.

timber list

Output:

NAME            TREES  FEATURES  FRAMEWORK  SIZE
breast-cancer 50 30 xgboost 58.0 KB
fraud-detector 100 45 lightgbm 112.3 KB

timber remove <name>

Remove a cached model and all its artifacts.

timber remove my-model

timber compile

Compile a model to C99 source without caching in the store.

timber compile --model model.json --out ./dist/
timber compile --model model.json --target targets/x86_64_avx2.toml --out ./dist/
timber compile --model model.json --calibration-data train.csv --out ./dist/
OptionDefaultDescription
--model PATHRequiredModel artifact path
--format FMTAuto-detectInput format hint
--target PATHx86_64_genericTarget spec TOML file
--out DIR./distOutput directory
--calibration-data PATHNoneCSV for branch sorting pass

timber inspect <model_path>

Print model summary without compiling.

timber inspect model.json

timber validate

Validate compiled output against reference predictions.

timber validate --artifact ./dist/ --reference model.json --data test.csv
OptionDefaultDescription
--artifact DIRRequiredCompiled artifact directory
--reference PATHRequiredOriginal model file
--data PATHRequiredValidation CSV
--tolerance FLOAT1e-5Max allowed absolute error

timber bench

Benchmark inference performance.

timber bench --artifact ./dist/ --data test.csv --batch-sizes 1,10,100,1000

Environment Variables

VariableDefaultDescription
TIMBER_HOME~/.timberModel store root directory
CCgccC compiler to use for compilation