Overview
The Agents page lets you create and manage model stacks - custom configurations that define how AI agents work together to handle your requests. Build multi-agent teams where a coordinator routes work to specialized experts, optimizing both quality and cost.
What Are Model Stacks?
A model stack is a user-defined configuration that combines:
- A coordinator agent (required) - handles all requests and routes to specialists
- Specialist agents (optional) - experts for specific tasks (research, coding, architecture, UI/UX)
- Context optimization - reduces tokens and costs while improving quality
- Per-agent model assignments - choose which LLM each agent uses
Think of it as building your own AI team where each member specializes in different areas and uses the model best suited for their role.
Key Features
Multi-Agent Teams
Combine coordinator with specialists for different workflows and use cases.
Cost Control
Assign cheaper models to specialists, expensive models only where needed.
Quality Optimization
Use appropriate models for each task - Opus for architecture, Sonnet for research.
Performance Analytics
Track latency, cost, and error rates per agent in each stack.
Available Agents
ModelStack provides six pre-configured agent roles:
| Agent | Role | Default Model | Best For |
|---|---|---|---|
| Coordinator | Main handler & router | Claude Sonnet 4.6 | Routing, synthesis, user interaction |
| Senior Architect | Architecture expert | Claude Opus 4.6 | System design, architectural decisions |
| Researcher | Technical research | Claude Sonnet 4.6 | Documentation, API exploration |
| Coder | Code generation | Claude Opus 4.6 | Writing production code |
| Reviewer | Code review | Claude Opus 4.6 | Quality checks, bug detection |
| Senior UI/UX | UI/UX design | Claude Opus 4.6 | Interface design, user experience |
| Senior Frontend | Frontend architecture | Claude Opus 4.6 | Frontend patterns, component design |
Each agent has specialized system prompts and capabilities tailored to their role. The coordinator is required; specialists are optional.
Creating a Model Stack
Step 1: Open Stack Creator
- Navigate to Dashboard → Agents
- Click New Agent button
- Stack configuration modal opens
Step 2: Configure Basic Settings
Stack ID (required):
- Unique identifier for this stack
- Format: lowercase letters, numbers, hyphens, dots
- Example:
code-review-strict,prototype-fast,docs-writer - Maximum 64 characters
- Used when making API calls:
"model": "your-stack-id"
Display Name (optional):
- Human-readable name for the dashboard
- Example: "Code Review (Strict)", "Fast Prototyping"
Step 3: Assign Coordinator
Coordinator Agent (required):
- Choose the model for your main coordinator
- This agent handles all user requests
- Decides when to consult specialists
- Synthesizes responses from multiple agents
Model Selection:
- Use Claude Sonnet 4.6 for balanced performance (recommended)
- Use Claude Opus 4.6 for maximum quality
- Use GPT-4o for vision capabilities
- Use GPT-4o-mini for cost optimization
Step 4: Add Specialists (Optional)
Add specialist agents based on your workflow needs:
For Code-Heavy Workflows:
- Add Coder - generates production code
- Add Reviewer - checks code quality
- Coordinator routes coding tasks to these specialists
For Architecture Work:
- Add Senior Architect - designs system architecture
- Add Researcher - explores technical options
- Coordinator consults them for big decisions
For UI/UX Projects:
- Add Senior UI/UX - designs interfaces
- Add Senior Frontend - implements frontend patterns
- Coordinator routes design/frontend tasks to them
You can add any combination of specialists. The coordinator will intelligently route requests based on the task type.
Response mode (per specialist):
Every specialist has a response mode, set on the node or in its side panel.
- Advise (default): the specialist's answer goes back to the coordinator as advice. The coordinator combines it with everything else it knows and writes the final response.
- Delegate: when the specialist gives a final answer, it is sent to the user exactly as written. The coordinator hands off and adds nothing. If the specialist needs more context, that request still goes through the coordinator first.
Only specialists can delegate; the coordinator always uses Advise.
Step 5: Configure Context Optimization
Choose how to reduce token usage while maintaining quality:
| Mode | How It Works | Best For |
|---|---|---|
| None | Full context sent to LLM | Small contexts, maximum accuracy |
| Compact | LLM rewrites query smaller | Medium contexts, balanced approach |
| Retrieve | AST-based semantic search | Large codebases, targeted retrieval |
| History Guard | Chunks old conversation | Long conversations, stateless |
| History Brain | Cross-request memory with dedup | Multi-session projects, stateful |
| Auto | Automatically selects best mode | Most use cases (recommended) |
Recommendations:
- Auto - Let the system choose (works for most scenarios)
- Retrieve - Large codebases with hundreds of files
- History Brain - Long-running projects with multiple sessions
- None - Short, one-off requests where token count isn't a concern
Step 6: Create Stack
Click Create Stack to save your configuration.
Your new stack is now available and can be used via API:
curl https://api.modelstack.cc/v1/chat/completions \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "your-stack-id",
"messages": [
{"role": "user", "content": "Design a user authentication system"}
]
}'
Managing Stacks
Viewing Your Stacks
The Agents page displays all your stacks in a list:
- Stack name - Display name or Stack ID
- Agents count - Number of agents in the stack
- Context mode - Current optimization setting
- Actions - View analytics, edit, or delete
Editing a Stack
- Click on a stack card
- Update display name, agents, or context mode
- Click Save Changes
Changing the Stack ID is not allowed after creation. If you need a different ID, create a new stack and delete the old one.
Deleting a Stack
- Click Delete on a stack card
- Confirm deletion
- Stack is permanently removed
Deletion is permanent and cannot be undone. API calls using this stack ID will fail after deletion.
Viewing Stack Analytics
Click View Analytics to see detailed performance metrics:
- Total requests - How many times this stack was called
- Average latency - Response time in milliseconds
- Total cost - Spending in millidollars
- Error rate - Percentage of failed requests
- Per-agent breakdown - Which agents were consulted and their performance
- Call graph - Visual map of agent interactions
- Cost breakdown - Spending by agent over time
Use Cases & Examples
Use Case 1: Code Review Workflow
Goal: Strict code review with architectural oversight
Configuration:
Stack ID: code-review-strict
Coordinator: Claude Sonnet 4.6
Specialists:
- Reviewer (Claude Opus 4.6) - High-quality code review
- Senior Architect (Claude Opus 4.6) - Architecture validation
Context Mode: Auto
How it works:
- User submits code for review
- Coordinator analyzes the submission
- Coordinator consults Reviewer for code quality
- Coordinator consults Senior Architect for design patterns
- Coordinator synthesizes feedback and returns comprehensive review
Cost optimization:
- Coordinator uses Sonnet (cheaper, handles routing)
- Specialists use Opus only when consulted (expensive but accurate)
Use Case 2: Fast Prototyping
Goal: Quick code generation for prototypes
Configuration:
Stack ID: prototype-fast
Coordinator: GPT-4o-mini
Specialists:
- Coder (Claude Sonnet 4.6) - Balanced speed/quality
Context Mode: Compact
How it works:
- User requests feature implementation
- Coordinator (fast, cheap) routes to Coder
- Coder generates code quickly
- Coordinator returns response
Cost optimization:
- GPT-4o-mini coordinator = 0.15/1M tokens input
- Only consults Coder when needed
- Compact mode reduces context tokens
Use Case 3: Documentation Writer
Goal: Research and write technical documentation
Configuration:
Stack ID: docs-writer
Coordinator: Claude Sonnet 4.6
Specialists:
- Researcher (Claude Sonnet 4.6) - Explores APIs and docs
Context Mode: Retrieve
How it works:
- User asks to document a system
- Coordinator consults Researcher to explore codebase
- Researcher uses AST retrieval to find relevant code
- Coordinator synthesizes documentation
Cost optimization:
- Both use Sonnet (balanced cost/quality)
- Retrieve mode searches codebase efficiently
- Avoids sending entire codebase to LLM
Use Case 4: UI/UX Design Sprint
Goal: Design and implement UI components
Configuration:
Stack ID: ui-design-sprint
Coordinator: Claude Opus 4.6
Specialists:
- Senior UI/UX (Claude Opus 4.6) - Interface design
- Senior Frontend (Claude Opus 4.6) - Component architecture
- Coder (Claude Sonnet 4.6) - Implementation
Context Mode: History Brain
How it works:
- User requests UI component design
- Coordinator consults Senior UI/UX for design
- Coordinator consults Senior Frontend for architecture
- Coordinator consults Coder for implementation
- History Brain remembers design decisions across sessions
Why premium models:
- UI/UX requires high-quality design thinking
- Frontend architecture needs deep React/component knowledge
- Only Coder uses Sonnet (implementation is more straightforward)
Best Practices
Cost Optimization
- Use Sonnet for coordinators - They handle simple routing tasks
- Use Opus for specialists - Only consulted when needed
- Enable context optimization - "Auto" mode works well for most cases
- Monitor analytics - Check which agents are called most, optimize their models
Quality Optimization
- Match agent to task - Use Coder for code, Reviewer for review, etc.
- Don't skip specialists - They significantly improve quality
- Use Opus for critical work - Architecture, security reviews, production code
- Use "History Brain" for projects - Remembers context across sessions
Workflow Design
- Start simple - Coordinator only, add specialists as needed
- Test iteratively - Create test stack, try different configurations
- Measure performance - Use analytics to validate improvements
- Name stacks clearly - Descriptive Stack IDs help team collaboration
Common Questions
Can I have multiple coordinators?expand_more
No, each stack has exactly one coordinator. The coordinator is the main handler that routes to specialists. If you need different coordination strategies, create multiple stacks.
What happens if I don't add specialists?expand_more
The coordinator handles everything alone. This works fine for simple use cases but may miss specialized expertise. For example, coordinator-only won't get code review quality of a dedicated Reviewer agent.
How does context optimization reduce costs?expand_more
Context optimization modes reduce the number of tokens sent to LLMs: - Compact - Rewrites query to be shorter - Retrieve - Sends only relevant code chunks - History Guard/Brain - Summarizes old conversation turns Fewer input tokens = lower cost per request.
Can I use non-Claude models?expand_more
Yes! You can assign any model from the catalog to any agent. For example, use GPT-4o for vision tasks, GPT-5 for reasoning, or Gemini 2.5 Pro for long context.
What's the difference between History Guard and History Brain?expand_more
History Guard is stateless - compacts context per request but doesn't remember across requests. History Brain is stateful - stores session memory in database, remembers decisions across multiple API calls. Use Brain for long-running projects.
Do I need to change my code to use stacks?expand_more
Minimal changes. Just change the model parameter: diff - "model": "claude-sonnet-4-6" + "model": "your-stack-id" Everything else stays the
same.
Related Documentation
- API Reference - Using stacks in API requests
- Billing & Balance - How stack usage affects spending caps
- Models - Browse available models for agents
- Settings - Configure model routing and preferences