Skip to main content

CLI and specification for portable, inspectable AI model containers

Project description

modelc

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 build
  • modelc run
  • modelc 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 stdin and stdout

Quick start

1. Create a virtual environment

python -m venv .venv

Activate it:

macOS / Linux

source .venv/bin/activate

Windows

.venv\Scripts\Activate.ps1

2. Install dependencies

pip install -e .

3. Try the example

Inspect the example:

modelc inspect examples/sentiment-basic

Build it:

modelc build examples/sentiment-basic

Run 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"}'

Manifest shape

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.py

Entrypoint contract

The entrypoint must:

  • read JSON from stdin
  • write JSON to stdout
  • write logs/errors to stderr
  • exit non-zero on failure

Notes

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

License

MIT

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

modelc-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

modelc-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file modelc-0.1.0.tar.gz.

File metadata

  • Download URL: modelc-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for modelc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6abfc669a165594556dc7d45e99f50543b29bcb98ddbdceb98957c75f443e28e
MD5 6c212d007de641242abeee71afa9b342
BLAKE2b-256 00d171aa4c24d2f7a96c20f4f0a043b2cd54738bf9afcf4494294b9e21aecf3e

See more details on using hashes here.

File details

Details for the file modelc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: modelc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for modelc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff0a4bb8eb1f531417e40a8b68699d1569a26d8e5236b038f70d6b991ef0683e
MD5 9db161da015a11a01c00b3c32921708b
BLAKE2b-256 bf00dcdab54fb9c292dd92e86f058f17b615066b36ed80b2562d7c427a4cb9c1

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