Comment by mewse-hn
2 hours ago
I was looking into something similar because I wanted to test a local model for doing basic coding and smart model (deepseek) for planning.
It's basically not possible with claude code, the api endpoint is a single environment variable and whatever models are on that endpoint are what's available.
HOWEVER, if you run a proxy like LiteLLM, you can configure it to send requests to different api endpoints on the back end and expose them as different "models" on the front end, then configure claude code to switch between those virtual models.
Found this: https://github.com/farion1231/cc-switch
It allows for switching models in Claude Code.
Right that says it has a proxy feature so it can probably do what I was describing with LiteLLM