Introduction
MLup is a library for easy and fast running of ML models in production.
All you need is to deliver the model file to the server (a config is optional) — pymlup turns it into a FastAPI web application with one CLI command. No web app code to write or maintain.
- Pure Python, no required framework-specific glue code;
- Uses FastAPI for the web layer;
- Works with any Python object that exposes a
predict-like method, plus native (de)serialization support for scikit-learn, lightgbm, tensorflow, torch and onnx models.
Requirements
Python 3.8+ (3.12, 3.13, 3.14 supported; the tensorflow extra requires Python <3.14 until TensorFlow publishes 3.14 wheels).
Installation
pip install pymlup
With an ML backend extra:
pip install "pymlup[scikit-learn]" # For scikit-learn
pip install "pymlup[lightgbm]" # For microsoft lightgbm
pip install "pymlup[tensorflow]" # For tensorflow
pip install "pymlup[torch]" # For torch
pip install "pymlup[onnx]" # For onnx models: torch, tensorflow, sklearn, etc...
Quick start
The easiest way to try it, from a model file on disk:
mlup run -m /path/to/my/model.onnx
Or from Python, with any object that has a predict-like method:
import mlup
class MyAnyModelForExample:
def predict(self, X):
return X
up = mlup.UP(ml_model=MyAnyModelForExample())
up.ml.load()
# You can open your browser at http://localhost:8009/docs for interactive API docs (Swagger UI)
up.run_web_app(daemon=True)
import requests
response = requests.post('http://0.0.0.0:8009/predict', json={'X': [[1, 2, 3], [4, 5, 6]]})
print(response.json())
up.stop_web_app()
Supported ML frameworks
Work tested with machine learning model frameworks (links to tests):
- scikit-learn>=1.2.0,<2.0.0
- tensorflow>=2.0.0,<3.0.0, Python<3.14
- lightgbm>=4.0.0,<5.0.0
- torch>=2.0.0,<3.0.0
- onnx>=1.0.0,<2.0.0
- onnxruntime>=1.14.0,<1.26.0
Support and tested with machine learning libraries:
Documentation
The full documentation — Python API, CLI reference, config file format, storages, binarizers, data transformers, web app architectures/API, application life cycle — lives at mlup.org (source: docs/).
Useful links
Metrics
MLup PyPi download statistics: https://pepy.tech/project/pymlup
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 pymlup-0.3.0.tar.gz.
File metadata
- Download URL: pymlup-0.3.0.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14f373f57114070b2fb400e2c8754dbbb983b7ea1e5cfac0e23aa4641fc670f2
|
|
| MD5 |
0cda91331f1eec8e50049617a3825732
|
|
| BLAKE2b-256 |
d54e96b863f17369bb43d800518c222d3d747761cf8d9710df15de2418d8a488
|
File details
Details for the file pymlup-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pymlup-0.3.0-py3-none-any.whl
- Upload date:
- Size: 60.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b82642b4ca4523fa88fa54140c47501c18d9e815ba41c3ddd5f78fb16f210d7c
|
|
| MD5 |
7b2128914778e453ef01e297ad1ffecb
|
|
| BLAKE2b-256 |
eafc3e36d733abc0e7a3f1a3120e2850d34fe2edf0ba2e7a1105f5016f4cf1d7
|