Mimir (Mimir v0.3.0)

Copy Markdown View Source

Mimir is an embeddable routing oracle, pricing source, and decision vocabulary for LLM workloads. Consult it in-process: hand it a workload descriptor and an operational snapshot, and it hands back a placement (or a reasoned no-candidate answer) plus an auditable decision record. A gateway service built on top of Mimir is one possible embedder — not a requirement.

Module inventory

ModuleWhat it does
Mimir.DescriptorValidated workload descriptor — the contract a workflow step presents to the oracle.
Mimir.OraclePure filter-then-rank placement decision over catalog entries.
Mimir.CatalogConfig-sourced routable entries, with an injectable model resolver seam.
Mimir.SnapshotExplicit-inputs operational snapshot the oracle ranks against (pricing, health, budget).
Mimir.HealthFailure-streak table for router lanes, driven by telemetry.
Mimir.DecisionRecordTyped routing-decision record; to_event/1 renders the binary-keyed audit map.
Mimir.RouteLogTyped route outcome plus a request-log meta builder.
Mimir.PricingToken usage to integer microdollar cost, config-first over a vendored LiteLLM pricing DB.
Mimir.TurnEventsPer-request ordered gen_ai.* event buffer.
Mimir.RouterClientBehaviour for routing clients, with an HTTP (Req-based) implementation. Returns a parsed %Mimir.RouteResponse{}.
Mimir.RouteResponseParsed routing-call result; new/1 is the single boundary from wire map to struct.
Mimir.GrantMinted routing grant: key, budget, expiry.
Mimir.PlacementFlat chosen-model placement: lane, model, runtime.
Mimir.CandidateOne catalog entry's routing verdict: chosen, ranked, or excluded.
Mimir.RedactSecret masking and payload-capture gating helpers.
Mimir.GuardTurn-guard builders for a session's between-turn hook — grant-budget halts and mimir-less caps.
Mimir.IngestDecision-correlated ingestion of raw session events into Mimir.TurnEvents.
Mimir.SessionsCanonical recipe: route response to session options (model_config, turn_guard, telemetry_metadata).

See the README for design rules, supervision, configuration, and a gateway-less worked example.