Ship machine learning models in minutes, not months
modelship is a utility application to ease wrapping and deploying machine learning models
by autogenerating applications, leveraging modern standards such as ONNX and WebAssembly.
Examples of static web applications generated with modelship from ONNX models:
housing: housing price prediction model (regression)sentiment: movie review sentiment analysis (binary classification)
- ONNX model support
- Generate a static web application with autogenerated form
Using pip (or any other Python package manager):
pip install modelshipUsing uvx:
uvx modelshipEvery model must be described with some basic metadata for conversions to work properly.
Here is the YAML schema:
name: Model Name
description: Model description
inputs:
float_input:
name: Float Input Name
type: float32
shape: [null, 1]
min: 10
max: 100
step: 1
default: 50
string_input:
name: String Input Name
type: string
shape: [null]
outputs:
float_output:
name: Float Output Name
type: float32
shape: [null, 1]
string_output:
name: String Output Name
type: string
shape: [null]Input fields:
name:strtype:Literal["float32", "string"]shape:list[int | None]- (optional)
min:float - (optional)
max:float - (optional)
step:float - (optional)
defaut:float | str
Output fields:
name:strtype:Literal["float32", "string"]shape:list[int | None]
Provide an ONNX model with its YAML metadata description, and modelship
will generate a static web application with an autogenerated HTML form,
performing model inference using ONNX Runtime Web (WebAssembly):
$ modelship static --output dist --metadata model/metadata.yml model/model.onnxThe resulting static application in dist can now be deployed on any static
hosting provider (GitHub Pages, GitLab Pages, Cloudflare Pages, S3, Vercel)!
Licensed under Apache License 2.0
Copyright (c) 2025 - present Romain Clement / Datalpia