sleeplesshan/token-router
78 stars · Last commit 2026-06-18
Lossless local line routing for massive logs, source files, and agent-context references before they reach Claude Code or Codex.
README preview
# token-router <!-- Badge placeholders --> [](LICENSE)    **Lossless local line routing for massive logs, source files, and routeable agent-context references before they reach a cloud reasoning model.** `token-router` is a Codex skill and standalone Python router that uses a local Ollama model to identify exact line ranges in oversized files, then returns the raw, unmodified slices to a high-reasoning cloud model such as GPT-5.5, o3, or another AI coding agent. ## Executive Summary Large logs, legacy source files, and long agent instruction references are expensive context. Sending a 2,000+ line deployment log, monolithic source file, or routeable project-rules document directly to a cloud LLM can waste tokens, increase latency, and exhaust budgets before the model reaches the evidence that matters. `token-router` solves this with a hybrid separation-of-concerns architecture: - **Local model for search and triage:** Gemma 4 via Ollama runs on the user's machine and scans large files for relevant line coordinates. - **Cloud model for reasoning:** GPT-5.5, o3, or another cloud model receives only raw high-density evidence slices and applies deep reasoning where it matters.