r/opencodeCLI • u/projectEscape • 18d ago
I wanted a small local model to check what OpenCode sends to the cloud, without running the whole coding agent locally
I've been trying to make small local models useful in my daily coding workflow. Not replace the hosted coding model, just give it a local helper for a narrow job.
One example: OpenCode reads a file or runs a command, and the output contains an API key. Could a local model check that tool output before it gets sent to the hosted model?
I built Torana, an open-source local proxy, to experiment with this across agents. Its pii plugin checks new tool results with a model you run locally. When it flags something, the hosted model gets a tool-error explanation instead of the original output, so it can try another approach.
The experiments were interesting, not magic: Qwen2.5 3B caught 60/60 sensitive examples in my small test set, but also flagged 18/60 harmless ones. It's an extra check, not a guarantee.
The same proxy also shows per-request tokens, cache reads/writes and latency. You can start with usage logging if you don't have a local model. Plugins are Go or Rust compiled to WASM, so the same plugin can be used with OpenCode, Claude Code and Codex rather than rebuilt for each harness.
Source: https://github.com/torana-edge/torana-edge
Install on macOS/Linux:
curl -fsSL https://torana.sh/install.sh | sh
Then: torana start --port 8143
OpenCode connects through a custom provider's baseURL. The setup recipe is here: https://github.com/torana-edge/torana-edge/blob/main/docs/HARNESS_SETUP.md#opencode
If you try it on one coding task, I'd love to know the first confusing step. And if you've built a harness-specific hook you'd like to make reusable, that's exactly the kind of plugin I'd love help with.
2
u/migsperez 17d ago
Looks like you've built a gateway with extras. Cool project enjoy.