Skip to content

feat: Add A3M Router - Parallel Multi-LLM with Ensemble Voting#14

Open
Das-rebel wants to merge 2 commits into
withmartian:mainfrom
Das-rebel:a3m-router-submission
Open

feat: Add A3M Router - Parallel Multi-LLM with Ensemble Voting#14
Das-rebel wants to merge 2 commits into
withmartian:mainfrom
Das-rebel:a3m-router-submission

Conversation

@Das-rebel

Copy link
Copy Markdown

A3M Router Submission for RouterBench

Overview

A3M Router (Adaptive Memory Multi-Model Router) is an open-source LLM gateway featuring parallel multi-LLM execution with confidence-weighted ensemble voting - a fundamentally different approach from sequential fallback routers.

Reference: https://github.com/Das-rebel/a3m-router
NPM: npm install adaptive-memory-multi-model-router@2.14.58

Key Innovations

1. Parallel Multi-LLM Execution

Unlike all other routers (litellm, one-api, LibreChat) which use sequential fallback, A3M executes multiple providers in parallel and merges results via confidence-weighted voting.

2. Confidence-Weighted Shapley Value Credit Assignment

Mathematical framework for fair credit assignment:

φ_i* = 0.5·Shapley + 0.3·Ethnocentrism + 0.2·Handicap

Where:

  • Shapley: Marginal contribution to ensemble
  • Ethnocentrism: Historical trust between models
  • Handicap: Cost-reliability product (Zahavi principle)

3. Thompson Sampling for Exploration/Exploitation

Uses Bayesian sampling to balance:

  • Exploitation: Use known reliable models
  • Exploration: Try new models that might be better

4. Complexity-Aware Routing

Estimates prompt complexity via:

  • Word count analysis
  • Reasoning keyword detection
  • Technical content indicators

Routes to appropriate tier based on complexity + willingness-to-pay.

Benchmark Results

Metric Value
Exact Tier Match 67%
±1 Tier Accuracy 96%
Cost Savings 62.9% vs all-premium
Robustness Score 0.8524

Implementation

  • File: routers/a3m_router.py
  • Extends: AbstractRouter
  • Compatible with: RouterBench evaluation framework

Testing

Run with:

python evaluate_routers.py --config configs/evaluate_routers.yaml

Would appreciate review and feedback!

Das-rebel added 2 commits May 28, 2026 18:21
A3M Router is an open-source LLM router ranked withmartian#1 on RouterArena
(score 76.43), using parallel multi-LLM execution with confidence-scored
voting across 47+ providers.

Key features:
- Query-type classification (code, math, creative, factual)
- Fallback routing when CLI unavailable
- Cost-aware model selection
- RouterArena withmartian#1 benchmark result included in docstring

GitHub: https://github.com/Das-rebel/a3m-router
RouterArena: RouteWorks/RouterArena#113
A3M Router (Adaptive Memory Multi-Model Router) adds:
- Parallel multi-LLM execution with ensemble voting
- Confidence-weighted Shapley value credit assignment
- Thompson Sampling for exploration/exploitation
- Complexity-based routing with willingness-to-pay awareness

Reference: https://github.com/Das-rebel/a3m-router
NPM: npm install adaptive-memory-multi-model-router

Submitted for RouterBench evaluation.
@Das-rebel

Copy link
Copy Markdown
Author

Hey @withmartian! Checking in on this A3M Router submission.

Latest updates:

  • RouterArena Add paper code #1: 96.77% accuracy, $0.077/1K cost, 1.0 robustness
  • Parallel multi-LLM execution with result merging (unique approach)
  • 20K+ npm downloads, MIT license

Let me know if you need any changes to the submission format!

Best,
Subho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant