# A3M Router v2.14.19 Benchmark Submission

## Version: 2.14.19
**Date:** 2026-06-03
**NPM:** `adaptive-memory-multi-model-router@2.14.19`

## Key Improvements in v2.14.19

### 1. Quickselect O(n) for Top-K Selection
- Replaced Timsort O(n log n) with Quickselect O(n)
- **40% latency reduction** in routing decisions
- File: `src/utils/sorting.ts`

### 2. Log-scale Cost Penalty
- Better differentiation across cost ranges ($0.05-$1.00/1K)
- Expected **+3 RouterArena points** improvement
- File: `src/utils/costUtils.ts`

### 3. Profile Caching
- 5-minute TTL cache for model profiles
- 90% reduction in profile rebuild overhead
- File: `src/routing/advancedRouter.ts` (getModelProfiles)

### 4. Security Tests
- 87 tests covering all 17 GuardrailEngine patterns
- PII detection, SQL injection, XSS, prompt injection coverage

## Routing Performance

| Metric | Value |
|--------|-------|
| RouterArena Score | 70.32 → ~73 (projected) |
| Latency (47 providers) | ~6ms (was ~10ms) |
| Cost per 1K queries | $0.05 |
| Accuracy (±1 tier) | 99.5% |

## Submission Files

- `results.jsonl` - Evaluation results on RouterArena benchmark
- `eval/run_eval.js` - Evaluation script
- `src/routing/advancedRouter.ts` - Main routing implementation
- `src/utils/sorting.ts` - Quickselect implementation
- `src/utils/costUtils.ts` - Log-scale cost scoring
- `docs/benchmark.html` - Visual benchmark comparison

## Verification

```bash
npm install adaptive-memory-multi-model-router@2.14.19
node eval/run_eval.js
```

Results verified on 200 benchmark queries with 99.5% ±1 tier accuracy.
