What SLMs do well for routing
- Turn messy inputs into constraints: Parse tickets/notes like “overflowing green cart behind the clinic before 10am” into clean, solver‑ready JSON.
- Dynamic exception handling: When cameras/sensors flag contamination, blocked alleys, odor hot spots, or safety incidents, the SLM triages and emits a small patch (insert/skip/reorder/swap) for re‑optimization.
- Driver copilot: Natural‑language Q&A (“Can I service 412 Oak before school opens?”), SOP lookups, and hands‑free notes.
- Policy guardrails: Check reroutes against time windows, school zones, noise ordinances, axle/weight, and depot cutoffs; explain violations.
- Explainability & after‑action: Summarize detours and incidents; create missed‑pickup and contamination reports.
Architecture (fast & cheap)
| Tier | What runs here | Notes |
|---|---|---|
| Edge (on‑truck) | 1–3B SLM (quantized) for triage, SOP lookups (local RAG), driver messages; sensor fusion with GNSS/IMU, cameras, scales, VOC, CO, temp. | Low latency; privacy‑preserving (event clips & features only). |
| Cloud/Depot | Bigger SLM optional: clean backlogs, what‑if analysis, post‑shift summaries; long‑horizon planning & analytics. | Batch workloads; integrates CRM/311. |
| Optimizer + Maps | CVRP/VRPTW solving, ETAs, routing on OSRM/Valhalla; LNS/local search. | SLM calls these tools; it doesn’t replace them. |
| Comms | MQTT/HTTPS telemetry, depot Wi‑Fi offload, LTE/5G for live patches. | Idempotent, auditable APIs. |
Handoff JSON Schemas (SLM ↔ Optimizer)
1) Stop schema (normalized)
{
"id": "STOP-12345",
"address": "412 Oak St, Springfield",
"lat": 37.7712,
"lon": -122.4312,
"service_type": "organics", // trash | recycling | organics | bulky | special
"duration_min": 4,
"time_window": ["08:00", "10:00"], // local time, 24h
"priority": "high", // low | normal | high
"hard": true, // hard = must‑serve in window
"constraints": {
"access": ["alley"], // alley | school_zone | gated | ...
"noise_window": ["07:00", "21:00"],
"axle_weight_max_kg": 9000
},
"attachments": [
{"type":"note","text":"Behind the clinic"},
{"type":"photo","url":"https://…/ticket123.jpg"}
]
}
2) Vehicle schema (excerpt)
{
"id": "TRUCK-12",
"start_depot": "DEPOT-A",
"capacity_kg": 9500,
"streams": ["trash","recycling","organics"],
"payload_kg": {"trash": 1800, "recycling": 400, "organics": 0},
"shift_window": ["06:00","15:00"],
"features": ["split_body","rfid_reader","hopper_cam"]
}
3) Patch schema (small reroute)
{
"patch_id": "PATCH-2025-10-05-1",
"vehicle_id": "TRUCK-12",
"type": "insert_stop", // insert_stop | skip_stop | reorder | swap_vehicle | block_edge
"payload": {
"stop": <STOP JSON>,
"position_hint": "after:STOP-9876",
"valid_for_min": 30
},
"audit": {"reason":"blocked alley","source":"driver_voice","evidence":["photo:..."]}
}
Tool API pattern (called by the SLM)
geocode(address)→ lat/lon + rooftop/parcel match.get_eta(vehicle_id, stop)→ ETA + policy conflicts.insert_stop(patch)/skip_stop(patch)/swap_vehicle(patch).check_policy(route|patch)→ violations (noise window, school‑zone, axle/weight, depot cutoff).solve_patch(patch)→ returns updated sequence + ETAs.notify_driver(vehicle_id, message, rich_link)→ cab device.
Example prompts (drop‑in)
A) Free‑text ticket → normalized stop
System: You convert messages into a normalized JSON “stop” using the Stop schema. If info is missing, set nulls and add a note.
User: "Urgent: overflowing green cart behind the community clinic at 412 Oak St. please pick up before 10am. Use the alley."
Assistant (JSON only): {...}
B) Exception triage → patch
System: Create a small reroute patch. If policy conflicts exist, set type="swap_vehicle" and explain in the audit.
User: "Alley blocked at 102 Pine — grabbed photo. Can’t reach STOP-7781."
Assistant (JSON only): {...}
C) Driver copilot (voice)
System: Answer briefly. Use tool calls for ETAs/policy. Include a single actionable sentence for the driver.
User: "Can I hit 412 Oak before school starts?"
Assistant: "Yes—arrive 07:42, within noise window. Reordering two stops now; you’ll see it in the cab."
D) After‑action explanation
System: Summarize why Route 12 exceeded plan by <delta>. Correlate traffic, contamination inserts, and compactor cycles; propose two fixes.
KPIs you can move
- On‑time‑in‑window ↑, missed‑pickups ↓, deadhead miles ↓.
- Contamination callbacks ↓, driver contacts per shift ↓.
- Explainability: % of exceptions with clear rationale and audit trail.
Sources & Building Blocks
- Google OR‑Tools — Vehicle Routing (VRP/VRPTW, LNS/local search).
- OSRM • Valhalla (open‑source routing/ETAs).
- MQTT (lightweight pub/sub for telematics & patches).
- Whisper (on‑device ASR, tiny models) • llama.cpp (edge SLM runtime) • MLC‑LLM (cross‑device deployment).
- Dynamic VRP background (survey): arXiv: Dynamic VRP survey.