v0.12.0 — Deployment & CLI
Deployment & CLI — the final feature phase before v1.0. A trained model becomes a
usable artifact: save a self-describing bundle (model type + config + weights +
vocabulary + labels), reload it anywhere with no training code, and run it from the
command line (polaris predict), over HTTP (polaris serve → FastAPI
POST /predict), or in a container (Dockerfile). This closes the end-to-end
story: a person can now train a real model on a real dataset and serve it.
Added
polaris.inference: turn a trained model into a usable artifact.save_bundle/
load_bundlepersist a self-describing bundle (model type + config + weights +
vocabulary + labels) and reload it as a readyPredictor;Predictorruns the
whole raw-text path (tokenize → collate → forward → softmax) and returns a
Prediction(label + per-class probabilities);build_modelreconstructs a
model from its saved type and config.polaris.deployment: a thin HTTP serving layer —create_appwraps a
Predictor(loaded from a bundle) in a FastAPI app exposingGET /healthand
POST /predict. FastAPI/uvicorn are an optionalservingextra, imported lazily.- CLI commands:
polaris predict TEXT --model BUNDLE [--probs](classify raw text)
andpolaris serve --model BUNDLE(serve it over HTTP). - A
Dockerfileto serve a model in a container (model bundle mounted at run time). Vocabulary.to_dict/Vocabulary.from_dict: a validated serialization
round-trip, used by the bundle format.examples/pretrain_finetune_imdb.pynow saves a bundle at the end of a run.