System map
Astrolabe has four runtime responsibilities:- Understand intent: classify what the request is trying to do.
- Apply guardrails: enforce safety and cost policies.
- Execute reliably: call the selected model with fallbacks.
- Return traceability: include metadata headers and logs showing what happened.
OpenClaw -> Astrolabe policy engine -> OpenRouter -> selected model -> Astrolabe metadata -> OpenClaw
Request lifecycle
For everyPOST /v1/chat/completions request:
- Parse request body, recent context, and conversation features.
- Run high-stakes signal detection.
- Classify category and complexity.
- Apply routing profile (
budget/balanced/quality). - Apply cost-efficiency guardrails (
strict/balanced/off). - Resolve initial model and fallback candidates.
- Execute upstream call.
- For non-streaming responses, run self-check and optionally escalate once.
- Return response with routing metadata headers.
ASTROLABE_FORCE_MODEL) is a special case: classification and self-check escalation are skipped, and the forced model stays locked as both initial and final model.
Category and complexity
Astrolabe routes using two dimensions:- Category: what type of work is requested (coding, retrieval, planning, high-stakes, etc.)
- Complexity: how hard/risky the request is (
simple,standard,complex,critical)
DEFAULT, VALUE, STANDARD, or ESCALATE.
Model tiers
Astrolabe’s model roster is organized by tier intent:ULTRA-CHEAP: minimal-cost, high-volume trivial requestsBUDGET: default low-cost workhorse tierVALUE: stronger capability at lower cost than standard premium modelsMID-TIER: specialized long-context/multimodal reasoning routesSTANDARD: high-precision escalation tierPREMIUM: maximum caution and high-stakes floor
Safety behavior
High-stakes detection evaluates:- action-like language (payments, transfers, deletion, credential resets)
- sensitive data signals (PII, legal/health-sensitive operations)
prompt: inject policy guidance and continuestrict: require explicit confirmation token before executionoff: no high-stakes confirmation handling
Cost behavior
Cost controls are layered:- Routing profile adjusts baseline complexity interpretation.
- Cost efficiency mode applies guardrails to avoid unnecessary premium routing.
- Direct premium toggle can block non-high-stakes direct Sonnet/Opus starts.
Reliability and fallback
Astrolabe uses candidate chains for each route. If the first upstream model is unavailable, retryable failures move to the next candidate in the chain. This keeps requests resilient without exposing provider-level complexity to clients.What clients can observe
Astrolabe addsx-astrolabe-* response headers including:
- category and complexity
- initial and final model IDs
- route label
- escalation flag
- confidence score and low-confidence flag