I run a Matrix server with federation turned off. My agents hang off that, and uses an abstraction over Anthropic + OpenAI + Kimi + GLM5 + OpenRouter with fallbacks if the preferred model for a given agent isn't available for whatever reason. Eventually I'll probably add some self-hosted open weight models in the mix, but for now this is more than enough resilience.
The foundations for the agents themselves is a few hundred lines of easily auditable code written by Kimi.