Skip to content

Model packages

A model package is a directory: manifest.json, the model file (.tflite today) and, for classifiers, labels.txt.

  • The manifest declares the task (image-embedding or image-classification), the input (size, preprocessing, layout, dtype, normalisation), the output, an ordered list of accelerators, the memory it needs and its licence.
  • The gateway verifies the SHA-256 of the model file before serving it, and caches the check so a 600 MB model is hashed once. Unknown manifest fields are rejected, so a typo fails loudly.
  • Accelerator selection walks the list in order: a package with ["gpu", "npu", "cpu"] runs on the phone’s GPU and the TV’s NPU.
  • Signatures (Ed25519 over the canonical manifest, by the maker and counter-signed by the platform) are designed and are the next step for the marketplace. Today packages are hash-checked, not signed.

The full schema: Model package format.

Terminal window
python3 tools/package_model.py inspect model.tflite
python3 tools/package_model.py manifest models/<id>/<file>.tflite --labels models/<id>/labels.txt --id <id> --version 1.0.0 …
python3 tools/package_model.py validate models/*/manifest.json