> ## Documentation Index
> Fetch the complete documentation index at: https://arka-agent-mintlify-f21cea86.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-provider failover के साथ LLM orchestration

> Arka कैसे 24 LLM providers को automatic failover, API key rotation, per-task profiles, और per-skill model overrides के साथ orchestrate करता है।

Arka का `LlmFallbackEngine` **25 providers** में सभी LLM calls को automatic failover, API key rotation, और per-task या per-skill model overrides के साथ manage करता है।

## समर्थित 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, और vLLM Cloud.

## Failover कैसे काम करता है

Orchestrator क्रम में एक candidate list बनाता है:

1. `AI_PREFERRED_PROVIDER` + `AI_PREFERRED_MODEL` (यदि set है)
2. प्रत्येक provider API से live model lists (जब keys अनुमति देती हैं)
3. Built-in chain: Gemini 2.5/2.0 Flash → Groq Llama 3.3/3.1 → Ollama cloud/local

429, 401, या timeout पर, Arka अगले model को आज़माता है। API key rotation (`API_KEY_ROTATION=1`) providers स्विच करने से पहले backup keys को cycle करता है।

```env theme={null}
AI_PREFERRED_PROVIDER=gemini
AI_PREFERRED_MODEL=gemini-2.0-flash
AI_KEEP_MODEL_ON_PROVIDER_SWITCH=1
LLM_AUTO_FALLBACK=1
API_KEY_ROTATION=1
```

जब आप `arka provider set groq` (या fish में `ai-pref groq`) के साथ providers बदलते हैं, तो Arka उस provider के default पर वापस आने से पहले नए provider पर **वही model रखने** का प्रयास करता है। इसे अक्षम करने के लिए, `arka provider set groq --no-keep-model` या `AI_KEEP_MODEL_ON_PROVIDER_SWITCH=0` का उपयोग करें।

## Web chat model क्रम

Interactive web chat, जैसे [Open WebUI frontend](/hi/guides/open-webui), एक अलग fast chain का उपयोग करता है ताकि cloud free tiers के rate limits पर पहुँचने पर भी replies आते रहें:

1. जब Ollama चल रहा हो, तो एक छोटा local Ollama model। Arka `llama3.2:1b`, `llama3.2:3b`, `qwen3:8b`, और `llama3.1:8b` में से पहला installed model चुनता है।
2. जब `GEMINI_API_KEY` या `GOOGLE_API_KEY` set हो, तो Gemini Flash models।
3. जब `GROQ_API_KEY` set हो, तो Groq `llama-3.3-70b-versatile`।

Chain या local model को override करें:

```env theme={null}
WEB_CHAT_OLLAMA_MODEL=llama3.2:3b
WEB_CHAT_MODEL_CHAIN=ollama/qwen3:8b,groq/llama-3.3-70b-versatile
```

इसके बजाय standard failover chain का उपयोग करने के लिए `WEB_CHAT_FAST=0` set करें।

<Note>
  "thanks" या "got it" जैसी छोटी स्वीकृतियों पर एक संक्षिप्त welcome मिलता है। Arka पिछला build जारी नहीं रखता।
</Note>

## Per-task profiles

| Task | उपयोग के लिए |
| - | - |
| `route` | Skill routing निर्णय |
| `summarize` | Email और document summaries |
| `chat` | Conversational replies |
| `research` | Deep web research |
| `agent` | Goal agent steps |
| `pdf` | PDF question answering |
| `arka predictions` | Stock और forecast analysis |
| `compose_video` | Video script generation |
| `arka compose_slides` | Presentation slide script generation |

Task के अनुसार override करें:

```env theme={null}
LLM_FALLBACK_ROUTE=gemini/gemini-2.0-flash,groq/llama-3.3-70b-versatile
LLM_FALLBACK_SUMMARIZE=groq/llama-3.3-70b-versatile
```

## Per-skill models

```bash theme={null}
arka ai-skill-model web_answer groq/llama-3.3-70b-versatile
arka ai-skill-model profiles
arka ai-models
```

या `~/.config/arka/llm-skill-models.json` को edit करें।

## Benchmark orchestration

यदि आप चाहते हैं कि model selection live benchmark winners का पालन करे, तो पहले एक benchmark suite चलाएँ और फिर orchestration सक्षम करें:

```bash theme={null}
arka benchmark run
arka benchmark show
ARKA_BENCHMARK_ORCHESTRATE=1 arka orchestrate --benchmark "how to get free ai credits"
```

Benchmark profile routed task का पालन करता है। जो request `web_answer` पर route होती है, वह `chat` benchmark results का उपयोग करती है। Agent-style requests `agent` का उपयोग करती हैं।

## Shared exhaustion cache

Arka एक session cache रखता है। जब तक आप cache को reset नहीं करते, यह सभी skills में exhausted models को skip करता है:

```bash theme={null}
arka ai reset-exhaustion
```

Failover पर stderr notification सक्षम करें: `LLM_FALLBACK_NOTIFY=1`. Debug attempts: `LLM_VERBOSE=1`.

## Local LLM servers

```env theme={null}
OLLAMA_HOST=127.0.0.1:11434
LLM_AUTO_START_SERVERS=1
LLM_AUTO_STOP_SERVERS=1
```

## Skills संक्षिप्त क्यों रहती हैं

Arka LLM से 70 skill manuals याद रखने के लिए **नहीं** कहता। Skills local programs हैं। Model केवल सही नाम चुनता है। LLM route पर, Arka पास करता है:

* एक **compact skill catalog** (केवल registered names)
* **Curated routing rules** (high-signal patterns)
* आपकी मशीन के लिए `ROUTE_ALIASES` के माध्यम से **Shell aliases**

Route task कम temperature और एक dedicated chain का उपयोग करता है ताकि एक fast, cheap model classification को संभाले। Heavy lifting locally skill के अंदर चलता है।

## Runtime पर निरीक्षण करें

```bash theme={null}
arka ai-models
arka ai models --task summarize
arka ai models --skill web_answer
arka ai active-model
arka ai reset-exhaustion
```

<Note>
  Answers के नीचे `Model: provider/name` दिखाने के लिए `SHOW_MODEL=1` (default) set करें।
</Note>

## संबंधित

<CardGroup cols={2} />


## Related topics

- [Quickstart: Arka इंस्टॉल करें और अपना पहला कमांड चलाएँ](/hi/quickstart.md)
- [Arka अन्य agents की तुलना में कैसा है](/hi/concepts/comparison.md)
- [Symbolic और LLM routing pipeline](/hi/concepts/routing.md)
- [Sakana Fugu orchestrator](/hi/guides/fugu.md)
- [Agent Teams](/hi/guides/agent-teams.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.