SEAR: Schema-Based Evaluation and Routing for LLM Gateways
Organizations: Strukto.AI, USA · Infron.AI, USA
Abstract
Evaluating production LLM responses and routing requests across providers in LLM gateways requires fine-grained quality signals and operationally grounded decisions. To address this gap, we present SEAR, a schema-based evaluation and routing system for multi-model, multi-provider LLM gateways. SEAR defines an extensible relational schema covering both LLM evaluation signals (context, intent, response characteristics, issue attribution, and quality scores) and gateway operational metrics (latency, cost, throughput), with cross-table consistency links across around one hundred typed, SQL-queryable columns. To populate the evaluation signals reliably, SEAR proposes self-contained signal instructions, in-schema reasoning, and multi-stage generation that produces database-ready structured outputs. Because signals are derived through LLM reasoning rather than shallow classifiers, SEAR captures complex request semantics, enables human-interpretable routing explanations, and unifies evaluation and routing in a single query layer. Across thousands of production sessions, SEAR achieves strong signal accuracy on human-labeled data and supports practical routing decisions, including large cost reductions with comparable quality.
Figures & tables
| Table | Bool | Cat | Ord | Text | Static | Total |
|---|---|---|---|---|---|---|
| context_info | 17 | 4 | 2 | 2 | 20 | 45 |
| llm_response_info | 15 | 1 | 2 | 1 | 0 | 19 |
| issue_attribution | 1 | 19 | 0 | 0 | 0 | 20 |
| evaluation | 2 | 1 | 28 | 0 | 0 | 31 |
| Total | 35 | 25 | 32 | 3 | 20 | 115 |
| Capability | Ours | Text | Single | Rubric | Templ. |
| Root-cause attribution | ✓ | ✗ | |||
| Quality scores | ✓ | ✓ | ✓ | ||
| Session aggregation | ✓ | ✓ | ✓ | ||
| Per-signal slice analysis | ✓ | ✗ | |||
| Joint eval. + oper. metrics | ✓ | ||||
| Consistency checks | ✓ | ✗ | ✗ | ✗ | ✗ |
| Capability | Ours | Signal | Learned |
|---|---|---|---|
| Per-signal explanation | ✓ | ||
| Deep semantic extraction | ✓ | ✗ | |
| Preference optimization | ✓ | ✗ | ✓ |
| Quality–cost–latency tuning | ✓ | ||
| Oper.-metric-aware routing | ✓ | ✓ | |
| Joint evaluation and routing | ✓ | ✗ | ✗ |
| GPT-5-mini | GPT-5.2 | ||||||
|---|---|---|---|---|---|---|---|
| Metric | Low (w/o) | Low (w/) | High (w/o) | High (w/) | Low (w/) | High (w/) | |
| Error rate | 0.1044 | 0.0989 | 0.0926 | 0.0916 | 0.0965 | 0.0851 | |
| Hamming loss | 0.1003 | 0.0958 | 0.0878 | 0.0869 | 0.0914 | 0.0794 | |
| Boolean accuracy | 0.9170 | 0.9184 | 0.9368 | 0.9376 | 0.9354 | 0.9549 | |
| Boolean micro F1 | 0.8243 | 0.8292 | 0.8646 | 0.8680 | 0.8510 | 0.8990 | |
| Categorical accuracy | 0.9223 | 0.9295 | 0.9237 | 0.9258 | 0.9287 | 0.9337 | |
| Model | Quality | $/M in | $/M out |
|---|---|---|---|
| gemini-2.5-flash-lite | 17.57 | 0.10 | 0.40 |
| claude-haiku-4-5 (deployed) | 17.00 | 1.00 | 5.00 |
| grok-4-1-fast | 16.86 | 0.20 | 0.50 |
| qwen3-80b | 15.66 | 0.15 | 1.20 |
| Metric | GPT-5-nano |
|---|---|
| Error rate | 0.2094 |
| Hamming loss | 0.2094 |
| Boolean accuracy | 0.8263 |
| Boolean micro F1 | 0.6299 |
| Categorical accuracy | 0.7233 |
| Ordinal MAE | 0.6433 |
| Configuration | Incon. | Filter% | Imp. Err | Imp. HL |
|---|---|---|---|---|
| GPT-5-mini low (w/o) | 34 | 11.33% | 7.47% | 6.78% |
| GPT-5-mini low (w/) | 9 | 3.00% | 2.22% | 2.09% |
| GPT-5-mini high (w/o) | 11 | 3.67% | 0.86% | 0.46% |
| GPT-5-mini high (w/) | 2 | 0.67% | 0.33% | 0.35% |
| GPT-5.2 low (w/) | 17 | 5.67% | 4.56% | 4.38% |
| GPT-5.2 high (w/) | 6 | 2.00% | 0.82% | 0.76% |
| GPT-5-mini | GPT-5.2 | ||
|---|---|---|---|
| Low | High | Low | High |
| 7.3% (22 / 300) | 3.7% (11 / 300) | 2.0% (6 / 300) | 0.0% (0 / 300) |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Signal | Type | Org A | Org B | Org C | All |
|---|---|---|---|---|---|
| safety_sensitive_content | bool | 1% | 0% | 0% | 0% |
| noisy | bool | 16% | 0% | 0% | 5% |
| persona_or_role_instruction | bool | 100% | 100% | 100% | 100% |
| reference_material | bool | 90% | 100% | 100% | 97% |
| tool_call | bool | 1% | 0% | 0% | 0% |
| code_task | bool | 0% | 0% | 0% | 0% |
| Signal | Type | Org A | Org B | Org C | All |
|---|---|---|---|---|---|
| tool_call | bool | 0% | 0% | 0% | 0% |
| code_task | bool | 1% | 0% | 2% | 1% |
| math_task | bool | 0% | 0% | 0% | 0% |
| stylistic_transformation_task | bool | 22% | 7% | 90% | 40% |
| information_extraction_task | bool | 13% | 0% | 1% | 5% |
| multistep_reasoning | bool | 6% | 14% | 0% | 7% |
| Signal | Type | Org A | Org B | Org C | All |
|---|---|---|---|---|---|
| hallucination | bool | 0% | 0% | 0% | 0% |
| tool_call | ord | n/a (99%) | n/a (100%) | n/a (100%) | n/a (100%) |
| code_task | ord | n/a (100%) | n/a (100%) | n/a (100%) | n/a (100%) |
| math_task | ord | n/a (100%) | n/a (100%) | n/a (100%) | n/a (100%) |
| stylistic_transformation_task | ord | n/a (74%) | n/a (93%) | none (100%) | n/a (56%) |
| information_extraction_task | ord | n/a (82%) | n/a (95%) | n/a (100%) | n/a (92%) |
| Signal | Type | Org A | Org B | Org C | All |
|---|---|---|---|---|---|
| appropriate | bool | 100% | 100% | 100% | 100% |
| verbose | bool | 7% | 17% | 0% | 8% |
| tool_call | ord | n/a (99%) | n/a (100%) | n/a (100%) | n/a (100%) |
| code_task | ord | n/a (100%) | n/a (100%) | n/a (100%) | n/a (100%) |
| math_task | ord | n/a (100%) | n/a (100%) | n/a (100%) | n/a (100%) |
| stylistic_transformation_task | cat | n/a (71%) | n/a (93%) | none (100%) | n/a (55%) |
LLM Routing
Large language model routing selects models, tools, experts, or inference strategies to balance answer quality, cost, latency, and deployment constraints.
See all 349 papers