# LLM DB v2026.7.3 - API Reference

## Modules

- [LLMDB.ExecutionContract](LLMDB.ExecutionContract.md): Deterministic runtime-contract enrichment for packaged provider and model data.

- Stable Runtime API
  - [LLMDB](LLMDB.md): Fast, persistent_term-backed LLM model metadata catalog.
  - [LLMDB.History](LLMDB.History.md): Read-only runtime access to generated model history artifacts.
  - [LLMDB.LoadError](LLMDB.LoadError.md): Raised when lazy catalog initialization fails on the first public query.
  - [LLMDB.Model](LLMDB.Model.md): Model struct with Zoi schema validation.
  - [LLMDB.Provider](LLMDB.Provider.md): Provider struct with Zoi schema validation.
  - [LLMDB.Spec](LLMDB.Spec.md): Canonical "provider:model" spec parsing and resolution.

- Supported Build Extensions
  - [LLMDB.Snapshot](LLMDB.Snapshot.md): Canonical snapshot artifact helpers.
  - [LLMDB.Source](LLMDB.Source.md): Unified data source interface for LLMDB.

- Compatibility Facades
  - [LLMDB.Application](LLMDB.Application.md): Deprecated compatibility shim for callers that invoked `start/2` directly.
  - [LLMDB.Dotenv](LLMDB.Dotenv.md): Deprecated compatibility facade for maintainer dotenv loading.
  - [LLMDB.Store](LLMDB.Store.md): Manages persistent_term storage for LLM model snapshots with atomic swaps.

