Geometric Routing: Letting the Manifold Choose Your LLM
Most LLM routers use keyword matching or classifiers to pick a model. Geometric routing uses the actual topology of your knowledge manifold — curvature, torsion, and wormhole proximity — to determine cognitive complexity and route to the right model tier. Here's why that's better.
What Is Geometric Routing?
Geometric routing is an LLM model selection strategy that uses the topology of a knowledge manifold to determine which model should handle a query. Instead of classifying queries by keywords or training a classifier on historical routing decisions, geometric routing measures the actual geometric properties of the query's neighborhood in the manifold — curvature, torsion, and wormhole proximity — and maps those to model tiers.
High torsion near a wormhole? The query crosses multiple domains and needs maximum reasoning capability. Route to your most powerful model.
Flat space, low curvature? Routine query in familiar territory. Route to your fastest, cheapest model.
The manifold tells you how hard the query is.
Why Current LLM Routers Are Blind
The LLM routing landscape in 2026 is dominated by three approaches:
- Keyword classifiers: If the query contains "code" or "debug", route to the coding model. Brittle, misses nuance.
- Embedding classifiers: Embed the query, classify into categories, route by category. Better, but still operating on a single query in isolation.
- Quality predictors: Train a small model to predict which LLM will produce the best output for a given query (Not Diamond, Martian, etc.). Sophisticated, but expensive and opaque.
All three share the same blindness: they only see the query. They don't see the query's relationship to the user's broader knowledge context.
A query like "how should we handle this?" means very different things depending on whether:
- The user has been deep in a blockchain architecture discussion (high-curvature territory — needs analytical depth)
- The query sits at the intersection of legal compliance and ML training (near a wormhole — cross-domain complexity)
- It's a routine follow-up in a well-trodden topic area (flat space — fast model is fine)
Geometric routing sees all of this because it queries the manifold, not just the prompt.
The Routing Algorithm
Step 1: Locate the Query in the Manifold
Embed the query and find its nearest neighbors in the knowledge graph. This gives you a neighborhood — a local patch of the manifold.
Step 2: Measure Local Geometry
Compute the Rossetti metric properties in that neighborhood:
# Curvature: how sharply understanding changes around the query
kappa = mean(abs(phi_B - phi_A) / d_embed for A, B in neighborhood_edges)
# Torsion: cross-domain density in the neighborhood
tau_c = mean(domain_distance * connection_strength for edge in neighborhood)
# Wormhole proximity: is there a high-torsion cross-source connection nearby?
nearest_wormhole = min(edge.tau_c for edge in neighborhood if edge.cross_source)
Step 3: Map Geometry to Model Tier
| Geometry | What It Means | Model Tier |
|---|---|---|
| Near wormhole (τ_c > 2.0) | Cross-domain complexity, connections between unrelated fields | Maximum — Claude Opus, GPT-4 |
| High curvature (κ > 1.5) | Sharp topic transition, analytical territory | Expensive — Claude Sonnet, GPT-4-mini |
| Medium curvature | Normal analytical work | Mid — Qwen 32B, Llama 70B |
| Flat space (low κ, low τ_c) | Routine, well-trodden territory | Cheap — Groq (fast), small local models |
Step 4: Fail-Open
If the manifold is unavailable (service down, no neighbors found), geometric routing degrades gracefully to keyword-based routing. The manifold is an enhancement, not a dependency.
def route(query: str) -> ModelChoice:
# Try geometric routing first
geo = route_via_geometry(query)
if geo is not None:
return geo
# Fall back to keyword routing
if is_coding_query(query):
return ModelChoice("claude-opus", "keyword: coding detected")
if is_casual(query):
return ModelChoice("groq-llama", "keyword: casual detected")
return ModelChoice("qwen-32b", "default")
Why Geometry Beats Classification
The fundamental advantage is that geometry is context-aware at the manifold level, not just the query level.
Consider two identical queries: "explain this architecture"
- Query A arrives after 10 messages about a simple CRUD app. The manifold neighborhood is flat — low curvature, no cross-domain edges. Geometric routing sends it to Groq (fast, cheap).
- Query B arrives in a conversation that has been jumping between distributed systems, ML inference, and compliance requirements. The manifold neighborhood shows high torsion — multiple wormholes connecting different domains. Geometric routing sends it to Claude Opus.
A keyword classifier routes both identically. An embedding classifier might catch the topic but not the complexity. Only geometric routing measures the actual cognitive topology of what's being asked.
Real-World Performance
In our system (AJ-AGI, a multi-provider AI assistant), geometric routing reduced Claude API costs by routing simple queries to local models (Ollama) while maintaining quality on complex queries:
- Simple/casual queries: 70% routed to Groq or Ollama (fast, free/cheap)
- Analytical queries: 20% routed to Claude Sonnet
- Cross-domain/complex: 10% routed to Claude Opus
- Quality maintained: The 10% that hit Opus are the queries that actually need it
The key insight: most queries don't need your most expensive model. Geometric routing lets the manifold prove it.
FAQ
How is this different from a mixture-of-experts (MoE) approach?
MoE operates within a single model — different expert subnetworks handle different token types. Geometric routing operates between models — selecting which entire model handles the query. They're complementary: you could use geometric routing to pick a model, and that model could internally use MoE.
Does the manifold need to be pre-computed?
The manifold grows with each interaction. New nodes and edges are added as the system processes queries. The geometric properties are computed at ingestion time, so routing lookups are fast (5-10ms). You don't need to rebuild anything — the topology updates incrementally.
Can I use geometric routing without the full Spacetime Engine?
You need some form of knowledge graph with metric properties on edges. The minimum viable version is a Neo4j graph where edges have curvature and torsion scores. The full Rossetti metric (V_eff, A_geom) adds precision but isn't strictly required for routing.
What about cold-start? No manifold yet?
Geometric routing degrades to keyword routing when the manifold has insufficient data. As the manifold grows, geometric routing gradually takes over. There's no hard cutover point — the confidence of the geometric route increases with manifold density.
Related
- Retrocausal RAG: The retrieval system that uses the same manifold topology
- Phi-Scored Persistence: How the manifold decides what to remember
- Wormhole Traversal: The cross-domain connections that drive high-torsion routing
Published by Elijah Brown. Geometric routing is part of the AT Spacetime Engine, built by Advancing Technology.