A ready-to-run Python CLI skeleton for portable, inspectable AI model containers.
This project implements a practical v0 of the modelc specification with:
modelc buildmodelc runmodelc inspect
It supports:
- manifest parsing from
model.yaml - packaging local projects into
.modelc.tar.gz - running local projects or packaged artifacts
- input/output schema validation
- a simple Python entrypoint contract using
stdinandstdout
python -m venv .venvActivate it:
macOS / Linux
source .venv/bin/activateWindows
.venv\Scripts\Activate.ps1pip install -e .Inspect the example:
modelc inspect examples/sentiment-basicBuild it:
modelc build examples/sentiment-basicRun it from source:
modelc run examples/sentiment-basic --input '{"text":"I love this"}'Run it from the built package:
modelc run examples/sentiment-basic/dist/sentiment-basic-0.1.0.modelc.tar.gz --input '{"text":"This is bad"}'apiVersion: modelc.dev/v0
kind: ModelContainer
metadata:
name: sentiment-basic
version: 0.1.0
description: Basic sentiment classifier
runtime:
type: python
version: "3.11"
dependencies: []
artifacts:
weights:
path: ./model/
format: pytorch
tokenizer:
path: ./tokenizer/
format: huggingface
interface:
input:
type: text
schema:
text: string
output:
type: classification
schema:
label: string
confidence: float
entrypoint:
command: python run.pyThe entrypoint must:
- read JSON from
stdin - write JSON to
stdout - write logs/errors to
stderr - exit non-zero on failure
This is a deliberately small v0 implementation.
It does not:
- create virtual environments
- install dependencies automatically
- support non-Python runtimes
- provide remote registry support
- implement signing or provenance
MIT