Guides · Models & ML
Building models
Train a model on your product’s data and serve it from the same database. Your schema’s access rules govern training consent, live features and evals.
Model work on Napalm#
Model pipelines run on the same primitives as your application. Training exports and live features read directly from your product’s rows, and trainers and model servers connect as ordinary callers under your schema’s access rules.
- Policies on every read
- Exports, change streams and live feature queries enforce the same schema policies.
- Files beside rows
- Parquet shards and model checkpoints link database records to immutable object storage.
- Calls to your GPU
- Actions load permitted feature rows in one query before calling your model.
Four built-in primitives replace separate feature stores, dataset buckets and glue queues:
- Access policies
- Declare read access once on each schema type so user requests and ML pipelines share the same boundary. Workspace training consent is an ordinary policy rule. See Access & sign-in.
- Files
- Datasets and checkpoints are file records that link typed metadata in PostgreSQL to bytes streamed directly to object storage.
- Actions and jobs
- Your model runs on your own HTTPS endpoint. An action loads permitted feature rows in one query before calling your model, and a job runs asynchronous inference or launch calls with automatic retries.
- The change log
- The change log records committed writes in order under your schema policies, so nightly exports read incremental changes instead of rescanning full tables.
Starting points#
Each guide covers one stage of the loop, from consent-filtered Parquet shards to shadow evaluation and zero-deploy version switches:
| Goal | Guide | Summary |
|---|---|---|
| Build a fine-tuning dataset | Datasets & ML training | SummaryEnforce training consent in the schema, store Parquet shards as file records and log each run’s inputs. |
| Serve your own model | Model serving | SummaryLoad features in one query, score on request or in the background and save every prediction. |
| Evaluate a new model version | Evals | SummaryScore a golden set in CI, shadow live traffic and promote production misses into saved test cases. |
| Switch serving versions | Model registry | SummaryStore the active version in a row to promote or roll back in one write. |
| Connect assistants or agents | In-app AI copilots | SummaryCall hosted foundation models over your data under caller access rules. |
Model hosting#
Napalm stores your data and enforces access rules, while training and inference run on your own GPU infrastructure.
An action waits up to 30 seconds for a response, and a job attempt runs for up to 120 seconds. For longer runs, trigger the trainer on your GPU cluster and write the results back on completion. See Datasets & ML training.