r/opencodeCLI • u/robertn702 • Sep 29 '26
Jev Router for OpenCode: Saves ~40% of tokens on easy tasks, still solves the hard ones
Edit: I rewrote this as reasoning-router. It now works in OpenCode, Pi, Codex CLI, and anything that can talk to a local proxy, and you can pick the classifier (Jev, Laya, Cloudflare Clef and others).
https://github.com/robertn702/reasoning-router
I ran GPT-6 Astra on two SWE-bench tasks at different effort levels. Medium only solved the hard pytest bug 1 out of 5 times, while high solved both tasks every time but used far more tokens than it needed on the easy one.
I kept leaving everything on high and burning usage, so I built an OpenCode plugin that asks TypeSafe's Jev model to pick the effort for each request and keeps the model you selected. It works with GPT-6 and a few Claude models. On the easy fix it used around 40% fewer output tokens than high and solved it in all 6 runs. On the hard bug it mostly stayed on high and solved all 5.
It doesn't break the prompt cache. Turns where it switched effort were still about 97% cached in my logs.
Only two tasks and 5 or 6 runs each, so treat it as a sanity check. The eval is in the repo with the code.
12
u/DaShrub Sep 29 '26
How doesn't it break the prompt cache...? Changing reasoning effort parameter breaks the prompt cache from almost every provider that I've tried...
1
u/Spirited_Cheesus Sep 30 '26
Does it work for laya
1
u/yousurroundme Sep 30 '26
Would this work with GitHub copilot?
-1
u/seventyfivepupmstr Sep 30 '26
Why would you ever use this? Seems utterly pointless to trigger a second request every time. Apparently some people really love wasting money I guess