Skip to main content

One-line deployment for trained tabular ML models

Project description

Deeploi — Deploy ML Models in Seconds 🚀

Deeploi Banner

PyPI version License: MIT

Turn your trained tabular ML model into a production-ready API with a single line of code. No DevOps. No boilerplate. No headaches.


Why Deeploi?

  • Instant API: Serve your scikit-learn or XGBoost model as a blazing-fast REST API in one command.
  • Zero Config: No YAML, no Docker, no cloud lock-in. Just your model and your data.
  • For Data Scientists: Focus on modeling, not infrastructure.
  • For Startups & Teams: Ship ML features faster, without waiting for MLOps.
  • Local-First: Run anywhere—laptop, server, or cloud VM.

Get Started in 10 Seconds

from deeploi import deploy

deploy(model, sample=X_train)

Your model is now live at http://127.0.0.1:8000 with /predict, /health, and /meta endpoints.


Features

  • One-line deployment for tabular models
  • Automatic schema inference from your training data
  • Model packaging & versioning for reproducibility
  • Prediction probabilities for classifiers
  • Supports scikit-learn & XGBoost
  • No cloud or container required
  • Optional Docker artifact generation

Quick Start

pip install deeploi
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
from deeploi import deploy

iris = load_iris(as_frame=True)
X, y = iris.data, iris.target
model = RandomForestClassifier().fit(X, y)
deploy(model, sample=X)

How It Works

  1. Train your model as usual.
  2. Deploy instantly with deploy(model, sample=X_train).
  3. Call your API for predictions.

API Endpoints

  • POST /predict — Get predictions
  • POST /predict_proba — Get class probabilities (classifiers)
  • GET /meta — Model metadata
  • GET /health — Health check

Save, Load, and Reuse

from deeploi import package, load

pkg = package(model, X_train)
pkg.save("artifacts/v1")
pkg = load("artifacts/v1")
preds = pkg.predict(X_test)

Who is Deeploi for?

  • Data scientists who want to demo or share models instantly
  • ML engineers who need fast, local serving for tabular models
  • Startups and teams who want to skip MLOps complexity

Advanced Usage

Three Core Functions

1. deploy() — One-liner, immediate serving

from deeploi import deploy

deploy(model, sample=X_train, host="127.0.0.1", port=8000)

2. package() — Reusable object

from deeploi import package

pkg = package(model, sample=X_train)
preds = pkg.predict(X_test)
pkg.save("artifacts/iris_rf")
pkg.serve(port=8000)

3. load() — Reload saved artifacts

from deeploi import load

pkg = load("artifacts/iris_rf")
preds = pkg.predict(X_test)

4. Docker Generation — Containerize a saved artifact

from deeploi import package

pkg = package(model, sample=X_train)
pkg.save("artifacts/iris_rf", generate_docker=True)

# or generate Docker files later
pkg.generate_docker("artifacts/iris_rf", port=8000)

Build and run:

cd artifacts/iris_rf
docker build -t iris-model .
docker run --rm -p 8000:8000 iris-model

Example: Test the API

curl -X POST http://127.0.0.1:8000/predict \
  -H "Content-Type: application/json" \
  -d '{
    "records": [
      {
        "sepal length (cm)": 5.1,
        "sepal width (cm)": 3.5,
        "petal length (cm)": 1.4,
        "petal width (cm)": 0.2
      }
    ]
  }'

Response:

{
  "predictions": [0],
  "probabilities": [
    {"0": 0.91, "1": 0.09}
  ]
}

Artifact Structure

When you call pkg.save("path/to/artifact"), you get:

path/to/artifact/
├── model.joblib           # Serialized model
├── metadata.json          # Versions, task type, timestamps
├── schema.json            # Features, dtypes, column order
├── deeploi.json           # Manifest
└── requirements.txt       # Dependencies

# Optional (if Docker generation is enabled)
path/to/artifact/
├── Dockerfile             # Container build definition
├── .dockerignore          # Ignore unnecessary build files
└── serve.py               # ASGI entrypoint for uvicorn

Error Handling

from deeploi import package, UnsupportedModelError, InvalidSampleError

try:
    pkg = package(my_model, my_sample)
except UnsupportedModelError:
    print("Only sklearn and XGBoost are supported")
except InvalidSampleError:
    print("Sample must be a non-empty DataFrame")

What's in v0.1.0

Supported:

  • sklearn classifiers and regressors
  • XGBoost classifiers and regressors
  • pandas DataFrame inputs
  • Local FastAPI serving
  • Model save/load
  • Schema inference
  • Prediction probabilities (classifiers)
  • Docker file generation for saved artifacts

Not in v0.1.0:

  • S3 / cloud storage
  • Authentication
  • Batch inference
  • Async workers
  • Model registry
  • Monitoring

Requirements

  • Python 3.8+
  • pandas >= 1.0
  • scikit-learn >= 0.24
  • xgboost >= 1.0
  • fastapi >= 0.68
  • uvicorn >= 0.15

License

MIT — see LICENSE.


Ready to deploy your model?
Try the examples or run pip install deeploi now!

Questions? Open an issue on GitHub.

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

deeploi-0.1.1.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

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

deeploi-0.1.1-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file deeploi-0.1.1.tar.gz.

File metadata

  • Download URL: deeploi-0.1.1.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for deeploi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5f870d22fcf01e19456227fc25c322a75c5dac4285afa373ac7136e5ec52407d
MD5 9f2a8d4f5b07d15d9473a5a82fa037de
BLAKE2b-256 3dc9b9f73eec7188642cc1d3cae52f70c7c2a4ff282ae927ed637f2557257e16

See more details on using hashes here.

File details

Details for the file deeploi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: deeploi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for deeploi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3ada7c2acccd217791d4bba19b98d38872cd015ab0136a45b6d878bc73a188
MD5 1878a13297b1f034749966491076ac54
BLAKE2b-256 37c4a9e2e9f4175701996ad4214a6fe931d01b777bd9e0de59b2934c97292c4b

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