Policy-Governed LLM Routing with Intent Matching for Instrument Laboratories
Organizations: School of Engineering, The University of Edinburgh, Edinburgh, UK
Abstract
AI tutoring systems in engineering labs face a tension between providing sufficient assistance and preserving learning opportunities. Existing systems typically offer instructors limited control over assistance timing, content, or cost. This paper describes a routing and governance system for LLM-based lab assistance comprising two components: Routiium, an OpenAI-compatible gateway that manages multiple LLM backends with configurable prompt modifications and usage logging, and EduRouter, a policy-aware routing service that enforces per-lab budgets, approval workflows, and embedding-based question matching. We evaluated the system using trace-driven simulation calibrated from two engineering labs (LED characterization, RC circuit analysis) and a 100-query replay through live models. In simulations, governed policies (P1/P2) increased challenge-alignment index from 0.90 to 0.98 and overlay-adherence score from 0.69 to 0.87 compared to ungoverned operation (P0). The productive-struggle window metric increased from 1.4 to 3.6 simulated turns before high-scaffold hints appeared. In the 100-query replay, EduRouter routed 75% of queries to a local model, reducing token costs by 66% (0.26 for all-premium routing) while maintaining canonical hit rate of 1.0 for the curated 89-intent question bank. We release Routiium, EduRouter, canonical-task tooling, and simulator configurations to support replication and future classroom studies.
Figures & tables
| System | Multi-model routing | Budget enforcement | Instructor approvals | Prompt/audit transparency |
|---|---|---|---|---|
| FrugalGPT [ 8 ] | ✓ | ✓ | — | — |
| RouteLLM [ 9 ] | ✓ | (varies) | — | — |
| ThriftLLM [ 10 ] | ✓ | ✓ | — | — |
| This work (Routiium+EduRouter) | ✓ | ✓ | ✓ | ✓ |
| Label | Definition | Governance behavior |
| L0 | Validation or minimal prompt | No approval required; conceptual framing |
| L1 | Guided troubleshooting hint | Overlay adds justification prompts |
| L2 | Worked example fragment | Requires budget debit; throttled after configurable retry count |
| L3 | Complete solution | TA approval required plus budget and frequency limits |
| P0 | Ungoverned | No spend limits, overlays disabled, no approvals |
| P1 | Governed | Per-turn spend limits, overlays enabled, L3 frequency caps |
| Field | Content |
|---|---|
| Routing rationale | Reason for model selection (e.g., “canonical match: RC circuit troubleshooting” or “budget limit enforced”) |
| Question match | Matched library entry IDs and similarity scores |
| Active overlay | Which prompt modifications were applied |
| Content fingerprint | Hash for verifying overlay application |
| Request trace ID | Link to equipment telemetry |
| Policy | |||||
|---|---|---|---|---|---|
| P0 (Ungoverned) | 0.90 | 0.69 | 1.45 | 5.20 | 0.59 |
| P1 (Governed) | 0.98 | 0.84 | 2.75 | 3.20 | 0.56 |
| P2 (Integrity) | 0.98 | 0.87 | 3.56 | 2.39 | 0.52 |
| Embedding | |||
|---|---|---|---|
| gte-large-en-v1.5 | 0.95 | 0.19 | 0.007 |
| bge-large-en-v1.5 | 0.95 | 0.17 | 0.012 |
| nomic-embed-text-v1.5 | 0.94 | 0.17 | 0.011 |
| bge-small-en-v1.5 | 0.93 | 0.15 | 0.015 |
| FastEmbed (edge) | 0.72 | 0.05 | 0.010 |
| Embedding off | 0.00 | 0.00 | 0.000 |
| Policy | Freeze TTL | |
|---|---|---|
| P0 (Ungoverned) | None | 0.00 |
| P1 (Governed) | 5 min | 0.49 |
| P2 (Integrity) | 30 min | 0.60 |
| Field | Meaning |
|---|---|
| session_id | Anonymous session identifier |
| lab_id | Micro-lab ( led_iv , rc_step ) |
| policy | P0 , P1 , or P2 |
| step_id | Current lab step key |
| hint_req / hint_granted | Request/grant events + level (L0–L3) |
| justification_len | Characters in student justification |
| Knob | Target / Rationale |
|---|---|
| Hint budgets | \mathrm{PSW}$ goals |
| Approvals | Two TAs (M/M/2) with p95 60 s decision latency |
| Overlay personas | Default “Socratic troubleshooting”; teacher can swap to “diagnostic” overlay in P2 |
| Boost/freeze | One-click teacher boost to premium tier; freeze TTL default 5 min (extendable to 30 min) |
| Integrity throttle | Block assistance when integrity_flag triggers for 3 consecutive turns |
| Canonical embedding | Enabled in P1/P2 via fastembed ; hashed fallback when privacy_mode= hashed |
| Metric | Interpretation |
|---|---|
| Challenge alignment (hint mix vs. targets) | |
| Overlay adherence (no-leakage rate) | |
| Productive-struggle window (steps before L2/L3) | |
| Instructor-influence latency (turns to take effect) | |
| Equity index ( on L3 allocation) | |
| Canonical hit rate (fraction with canonical match) |
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