- Maintainer Internals
  - [LLMDB.Engine](LLMDB.Engine.md): Pure ETL pipeline for BUILD-TIME LLM model catalog generation.
  - [LLMDB.Enrich](LLMDB.Enrich.md): Lightweight, deterministic enrichment of model data.
  - [LLMDB.Enrich.AzureWireProtocol](LLMDB.Enrich.AzureWireProtocol.md): Wire protocol enrichment using Azure AI Foundry inference task metadata.
  - [LLMDB.History.Backfill](LLMDB.History.Backfill.md): Backfills model history by diffing committed provider snapshots across git history.
  - [LLMDB.History.Bundle](LLMDB.History.Bundle.md): Snapshot-store helpers for local history bundles.
  - [LLMDB.History.Migrator](LLMDB.History.Migrator.md): One-time migration from Git-tracked metadata history into snapshot-store artifacts.
  - [LLMDB.History.Rebuilder](LLMDB.History.Rebuilder.md): Rebuilds snapshot-based history artifacts from an ordered snapshot observation chain.
  - [LLMDB.Snapshot.Builder](LLMDB.Snapshot.Builder.md): Builds canonical snapshot artifacts from configured sources.
  - [LLMDB.Sources.Anthropic](LLMDB.Sources.Anthropic.md): Remote source for Anthropic models (https://api.anthropic.com/v1/models).
  - [LLMDB.Sources.Google](LLMDB.Sources.Google.md): Remote source for Google Gemini models (https://generativelanguage.googleapis.com/v1beta/models).
  - [LLMDB.Sources.Llmfit](LLMDB.Sources.Llmfit.md): Sidecar source for llmfit open-weight metadata.
  - [LLMDB.Sources.Local](LLMDB.Sources.Local.md): Loads model metadata from local TOML files in a directory structure.
  - [LLMDB.Sources.ModelsDev](LLMDB.Sources.ModelsDev.md): Remote source for models.dev metadata (https://models.dev/api.json).
  - [LLMDB.Sources.OpenAI](LLMDB.Sources.OpenAI.md): Remote source for OpenAI models (https://api.openai.com/v1/models).
  - [LLMDB.Sources.OpenRouter](LLMDB.Sources.OpenRouter.md): Remote source for OpenRouter metadata (https://openrouter.ai/api/v1/models?output_modalities=all).
  - [LLMDB.Sources.XAI](LLMDB.Sources.XAI.md): Remote source for xAI (Grok) models (https://api.x.ai/v1/models).
  - [LLMDB.Sources.Zenmux](LLMDB.Sources.Zenmux.md): Remote source for Zenmux models (https://zenmux.ai/api/v1/models).
  - [LLMDB.Validate](LLMDB.Validate.md): Validation functions for providers and models using Zoi schemas.

- Internal Runtime Implementation
  - [LLMDB.Config](LLMDB.Config.md): Configuration reading and normalization for LLMDB.
  - [LLMDB.Generated.ValidModalities](LLMDB.Generated.ValidModalities.md): Auto-generated module containing all valid modality atoms.
  - [LLMDB.Loader](LLMDB.Loader.md): Handles loading and merging of packaged snapshots with runtime customization.
  - [LLMDB.Merge](LLMDB.Merge.md): Precedence-aware merging with exclude handling for LLM model data.
  - [LLMDB.Normalize](LLMDB.Normalize.md): Complete normalization utilities for raw data into consistent formats.
  - [LLMDB.Packaged](LLMDB.Packaged.md): Provides access to the packaged base snapshot.
  - [LLMDB.Pricing](LLMDB.Pricing.md): Pricing pipeline for converting legacy cost data and applying provider defaults.
  - [LLMDB.Query](LLMDB.Query.md): Query functions for selecting models based on capabilities and requirements.
  - [LLMDB.Runtime](LLMDB.Runtime.md): Runtime configuration compilation for consumer applications.
  - [LLMDB.Snapshot.ReleaseStore](LLMDB.Snapshot.ReleaseStore.md): GitHub Releases-backed snapshot artifact store.

## Mix Tasks

- Supported Mix Tasks
  - [mix llm_db.build](Mix.Tasks.LlmDb.Build.md): Builds a canonical `snapshot.json` from configured sources.
  - [mix llm_db.history.backfill](Mix.Tasks.LlmDb.History.Backfill.md): > #### Deprecated {: .warning}
>
> This legacy task remains callable for compatibility. Seed snapshot-based
> history once with `mix llm_db.history.migrate_git --publish`, then use
> `mix llm_db.history.rebuild --publish`. Removal may occur no earlier than
> `v2027.0.0`, after at least one minor release deprecation window.
  - [mix llm_db.history.check](Mix.Tasks.LlmDb.History.Check.md): Checks whether the local installed history bundle matches the published
history metadata in the snapshot store.
  - [mix llm_db.history.migrate_git](Mix.Tasks.LlmDb.History.MigrateGit.md): Performs the one-time migration from legacy Git-tracked metadata commits into
content-addressed snapshots plus snapshot-based history artifacts.
  - [mix llm_db.history.rebuild](Mix.Tasks.LlmDb.History.Rebuild.md): Rebuilds local history artifacts from the published snapshot observation chain,
then bundles the result and optionally republishes `history.tar.gz` plus
`history-meta.json` to an immutable `history-<snapshot_id>` release for the
latest snapshot in the chain.

  - [mix llm_db.history.sync](Mix.Tasks.LlmDb.History.Sync.md): Downloads the published history bundle from the snapshot store and extracts it
into the local history directory.
  - [mix llm_db.install](Mix.Tasks.LlmDb.Install.md): Install and configure LLM DB for use in an application.
  - [mix llm_db.models](Mix.Tasks.LlmDb.Models.md): Lists all models from the LLMDB catalog with lifecycle status and aliases.
  - [mix llm_db.pull](Mix.Tasks.LlmDb.Pull.md): Pulls latest model metadata from all configured remote sources and caches locally.
  - [mix llm_db.snapshot.build](Mix.Tasks.LlmDb.Snapshot.Build.md): Alias for `mix llm_db.build`.

  - [mix llm_db.snapshot.fetch](Mix.Tasks.LlmDb.Snapshot.Fetch.md): Fetches a published snapshot from GitHub Releases.
  - [mix llm_db.snapshot.publish](Mix.Tasks.LlmDb.Snapshot.Publish.md): Builds and publishes a canonical snapshot to GitHub Releases.
  - [mix llm_db.version](Mix.Tasks.LlmDb.Version.md): Updates the version in mix.exs to CalVer format (YYYY.M.PATCH).

