CLI Delegation
Agents Squads enables multi-LLM support by delegating to native provider CLIs. No SDK integrations needed—just shell out toclaude, gemini, codex, grok, etc.
Check Available Providers
Run with Specific Provider
Provider Resolution
The CLI resolves providers in this order:- Agent frontmatter -
provider:field in the agent’s .md file - CLI flag -
--provider=deepseek - Squad default -
providers.defaultin SQUAD.md - Fallback -
anthropic
File-Based Executors
Some providers run as file-based executors. DeepSeek (added in v0.8.0) delegates toaider: the executor reads and edits files and the result is committed, but it runs no shell commands and has no web access. File-based executors fit validators, formatters, and summarizers — agents whose job is read files → write files.
Executor output is harvested from an isolated git worktree, so completed work is never lost even if the run ends abnormally. Every provider run is recorded in observability (squads exec list) with real token and cost figures parsed from the executor’s output.
Configuration
Squad-Level Providers
Configure default providers in SQUAD.md frontmatter:Agent-Level Override
Override the provider for specific agents:- Frontmatter
- Header
Supported CLIs
Environment Variables
Each CLI reads its own API keys:Why Use Multiple LLMs?
Different LLMs excel at different tasks. A well-designed agent system can leverage:- Claude - Complex reasoning, nuanced analysis, long context
- GPT-4 - General purpose, wide knowledge, tool use
- Gemini - Multimodal, Google ecosystem integration
- Grok - Real-time data, X/Twitter integration
- Llama/Open models - Privacy, self-hosting, cost control
Provider Comparison
Model Tiers (Within Providers)
Each provider offers different capability tiers:- Anthropic (Claude)
- OpenAI
- Google
- xAI
Squad Configuration
Agent-Level Provider Selection
Assign different providers to different agents:Environment Configuration
Set up API keys for each provider:Provider Selection Per Agent
No SDK code to write — setprovider:/model: in the agent’s frontmatter and
squads run shells out to that CLI instead:
- Claude
- OpenAI
- Gemini
- Grok
Routing Patterns
Task-Based Routing
Route tasks to the best provider:Cascade Pattern
Start cheap, escalate when needed:1
Start cheap
Gemini Flash (fastest, cheapest)
2
If insufficient
Escalate to Claude Sonnet
3
If still insufficient
Escalate to Claude Opus
Consensus Pattern
Use multiple providers for critical decisions:Critical Decision → Run in parallel across Claude, GPT-4o, and Gemini → Voting/Synthesis → Final Answer
Cost Optimization
Price Comparison (approximate per 1M tokens)
Prices change frequently. Check provider pricing pages for current rates.
Cost Strategy
Implementation Examples
Multi-Provider Squad
The squad-levelproviders: block sets the default; each agent’s own
frontmatter overrides it for that agent specifically:
.md file carries the provider:/model: frontmatter shown
in Provider Selection Per Agent above — the
table here is just the roster view.
The CLI Is the Abstraction
There’s no adapter layer to build —squads itself is the unified interface.
Set providers.default (and per-purpose overrides) once in SQUAD.md, as
shown in Squad-Level Providers above, and every
agent in the squad resolves its provider through the same precedence chain
(frontmatter → --provider flag → squad default → anthropic fallback) with
no code on your side.
Best Practices
- Match provider strengths to task requirements
- Use cheaper models for high-volume, simple tasks
- Reserve expensive models for complex reasoning
- Monitor costs per provider (
squads exec list,squads usage) - Set
providers.defaultat the squad level so switching is a one-line edit
Related
Token Economics
Optimize costs across providers
Agent Parallelization
Run multi-provider agents concurrently