Virtual Model Router and Prompt-Cache Session Affinity Manager (spec.md §4, Step 5).
Provides:
- Virtual model aliases (
"fast","balanced","deep","coding") that dynamically resolve to concrete{provider, model_id, thinking_budget}tuples based on task phase, complexity, or fallback health. - Prompt-cache session affinity via
pi.provider(UUIDv7): preserves the samesessionIdacross linear turns and allocates a freshUUIDv7when a conversation forks.
Summary
Functions
Ensures the conversation has a pi.provider document with a stable sessionId (UUIDv7)
for LLM prompt-cache affinity (spec.md §4.3).
Resolves a virtual model name (or explicit "provider/model" string) into a normalized
routing descriptor %{provider: atom(), model: String.t(), thinking_budget: non_neg_integer()}.
Functions
Ensures the conversation has a pi.provider document with a stable sessionId (UUIDv7)
for LLM prompt-cache affinity (spec.md §4.3).
Resolves a virtual model name (or explicit "provider/model" string) into a normalized
routing descriptor %{provider: atom(), model: String.t(), thinking_budget: non_neg_integer()}.