Skip to main content

Atomic Steps for ML Pipelines, framework agnostic, modular

Project description

MLPotion: Brew Your ML Magic! ๐Ÿงชโœจ

MLPotion Logo
Modular Components for Machine Learning Pipelines

Provided and maintained by ๐Ÿฆ„ UnicoLab


Python 3.10+ License: MIT Code style: black Type checked: mypy
ZenML Keras 3 TensorFlow PyTorch


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:

  1. Flexibility > Convention: Your project, your rules
  2. Simplicity > Complexity: If it's hard to use, we failed
  3. Type Safety > Runtime Surprises: Catch errors before they bite
  4. Modularity > Monoliths: Use what you need, ignore the rest
  5. Consistency > Chaos: Same patterns across all frameworks
  6. 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

mlpotion-1.1.0.tar.gz (97.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlpotion-1.1.0-py3-none-any.whl (140.8 kB view details)

Uploaded Python 3

File details

Details for the file mlpotion-1.1.0.tar.gz.

File metadata

  • Download URL: mlpotion-1.1.0.tar.gz
  • Upload date:
  • Size: 97.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.14 Linux/6.14.0-1017-azure

File hashes

Hashes for mlpotion-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0b0ba7082ae71776cd64431960a4f62f76f2dc704d94b383ef0284c4936d6721
MD5 5397a8adb9e2c90af9823a262dd3a85d
BLAKE2b-256 fd43fb6068cec0e240e8f35800ea7516f428435834c560247f3e634e3e4c553b

See more details on using hashes here.

File details

Details for the file mlpotion-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: mlpotion-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 140.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.14 Linux/6.14.0-1017-azure

File hashes

Hashes for mlpotion-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b95e0f4e5b153842f72c91667469644387572e5214eaa2bafef9d29cf8b0a0d
MD5 d425f4fb20357e935093f49b41894fd6
BLAKE2b-256 036f42313dd8754eb36dfd72b436bea619fbf9d8ffd1535cdd4d869b9ddb6ceb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page