Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Fast inference for LightGBM, XGBoost and CatBoost models, with predictions bit-identical to the library that trained them.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗pip install pylignum
import lignum
model = lignum.load("model.txt") # LightGBM, XGBoost or CatBoost file, detected from its content
preds = model.predict(X) # numpy, pandas, pyarrow, polars or a plain list
# == booster.predict(X), bit for bit
Installed as pylignum, imported as lignum. Wheels for Linux (x86_64, aarch64), macOS 15+
(arm64, x86_64) and Windows (x64); Python 3.10+.
predict bit for bit: NaN and
zero-as-missing, categorical splits, XGBoost's float32 arithmetic and CatBoost's CTRs included.
Named columns (pandas, Arrow) are checked against the model's feature names, so a reordered
DataFrame raises instead of predicting wrong. What the data scientist saw in the notebook is what
production returns.model.compile());
model.autotune(X) picks the faster one per batch size. One row of a 500-tree model takes
10-30 µs on one x86 core, 6-21 µs on an Apple M4.model.save("model.bin") writes a file that loads by memory mapping in under
a millisecond.predict reads pyarrow, polars and any Arrow PyCapsule object without copies; a
C API (include/lignum/c_api.h) serves other languages.The same models everywhere (500 rounds, 63 leaves; CatBoost depth 6), a different row on every call, AMD EPYC-Milan (Hetzner CCX33, 8 vCPU). LightGBM models, 1,000,000 rows on all threads and one row on one thread (median / p99):
| lignum | lleaves | TL2cgen | LightGBM | |
|---|---|---|---|---|
| California, 1M rows | 0.32 s | 0.48 s | 1.96 s | 3.56 s |
| Covertype, 1M rows | 1.57 s | 2.20 s | 34.5 s | 37.4 s |
| Diabetes, 1M rows | 0.75 s | 4.23 s | 31.9 s | 9.33 s |
| California, 1 row | 11.0 / 23.7 µs | 24.6 / 56.4 µs | 49.2 / 87.8 µs | 57.7 / 92.9 µs |
| Diabetes, 1 row | 13.3 / 34.2 µs | 77.6 / 118 µs | 280 / 365 µs | 82.5 / 121 µs |
| Covertype, compile | 22 s | 503 s | 70 s | — |
| Bit-identical | yes | no | yes | — |
Covertype has 7 classes (3,500 trees), Diabetes 130-US categorical features with hundreds of
values. lignum: the compiled mode for a million rows; for one row the faster of its two modes (the
interpreter on California, the compiled trees on Diabetes), which model.autotune(X) picks for you.
The interpreter needs no compiling and loads Covertype in 0.1 s. lleaves differs from LightGBM on
55-100% of the rows.
XGBoost models: 4-8x faster than XGBoost on a million rows and 5-15x on single rows (TL2cgen cannot load XGBoost 3 models trained on pandas categories, and is not bit-identical on the others). CatBoost models, from a pandas DataFrame: 1.2-3x faster on a million rows on one thread (2.3-2.7x on an Apple M4) and 8-27x on single rows (216x with high-cardinality categories).
lignum is not the fastest everywhere: on an Apple M4 lleaves predicts one Covertype row in 38 µs against lignum's 43 µs, and on x86 the compiled mode's p99 on single rows is worse than the interpreter's. All results: every data set, Apple M4, Arrow input, compile times, the methodology and how to reproduce them.
| Library | Files | Notes |
|---|---|---|
| LightGBM | model.txt, JSON | numeric and categorical splits, multiclass; not linear trees or random forests |
| XGBoost | JSON, UBJSON | float32 semantics, categorical splits, multiclass, DART; not multi-target models, gblinear or DART with dropped trees |
| CatBoost | .cbm, JSON | symmetric trees, one-hot and CTR categories, multiclass, Poisson / Tweedie; not Depthwise / Lossguide trees or text features |
Unsupported models are rejected at load time with a message that says why, never predicted wrongly.
misterekkk.github.io/lignum: getting started, model formats, CatBoost, the compiled mode, Arrow input, the C API, how exactness is guaranteed, and the Python reference. Release notes are in CHANGELOG.md.
lignum is young. If you use it, in production, research or a side project, please add yourself to ADOPTERS.md or tell us in an issue: it helps others decide and shapes what comes next.
Bug reports, models that lignum predicts differently from their library, and benchmark results from your hardware are all welcome. CONTRIBUTING.md explains the setup and the rules every change keeps (bit-exactness, measured performance, tests on three platforms); ARCHITECTURE.md describes the engine. Security problems: see SECURITY.md.
make venv && make py-build && make test # C++ (GoogleTest) + Python parity tests
lignum parses JSON models and numbers with simdjson.
Apache License 2.0. Versions up to 0.2.0 were released under the MIT License. If you use lignum in research, CITATION.cff has the citation.