Here's a simple way for Claude Code users to switch from the costly Claude models to the newly released SOTA open-source/weights coding model, Qwen3-Coder, via OpenRouter using LiteLLM on your local machine.
This process is quite universal and can be easily adapted to suit your needs. Feel free to explore other models (including local ones) as well as different providers and coding agents.
I'm sharing what works for me. This guide is set up so you can just copy and paste the commands into your terminal.
1. Clone the official LiteLLM repo:
git clone https://github.com/BerriAI/litellm.git