Model Primitive
Stateless predictions, built in
The Model primitive is for one thing: predictable inference. A Model takes a structured input, returns a structured output, and stays out of your control flow. No conversation state. No tool loops. Just a clean predict() contract that can be trained, versioned, and evaluated over time.
What a Model is (and isn't)
- Stateless: each prediction is independent.
- Schema-first: inputs and outputs are validated like any other contract.
- Versioned: you can register models and choose which version to run.
- Composable: combine models with ensembles, A/B routing, or fallbacks.
If you need multi-turn reasoning, tool calls, or adaptive dialogue, that is an Agent. Models are for repeatable predictions with crisp contracts.
Declare the model
Models are declared with a runtime backend and a schema. When a model is trainable, training config lives in the same block under training.
Use it like a function
A Model call returns a typed result and optional metadata. That keeps your procedure predictable and easy to test.
Train + evaluate
The CLI selects which model to train by name (handy when a file declares multiple models). Training writes to the registry. Evaluation runs against registered versions and reports metrics.
Test with mocks
Specs should test your logic, not model quality. Use Mocks for deterministic, CI-safe tests.
Where Models shine
- Classification, extraction, embeddings, and scoring.
- Stable outputs that power downstream logic.
- Training + evaluation flows you can automate.
If you want the full loop, combine Models with the registry so you can train candidates, evaluate them on held-out data, and promote a winner with confidence.