Atomic Steps for ML Pipelines, framework agnostic, modular
Project description
MLPotion: Brew Your ML Magic! ๐งชโจ
Modular Components for Machine Learning Pipelines
Provided and maintained by ๐ฆ UnicoLab
Welcome, fellow alchemist! ๐งโโ๏ธ Ready to brew some machine learning magic without getting locked in a cauldron?
MLPotion is your chest of modular, mix-and-match ML building blocks that work across Keras, TensorFlow, and PyTorch. Think of it as LEGOยฎ for ML pipelines, but with fewer foot injuries and more flexibility!
Why MLPotion? ๐ค
Ever felt trapped by a framework that forces you to do things "their way"? We've been there. That's why we created MLPotion:
- ๐ฏ Framework Agnostic: Write once, run anywhere (well, on Keras, TensorFlow, or PyTorch).
- ๐งฑ Modular by Design: Pick the pieces you need, leave the rest in the box.
- ๐ฌ Type-Safe: Python 3.10+ typing that actually helps you (mypy approved!).
- ๐ Production Ready: Built for the real world, not just notebooks.
- ๐จ Orchestration Flexible: Works standalone OR with ZenML, Prefect, Airflow - your choice!
- ๐ฆ Install What You Need: Core package works without any ML frameworks (you only install what you need)!
- ๐ค Community-Driven: Missing something? Contribute it back - we love community additions!
What's in the Potion? ๐งช
โ๏ธ Core Ingredients
- Type-safe protocols for all components
- Framework-agnostic result types
- Consistent error handling
- Zero-dependency core package
๐ง Framework Support
- Keras 3.0+ - The friendly one
- TensorFlow 2.15+ - The production workhorse
- PyTorch 2.0+ - The researcher's favorite
๐ Data Processing
- CSV loaders for all frameworks
- Dataset optimization utilities
- Data transformers
- Preprocessing pipelines
๐ Training & Evaluation
- Unified training interface
- Comprehensive evaluation tools
- Rich result objects
- Training history tracking
๐พ Model Management
- Save/load model checkpoints
- Export to production formats
- Model inspection utilities
- Multiple export formats
๐ Orchestration Integration
- ZenML integration built-in
- Extensible to Prefect, Airflow, etc.
- Works standalone (no orchestration needed!)
The MLPotion Philosophy ๐ญ
"A good potion doesn't force you to drink it a certain way. It just... works."
โ Ancient ML Alchemist Proverb (we just made that up)
We believe in:
- Flexibility > Convention: Your project, your rules
- Simplicity > Complexity: If it's hard to use, we failed
- Type Safety > Runtime Surprises: Catch errors before they bite
- Modularity > Monoliths: Use what you need, ignore the rest
- Consistency > Chaos: Same patterns across all frameworks
- Community > Corporate: Built by the community, for the community
๐ฆ Installation
Install only what you need to keep your environment clean.
Core (Base Protocols)
Perfect for defining custom implementations or lightweight usage.
poetry add mlpotion
For Framework Users
# TensorFlow / Keras
poetry add mlpotion -E tensorflow
# PyTorch
poetry add mlpotion -E pytorch
For MLOps (ZenML)
Combine your framework with ZenML capabilities.
poetry add mlpotion -E tensorflow -E zenml
# OR
poetry add mlpotion -E pytorch -E zenml
The Full Lab
poetry add mlpotion -E all
โก Quickstart
Here is a simple example of defining a training configuration and running a trainer using Keras components.
from mlpotion.frameworks.keras.training import ModelTrainer
from mlpotion.frameworks.keras.config import ModelTrainingConfig
# 1. Define your configuration ๐
# Strongly typed configs ensure you never miss a parameter
config = ModelTrainingConfig(
epochs=10,
batch_size=32,
optimizer="adam",
loss="sparse_categorical_crossentropy"
)
# 2. Initialize the Trainer ๐งช
trainer = ModelTrainer(config=config)
# 3. Run the pipeline ๐
# (Assuming 'my_model' and datasets are ready)
history = trainer.train(
model=my_model,
train_data=train_ds,
val_data=val_ds
)
print(f"โ
Training complete! Final accuracy: {history.history['accuracy'][-1]:.4f}")
ZenML User? Drop this logic directly into a pipeline step:
from mlpotion.integrations.zenml.tensorflow.steps import train_model
Feature Comparison ๐
| Feature | MLPotion | Framework-Only | All-in-One Solutions |
|---|---|---|---|
| Multi-framework | โ Yes | โ No | โ ๏ธ Limited |
| Type Safety | โ Full | โ ๏ธ Partial | โ ๏ธ Partial |
| Modular Install | โ Yes | โ No | โ No |
| ZenML Native | โ Yes | โ Manual | โ ๏ธ Adapters |
| Learning Curve | ๐ Gentle | ๐ Framework-specific | ๐ Steep |
| Production Ready | โ Yes | โ ๏ธ DIY | โ Yes |
| Flexibility | ๐๐๐๐๐ | ๐๐๐๐๐ | ๐๐ |
Who's This For? ๐ฏ
You'll love MLPotion if you:
- Switch between frameworks and hate rewriting everything
- Value heavily tested code that you can reuse
- Value type safety and IDE autocomplete (who doesn't?)
- Want production-ready code without enterprise bloat
- Believe ML pipelines should be composable and testable
You might want something else if you:
- Do not like modularity
- Do not like reusability
- Are too lazy to contribute something that you can't already find here
Community & Support ๐ค
- GitHub: Star, fork, contribute!
- Issues: Report bugs, request features.
- UnicoLab: Enterprise AI solutions.
Ready to brew some ML magic? Let's get started! ๐งชโจ
Built with โค๏ธ for the ML community by ๐ฆ UnicoLab
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlpotion-1.0.2.tar.gz.
File metadata
- Download URL: mlpotion-1.0.2.tar.gz
- Upload date:
- Size: 84.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2e7d364a07642e59f22aff6dfaf92e9ab4c6ddb909704337836b14f7be2faa1
|
|
| MD5 |
03fe3d2481be868aa76a29a2807ff58c
|
|
| BLAKE2b-256 |
e6adca0ee7103da18d7eae9b9c6ad0a8943c6409240d3ae176338ebebc756107
|
File details
Details for the file mlpotion-1.0.2-py3-none-any.whl.
File metadata
- Download URL: mlpotion-1.0.2-py3-none-any.whl
- Upload date:
- Size: 116.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfe488f48026e745560ce10b2ff95c58c4d22c6254d90a3d7417fcb757f092c7
|
|
| MD5 |
3e2a3167f4a3b4837f6793c3c134794c
|
|
| BLAKE2b-256 |
567ef09edb3c270f7f6f585ff24383b5a9088deffddc9acc2e9c69f8995d67cd
|