Skip to Content
OchreML
Commands

inspect & verify

Inspect .dit binary headers and model metadata, or verify .dit file integrity in CI/CD pipelines.

Use ochreml inspect to examine a saved .dit artifact and ochreml verify to validate its integrity with a scriptable exit code (o´∀`o).

ochreml inspect

Reads the .dit binary header (DIT\x01), resolves the numeric model tag via OchreML's tag registry, loads the model on CPU, and extracts JSON-safe metadata.

Usage

ochreml inspect <model> [--json]

Arguments & Flags

Argument / FlagDefaultDescription
modelrequiredPath to .dit model file
--jsonfalseEmit structured JSON output

Example JSON Output

{
  "path": "models/ridge.dit",
  "size_bytes": 512,
  "format": "DIT\\x01",
  "tag": 2,
  "model_type": "Ridge",
  "module": "ochreml._linear_base",
  "category": "classical_ml",
  "metadata": {
    "class_name": "Ridge",
    "n_features_in_": 12,
    "device_": "cpu",
    "alpha": 1.0,
    "fit_intercept": true,
    "coef_shape": [12]
  }
}

Categories reported are classical_ml, preprocessing (tags 7–37), or nn (tags >= 100). Files written via joblib/pickle fallback are reported with "format": "archive_fallback".


ochreml verify

Verifies that a .dit file has a valid .dit extension, readable header, and deserializes cleanly without errors.

Usage

ochreml verify <model> [--json]

Arguments & Flags

Argument / FlagDefaultDescription
modelrequiredPath to .dit model file
--jsonfalseEmit structured JSON output

Exit Codes

  • 0: "valid": true — file header and deserialization succeeded.
  • 1: "valid": false — file is missing, has an invalid extension, corrupted bytes, or unknown tag (details returned in "error").

CI/CD Usage Example

ochreml verify models/ridge.dit --json || exit 1

On this page