🧠 Redis Model Store

Store, version, and manage your ML models in Redis with ease. redis-model-store
provides a simple yet powerful interface for handling machine learning model artifacts in Redis.
✨ Features
- 🔄 Automatic Versioning: Track and manage multiple versions of your models
- 📦 Smart Storage: Large models are automatically sharded for optimal storage
- 🔌 Pluggable Serialization: Works with any Python object (NumPy, PyTorch, TensorFlow, etc.)
- 🏃♂️ High Performance: Efficient storage and retrieval using Redis pipelining
- 🛡️ Safe Operations: Atomic operations with automatic cleanup on failures
🚀 Quick Start
Installation
pip install redis-model-store
poetry add redis-model-store
Basic Usage
Here's a simple example using scikit-learn:
from redis import Redis
from redis_model_store import ModelStore
from sklearn.ensemble import RandomForestClassifier
redis = Redis(host="localhost", port=6379)
store = ModelStore(redis)
model = RandomForestClassifier()
model.fit(X_train, y_train)
version = store.save_model(
model,
name="my-classifier",
description="Random forest trained on dataset v1"
)
models = store.list_models()
print(f"Available models: {models}")
model = store.load_model("my-classifier")
model = store.load_model("my-classifier", version=version)
versions = store.get_all_versions("my-classifier")
for v in versions:
print(f"Version: {v.version}, Created: {v.created_at}")
🛠️ Contributing
We welcome contributions! Here's how to get started:
Development Setup
git clone https://github.com/redis-applied-ai/redis-model-store.git
cd redis-model-store
- Install poetry if you haven't:
curl -sSL https://install.python-poetry.org | python3 -
poetry install --all-extras
Linting and Tests
poetry run format
poetry run check-mypy
poetry run test
poetry run test-verbose
Making Changes
git checkout -b feat/your-feature-name
📚 Documentation
For more usage examples check out tbhis Example Notebook.