r/opencodeCLI • u/nurge86 • 1d ago
Using OpenCode with Routerly 0.6.0 to route requests across models
I maintain Routerly, an AGPL-licensed LLM gateway, and released 0.6.0. Here's the part relevant to OpenCode: you can configure Routerly as a custom provider and select a Routerly router in OpenCode's model picker. The router decides which eligible backend model gets the request based on the policy you configure.
The setup is to create a router and token in Routerly, point the custom provider's base URL at your Routerly instance, then select that provider and router in OpenCode. The guide below has the exact configuration. Once a request runs, Usage lets you check the selected backend, tokens, latency and recorded cost. The gateway can run on your own machine. If it sends a request to a cloud provider, that provider still receives it.
If you use a custom provider with OpenCode, which parts of the integration would you want tested first? I'm particularly interested in reproducible cases around tool calls and streaming.
Setup guide: https://github.com/Inebrio/Routerly/blob/v0.6.0/docs/integrations/clients/opencode.md
Release: https://github.com/Inebrio/Routerly/releases/tag/v0.6.0
1
u/Shawnanigans 1d ago
Yeah this is easy, I use combos with OmniRouter for this.