The inference system routes agent reasoning calls through a model registry using tier-based selection, budget enforcement, and provider-specific message transformation. It ensures the automaton uses the right model for the job while staying within financial constraints.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Conway-Research/automaton/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Location:src/inference/router.ts, src/inference/registry.ts, src/inference/budget.ts
Core components:
- InferenceRouter — Selects optimal model based on survival tier and task type
- ModelRegistry — DB-backed catalog of available models with pricing
- InferenceBudgetTracker — Enforces hourly, daily, and per-call cost ceilings
Inference Pipeline
Task Types
Location:src/inference/types.ts
Routing Matrix
Location:src/inference/types.ts
Maps (SurvivalTier, InferenceTaskType) → ModelPreference[]
- high/normal: Uses capable models (gpt-5.2, gpt-5.3)
- low_compute: Downgrades to cheaper models (gpt-5-mini)
- critical: Uses cheapest available (gpt-5-mini) with strict token limits
- dead: No inference allowed (candidates = [])
Model Registry
Location:src/inference/registry.ts
DB-backed catalog of available models with provider, pricing, and capability metadata.
Model entry:
refresh_models heartbeat task fetches updated model metadata from Conway API and upserts into the registry.
Model Selection
Location:src/inference/router.ts
- First routing-matrix candidate present in the registry
- User-configured model(s) from ModelStrategyConfig
- Free/Ollama models are allowed at any tier, including dead
Budget Enforcement
Location:src/inference/budget.ts
Provider-Specific Message Transformation
Location:src/inference/router.ts
Different providers have different message format requirements. The router transforms messages as needed.
Anthropic Message Transformation
Anthropic has strict requirements:- System messages must be extracted (sent separately)
- Messages must alternate user/assistant roles
- Tool messages become user messages with
tool_resultcontent blocks