Repository

carbon-re/skeights

skeights

Serialize fitted scikit-learn models to safetensors + JSON. No pickle.

4stars

Open github.com

carbon-re/skeights

skeights

Serializes fitted scikit-learn models to safetensors and JSON without using pickle.

Visit project

Show me a random project

First shared
Jul 6, 2026
HN activity
30

Show HN@alxhslmJul 6, 2026

Show HN: Skeights – Serialize sklearn models to safetensors and JSON, no pickle

We use sklearn in production for time series forecasting in industrial settings. Pickle was causing us constant pain: refactoring our wrapper classes invalidated saved models, and the binary blobs were completely opaque. We built skeights to decompose a fitted estimator into two files. A JSON file for hyperparameters and structure, and a safetensors file for the numeric arrays. The JSON is human-readable and diffable, and safetensors is a well-established safe format from Hugging Face. This allows you to trade models as config. The JSON is just data you can inspect, diff, and version alongside the rest of your config, rather than a binary artefact on the side. It supports most common sklearn estimators (linear models, trees, random forests, gradient boosting, MLPs, pipelines), plus LightGBM and XGBoost. MIT licensed. Blog post with a worked example: https://alxhslm.github.io/projects/skeights/ Repo: https://github.com/carbon-re/skeights `pip install skeights`

Community

Hacker News discussion

Loading the thread…