mix omni.snapshot (Omni v1.6.1)

Copy Markdown View Source

Fetches the full models.dev catalog and writes it to priv/models/models_dev.json.

mix omni.snapshot

The snapshot content is the raw API response — all providers, no transformation, no filtering. Omni.Sources.ModelsDev transforms it into %Omni.Model{} structs at load time; keeping the snapshot unpruned lets custom providers point at any models.dev catalog, not just Omni's built-ins.

Only the encoding is normalized: pretty-printed with keys sorted at every level, so successive snapshots produce minimal, reviewable git diffs.

This is a maintainer task: the snapshot is checked into the repo and shipped in the package. Run it manually when model data needs refreshing, and update the golden test expectations alongside the new snapshot.

Summary

Functions

Encodes decoded catalog data as pretty-printed JSON with sorted keys.

Functions

format(data)

@spec format(term()) :: String.t()

Encodes decoded catalog data as pretty-printed JSON with sorted keys.

Deterministic: the same data always produces the same bytes, regardless of the key order models.dev returned.