OpenCode plugin saves tokens by sending coding to a cheaper model

An plugin splits work between a main model and a cheaper to reduce token use. The main model handles thinking, planning, and review, while the cheaper l writes the actual code. After the finishes, the result goes back to the main model for review.

Small or simple edits can still be handled directly by the main model, so the system does not delegate every task. One setup uses GLM5.2 for thinking and free for coding. Installation uses ` plugin -plugin-code-model@latest`, then `/code_model` or `/cm` inside selects the .

It works as a plugin, so does not need to be changed.

Key points

  • The main model handles planning and review.
  • A cheaper l handles the actual coding work.
  • Small edits can stay with the main model instead of being .
  • The can be changed with `/code_model` or `/cm`.
  • The setup is a plugin and does not require changing .
Read original