Back to browse
GitHub Repository

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

1 starsPython

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

by alxhslm·Jul 6, 2026·3 points·0 comments

AI Analysis

●●SolidSolve My ProblemBig Brain

Human-readable JSON config beats skops' opaque binary blobs for model versioning.

Strengths
  • Separates hyperparameters from weights so models become diffable config files.
  • Safetensors format eliminates pickle's arbitrary code execution vulnerability.
  • Supports Pipelines, LightGBM, XGBoost, and most common sklearn estimators.
Weaknesses
  • skops already solves the security problem for most sklearn users.
  • Niche tool—only matters if you're versioning models in Git repositories.
Category
Target Audience

ML engineers deploying sklearn models in production

Similar To

skops · joblib · MLflow

Post Description

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`

Similar Projects

Hardware●●Solid

Network-Attached Serial Mouse

Serial mouse over telnet because someone asked 'what if' and actually built it.

Rabbit HoleNiche Gem
nticompass
2011d ago
Developer Tools●●Solid

BustAPI Back

Python syntax on Rust Actix core reaches 20k RPS, but Mojo and uv already address Python speed.

WizardryBig Brain
ZOROX
204mo ago
Developer Tools●●Solid

An Embeddable SQLite Parser

424k statements/sec with zero dependencies — sqlparse can't match this performance.

WizardryNiche Gem
marcobambini
103mo ago