Skip to main content
Arka’s LlmFallbackEngine manages all LLM calls across 25 providers with automatic failover, API key rotation, and per-task or per-skill model overrides.

Supported providers

Anthropic, OpenAI, Gemini, Groq, xAI, DeepSeek, Moonshot, Z.AI, MiniMax, Venice, Mistral, Cohere, Together, Fireworks, Perplexity, Hugging Face, OpenRouter, Sakana Fugu, Bedrock, Azure, LiteLLM, Ollama, LM Studio, vLLM, and vLLM Cloud.

How failover works

The orchestrator builds a candidate list in order:
  1. AI_PREFERRED_PROVIDER + AI_PREFERRED_MODEL (if set)
  2. Live model lists from each provider API (when keys allow)
  3. Built-in chain: Gemini 2.5/2.0 Flash → Groq Llama 3.3/3.1 → Ollama cloud/local
On 429, 401, or timeout, Arka tries the next model. API key rotation (API_KEY_ROTATION=1) cycles backup keys before switching providers.

Per-task profiles

Override per task:

Per-skill models

Or edit ~/.config/arka/llm-skill-models.json.

Benchmark orchestration

If you want model selection to follow live benchmark winners, run a benchmark suite first and then enable orchestration:
The benchmark profile follows the routed task, so a request that routes to web_answer uses the chat benchmark results, while agent-style requests use agent.

Shared exhaustion cache

One session cache — exhausted models are skipped across skills until reset:
Enable stderr notification on failover: LLM_FALLBACK_NOTIFY=1. Debug attempts: LLM_VERBOSE=1.

Local LLM servers

Why skills stay concise

Arka does not ask the LLM to memorize 70 skill manuals. Skills are local programs — the model only picks the right name. On LLM route, Arka passes:
  • A compact skill catalog (registered names only)
  • Curated routing rules (high-signal patterns)
  • Shell aliases via ROUTE_ALIASES for your machine
The route task uses low temperature and a dedicated chain so a fast/cheap model handles classification; heavy lifting runs inside the skill locally.

Inspect at runtime

Set SHOW_MODEL=1 (default) to display Model: provider/name under answers.