r/opencode • • 2d ago

Help with setups that mix API with local AI agents?

I've tried OpenCode and like it a lot as a harness, both for API usage and running local models.
Right now my process uses DS4.1FLASH1017 (API) for spec and review, with local Q3.8FN through Basalt for coding, but it's a manual swap. I haven't really figured out a way to assign the local model to the API model as a subagent.

I remember dsh had a method to do that, but I stopped using it for a variety of other reasons.
It'd be even better if I could assign it a number of specialized local models and It'd just spawn the agents it needs, like a crazy fast embeddings model, or a low temp small model for bash tasks.

2 Upvotes

3 comments sorted by

1

u/AggressiveMonk 2d ago

Just tell it to spawn subagents with the model name and it'll do it. You can specify it in your agents.md tok

1

u/gabriel-carvalho9 1d ago

Does that work with local providers too? A minimal agents.md example with the provider/model ID would show how the local model gets resolved.

1

u/AggressiveMonk 1d ago

It does. Just have a mention in agents.md that no work should be done in main thread and all work should be spun up in subagents using whichever local model you specify. In my case it's omlx/Qwen. If in doubt you can just ask opencode to give you the slug