# OmniRoute Auto-Combo Engine (เน„เธ—เธข) ๐ŸŒ **Languages:** ๐Ÿ‡บ๐Ÿ‡ธ [English](../../../../docs/AUTO-COMBO.md) ยท ๐Ÿ‡ธ๐Ÿ‡ฆ [ar](../../ar/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ง๐Ÿ‡ฌ [bg](../../bg/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ง๐Ÿ‡ฉ [bn](../../bn/docs/AUTO-COMBO.md) ยท ๐Ÿ‡จ๐Ÿ‡ฟ [cs](../../cs/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฉ๐Ÿ‡ฐ [da](../../da/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฉ๐Ÿ‡ช [de](../../de/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ช๐Ÿ‡ธ [es](../../es/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡ท [fa](../../fa/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ซ๐Ÿ‡ฎ [fi](../../fi/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ซ๐Ÿ‡ท [fr](../../fr/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡ณ [gu](../../gu/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡ฑ [he](../../he/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡ณ [hi](../../hi/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ญ๐Ÿ‡บ [hu](../../hu/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡ฉ [id](../../id/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡น [it](../../it/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฏ๐Ÿ‡ต [ja](../../ja/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฐ๐Ÿ‡ท [ko](../../ko/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡ณ [mr](../../mr/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฒ๐Ÿ‡พ [ms](../../ms/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ณ๐Ÿ‡ฑ [nl](../../nl/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ณ๐Ÿ‡ด [no](../../no/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ต๐Ÿ‡ญ [phi](../../phi/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ต๐Ÿ‡ฑ [pl](../../pl/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ต๐Ÿ‡น [pt](../../pt/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ง๐Ÿ‡ท [pt-BR](../../pt-BR/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ท๐Ÿ‡ด [ro](../../ro/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ท๐Ÿ‡บ [ru](../../ru/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ธ๐Ÿ‡ฐ [sk](../../sk/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ธ๐Ÿ‡ช [sv](../../sv/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฐ๐Ÿ‡ช [sw](../../sw/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡ณ [ta](../../ta/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ฎ๐Ÿ‡ณ [te](../../te/docs/AUTO-COMBO.md) ยท ๐Ÿ‡น๐Ÿ‡ญ [th](../../th/docs/AUTO-COMBO.md) ยท ๐Ÿ‡น๐Ÿ‡ท [tr](../../tr/docs/AUTO-COMBO.md) ยท ๐Ÿ‡บ๐Ÿ‡ฆ [uk-UA](../../uk-UA/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ต๐Ÿ‡ฐ [ur](../../ur/docs/AUTO-COMBO.md) ยท ๐Ÿ‡ป๐Ÿ‡ณ [vi](../../vi/docs/AUTO-COMBO.md) ยท ๐Ÿ‡จ๐Ÿ‡ณ [zh-CN](../../zh-CN/docs/AUTO-COMBO.md) --- > Self-managing model chains with adaptive scoring ## How It Works The Auto-Combo Engine dynamically selects the best provider/model for each request using a **6-factor scoring function**: | Factor | Weight | Description | | :--------- | :----- | :---------------------------------------------- | | Quota | 0.20 | Remaining capacity [0..1] | | Health | 0.25 | Circuit breaker: CLOSED=1.0, HALF=0.5, OPEN=0.0 | | CostInv | 0.20 | Inverse cost (cheaper = higher score) | | LatencyInv | 0.15 | Inverse p95 latency (faster = higher) | | TaskFit | 0.10 | Model ร— task type fitness score | | Stability | 0.10 | Low variance in latency/errors | ## Mode Packs | Pack | Focus | Key Weight | | :---------------------- | :----------- | :--------------- | | ๐Ÿš€ **Ship Fast** | Speed | latencyInv: 0.35 | | ๐Ÿ’ฐ **Cost Saver** | Economy | costInv: 0.40 | | ๐ŸŽฏ **Quality First** | Best model | taskFit: 0.40 | | ๐Ÿ“ก **Offline Friendly** | Availability | quota: 0.40 | ## Self-Healing - **Temporary exclusion**: Score < 0.2 โ†’ excluded for 5 min (progressive backoff, max 30 min) - **Circuit breaker awareness**: OPEN โ†’ auto-excluded; HALF_OPEN โ†’ probe requests - **Incident mode**: >50% OPEN โ†’ disable exploration, maximize stability - **Cooldown recovery**: After exclusion, first request is a "probe" with reduced timeout ## Bandit Exploration 5% of requests (configurable) are routed to random providers for exploration. Disabled in incident mode. ## API ```bash # Create auto-combo curl -X POST http://localhost:20128/api/combos/auto \ -H "Content-Type: application/json" \ -d '{"id":"my-auto","name":"Auto Coder","candidatePool":["anthropic","google","openai"],"modePack":"ship-fast"}' # List auto-combos curl http://localhost:20128/api/combos/auto ``` ## Task Fitness 30+ models scored across 6 task types (`coding`, `review`, `planning`, `analysis`, `debugging`, `documentation`). Supports wildcard patterns (e.g., `*-coder` โ†’ high coding score). ## Files | File | Purpose | | :------------------------------------------- | :------------------------------------ | | `open-sse/services/autoCombo/scoring.ts` | Scoring function & pool normalization | | `open-sse/services/autoCombo/taskFitness.ts` | Model ร— task fitness lookup | | `open-sse/services/autoCombo/engine.ts` | Selection logic, bandit, budget cap | | `open-sse/services/autoCombo/selfHealing.ts` | Exclusion, probes, incident mode | | `open-sse/services/autoCombo/modePacks.ts` | 4 weight profiles | | `src/app/api/combos/auto/route.ts` | REST API |