Mixture of Agents (MoA): Designing a Virtual Model Provider
Moving Mixture of Agents from a hard-coded tool to a virtual model provider makes multi-model workflows easier to select, route, and govern. This article examines the architecture, usage patterns, and engineering practices behind that transition, including parallel execution, context budgets, fallback policies, evaluation, security, and observability. It explains how to balance quality gains against cost and latency without assuming that aggregation always outperforms a single model.
Mixture of Agents (MoA): Designing a Virtual Model Provider
Mixture of Agents (MoA) is not a new concept, but its implementation in agent runtimes is evolving from a prompting technique into an infrastructure abstraction. Early implementations often hard-coded reference models, aggregation models, and call sequences into a particular platform or tool. This made experiments difficult to reproduce, costs difficult to control, and models difficult to replace.
The value of newer designs is not simply that they call more models. It is that they expose MoA as an independent virtual model provider, allowing multi-model presets to be selected, routed, and governed much like ordinary models. This article explores the design rationale, implementation requirements, and practical guidelines for that approach.
1. From a Hard-Coded Tool to a First-Class Model
In older implementations, MoA often appeared as a special tool or command. Once triggered, the runtime sent a request to several fixed models and used a fixed aggregation model to combine their responses.
Reference and aggregation models were frequently tied to an external platform, with model lists, billing arrangements, and authentication paths embedded in the implementation. This created three problems for developers:
- Replacing reference models required code or configuration changes.
- Using a private inference gateway, cloud-hosted model service, or local model required additional integration.
- MoA calls behaved differently from ordinary model calls in their handling of conversation context, tool use, and follow-up requests, making the capability difficult to deliver reliably.
The virtual model provider abstraction promotes an MoA preset to a first-class model entity. Externally, it exposes the same invocation contract as an ordinary model. Internally, it orchestrates a set of reference models and an aggregation model.
Instead of a special button, the model selector offers a selectable preset. A conversation can switch to that preset, or an individual request can use it temporarily. MoA becomes part of the runtime’s model-routing layer rather than a separate tool path.
The immediate benefit is provider independence: reference models and the aggregation model can come from different sources, provided the runtime has the required adapters and authentication configuration.
A virtual model provider is more than another API wrapper, however. It must address message normalization, parallel scheduling, context budgets, failure recovery, response aggregation, tool-call compatibility, and multi-turn state management. These capabilities are necessary for an MoA preset to participate reliably in an agent conversation.
2. Architecture: Parallel Reference Models and an Aggregation Model
An MoA preset typically has three stages:
- Reference generation: The same user request is sent to multiple reference models, each independently producing an analysis, draft, or candidate answer.
- Aggregation: An aggregation model reads the original question and reference outputs, removes duplication, corrects errors, weighs conflicting information, and synthesizes a response.
- Presentation: The final answer is returned as a standard model response, with metadata retained for monitoring and follow-up interactions.
Implementing this flow requires several components:
- Preset parser: Reads the reference model list, aggregation model, concurrency limit, budget limits, timeouts, and fallback policies.
- Parallel scheduler: Controls concurrent reference calls and handles timeouts, rate limits, partial failures, and retries.
- Context manager: Trims conversation context where appropriate, preventing every reference model from receiving the entire conversation and driving up costs.
- Aggregator: Builds the aggregation prompt and instructs the aggregation model to produce a final answer from the reference outputs while explicitly resolving conflicts.
- Result validator: Checks output format, tool-call intentions, citation consistency, and compliance with safety policies.
- Observability layer: Records reference-model latency, token usage, failure reasons, aggregation latency, and feedback on final-answer quality.
The following configuration illustrates the concepts. It is not an actual interface for any specific product.
# Conceptual example, not an actual interfacemoa_preset:id: "balanced-moa"mode: "virtual_model_provider"reference_models:- ref_model_1- ref_model_2- ref_model_3aggregator_model: agg_model_1concurrency: 3budget:max_total_tokens: 32000max_reference_tokens_each: 6000timeout_ms: 45000fallback:on_partial_failure: "continue_with_available"on_all_failure: "single_model_fallback"observability:log_reference_outputs: "redacted"record_latency: true
The key principle is that MoA presets should be declarative. Model combinations, budgets, concurrency, and fallback policies should be configurable, versioned, and suitable for staged rollout—not scattered across code branches.
3. Usage Patterns: Conversation, Request, and Routing Levels
A virtual model provider supports three main usage patterns.
Conversation-Level Use
A user selects an MoA preset as the default model for a conversation. Subsequent turns, tool interactions, and follow-up requests continue to use it.
The runtime must maintain consistent conversation state. It needs clear rules for whether reference models share history, how the aggregation model receives tool results, and whether a failed turn affects later turns.
Per-Request Use
MoA is enabled temporarily for a complex question, after which the conversation returns to an ordinary model. This suits cost-sensitive workflows that need an occasional improvement in response quality.
The priorities are isolation and an explicit request budget.
Routing-Level Use
A higher-level policy decides whether to use MoA based on task type, input length, risk level, and available budget. It also selects the reference model combination and aggregation model.
This mode requires explainable routing decisions and reliable fallback behavior.
Each pattern places different demands on the runtime. Conversation-level use emphasizes state continuity and stable latency. Per-request use emphasizes isolation and budgeting. Routing-level use emphasizes policy transparency and recovery.
Define a clear task profile for each preset—for example, complex analysis, design review, code review, or long-document summarization. Enabling MoA for every request can quickly erode its benefits through the cumulative cost of multiple model calls.
4. Balancing Cost, Latency, and Quality
MoA inherently adds cost and latency. Multiple reference calls followed by an aggregation call usually consume more tokens and have higher tail latency than a single-model request.
A virtual model provider does not eliminate this trade-off. It makes it configurable, observable, and easier to optimize.
Cost Control
Cost can be managed at four levels:
- Tiered reference models: Not every task needs powerful reference models. Lightweight models can handle initial screening, with stronger models reserved for cases with high uncertainty.
- Context budgets: Set independent input limits for each reference model rather than repeatedly sending the complete conversation.
- Caching and reuse: Cache stable prefixes, system instructions, and tool descriptions to reduce repeated charges where caching is supported.
- Aggregation constraints: Ask the aggregation model to return only the final answer or structured differences, avoiding unnecessary expansion that inflates output-token usage.
Latency Control
Parallel execution reduces elapsed time, but waiting for every reference response makes the slowest model determine the reference stage’s tail latency.
A practical approach is to set a soft deadline. Once the threshold is reached, the runtime stops waiting and lets the aggregation model proceed with the available results. A minimum reference count should also be defined. If too few responses are available, the runtime falls back to a single model rather than attempting an inadequately supported aggregation.
Quality Control
The aggregation prompt should explicitly require the model to resolve conflicts, acknowledge uncertainty, and preserve verifiable supporting evidence. Simply joining multiple answers together is not meaningful aggregation.
5. Evaluation and Staged Rollout: Aggregation Is Not Always Better
MoA gains depend heavily on the task distribution, diversity of reference models, and capabilities of the aggregation model. Reported internal evaluation gains establish benefits only for the tested model combination and task set; they should not be treated as a universal result.
Production adoption requires an evaluation loop with a fixed task set, scoring criteria, and budget accounting. Compare a single-model baseline against different reference-model combinations and aggregation strategies across quality, cost, and latency.
At a minimum, track:
- Final-answer accuracy or human preference win rate.
- Token cost per task.
- P95 latency.
- Failure rate.
- Consistency between reference outputs and the aggregated answer.
- Tool-call success rate.
Begin staged rollout with low-risk tasks that can be rolled back easily. Monitor cost trends and quality feedback before expanding usage.
For tasks with strongly deterministic outcomes, a single model plus validation may be more economical. For open-ended analysis, the diversity of reference responses may provide greater value.
6. Security, Permissions, and Observability
MoA distributes requests across multiple model sources, so data boundaries and permissions must be designed upfront.
Reference models may operate in different network domains, while the aggregation model may see all reference outputs. The runtime therefore needs explicit rules for:
- Which data may be sent to reference models.
- Which data may be exposed only to the aggregation model.
- Whether logs require redaction.
- Whether intermediate outputs are retained.
Tool use requires particular care. Reference models should not directly execute tools with side effects. Tool execution should be centralized in a controlled stage after aggregation, or tool-call intentions should undergo unified runtime validation.
Observability is a requirement for a virtual model provider, not an optional addition. Record the preset version, reference model list, latency and token usage for each stage, failure and fallback reasons, and summaries of aggregation inputs and outputs.
Without this metadata, it is difficult to attribute MoA’s benefits and costs or diagnose production failures.
7. Conclusion
Moving MoA from a hard-coded tool to a virtual model provider turns multi-model collaboration from an experimental technique into a runtime capability.
The benefit is not merely a larger number of model calls. It is greater freedom in model composition, consistent routing, and configurable governance.
Three principles should guide implementation: declarative presets, explicit budgets, and continuous evaluation. Only with an observable balance among cost, latency, quality, and security can MoA become a sustainable infrastructure capability rather than a workflow that merely appears more powerful.
