Optional metadata provider override. Callers should set
instance.Provider = providerToUse before invoking run methods
in multi-provider contexts. Falls back to the global default provider when unset.
Execute an embedding call with full AIPromptRun tracking.
Creates an AIPromptRun record before the call, invokes the embedding model, stores tokens/cost/timing on the run record, and returns the result.
Embedding execution parameters
Result with vectors, run ID, and usage metrics
Awaits all in-flight prompt-run saves queued by this runner. The normal path does NOT call this — persistence is intentionally fire-and-forget. For tests / durability needs.
AIModelRunner — Lightweight AI model execution tracker for non-LLM model types.
Creates AIPromptRun records for embedding calls (and future: image, audio, video) with full token/cost tracking. Uses the same model selection and vendor failover infrastructure as AIPromptRunner but without template rendering or validation.
Architecture:
Usage: