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:AI_PREFERRED_PROVIDER+AI_PREFERRED_MODEL(if set)- Live model lists from each provider API (when keys allow)
- Built-in chain: Gemini 2.5/2.0 Flash → Groq Llama 3.3/3.1 → Ollama cloud/local
API_KEY_ROTATION=1) cycles backup keys before switching providers.
Per-task profiles
Override per task:
Per-skill models
~/.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: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: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_ALIASESfor your machine
Inspect at runtime
Set
SHOW_MODEL=1 (default) to display Model: provider/name under answers.