Signatures and Schema Enforcement

Catch wrong-typed inputs at serve time, not in production.

0/3 done

A typed contract

What a signature is

A signature is a typed contract between the model and its callers. It records the input columns and types (and optional output schema) at logging time, then enforces them when the model is loaded for prediction. The result: a meaningful error message before a malformed payload reaches the model code.

Three benefits:

  1. Documentation — the model UI shows the expected shape.
  2. Validation — a wrong dtype or missing column fails loudly.
  3. Auto-generated request examplesmlflow models serve returns a sample curl.

Always pair signature with input_example: the example is what tooling shows in the UI and what tests can replay.

Analogy

A signature is a passport stamp: it doesn't tell you everything about the traveller, but it confirms their identity matches what the system expects. Wrong passport = denied at the gate. Same with a model: wrong schema = denied at predict time, before bad data wastes GPU.

Reading in progress · 0 of 3 activities done