LLM Provider Overview
EdgeCrab supports 11 LLM providers out of the box. Auto-detection finds the right provider from your environment variables — or switch at any time with --model or /model inside the TUI.
The provider list and detection priority come directly from crates/edgecrab-cli/src/setup.rs (PROVIDER_ENV_MAP).
Provider Quick Reference
Section titled “Provider Quick Reference”| Priority | Provider | Env var | Best for | Notes |
|---|---|---|---|---|
| 1 | copilot | GITHUB_TOKEN | Free tier, coding | Requires GitHub Copilot subscription |
| 2 | openai | OPENAI_API_KEY | General purpose | GPT-4.1, GPT-5, o3/o4 |
| 3 | anthropic | ANTHROPIC_API_KEY | Long context, coding | Claude 4.5 / 4.6 |
| 4 | gemini | GOOGLE_API_KEY | Multimodal, long context | Gemini 2.5 / 3.x |
| 5 | xai | XAI_API_KEY | Fast reasoning | Grok 3 / 4 |
| 6 | deepseek | DEEPSEEK_API_KEY | Code, cost-effective | DeepSeek V3, R1 |
| 7 | huggingface | HUGGING_FACE_HUB_TOKEN | Open models | Hugging Face Inference API |
| 8 | zai | ZAI_API_KEY | GLM models | Z.AI / GLM 4.5–5 |
| 9 | openrouter | OPENROUTER_API_KEY | 600+ models | Single endpoint for many providers |
| — | ollama | (none) | Offline / local | Requires ollama serve on port 11434 |
| — | lmstudio | (none) | Offline / local | Requires LM Studio server on port 1234 |
Auto-detection order: EdgeCrab checks env vars in priority order (1–9). The first matching key sets the default provider. Local providers (ollama, lmstudio) are available regardless.
Setting Up a Provider
Section titled “Setting Up a Provider”1. Set the API Key
Section titled “1. Set the API Key”Add to your shell profile or ~/.edgecrab/.env:
# ~/.edgecrab/.env <- edgecrab loads this automaticallyOPENAI_API_KEY=sk-...ANTHROPIC_API_KEY=sk-ant-...Note for Gemini: The env var is
GOOGLE_API_KEY, notGEMINI_API_KEY.
2. Set the Active Provider
Section titled “2. Set the Active Provider”Either via setup wizard (recommended for first run):
edgecrab setupOr directly in ~/.edgecrab/config.yaml:
provider: openaimodel: gpt-4o3. Verify
Section titled “3. Verify”edgecrab doctor# OK OpenAI OPENAI_API_KEY set# OK Provider ping openai/gpt-4o -> OK (421 ms)Provider Details
Section titled “Provider Details”GitHub Copilot (copilot)
Section titled “GitHub Copilot (copilot)”Uses your existing GitHub Copilot subscription — no additional billing. Requires a valid GITHUB_TOKEN with Copilot access.
GITHUB_TOKEN=ghp_...Models:
gpt-4.1-mini(default, fast)gpt-4o(more capable)claude-sonnet-4-5(when available in Copilot)
OpenAI (openai)
Section titled “OpenAI (openai)”OPENAI_API_KEY=sk-...Recommended models:
openai/gpt-4o # Best general-purposeopenai/gpt-4.1-mini # Fast, cost-effectiveopenai/o3 # Advanced reasoningopenai/o4-mini # Fast reasoningAnthropic (anthropic)
Section titled “Anthropic (anthropic)”ANTHROPIC_API_KEY=sk-ant-...Recommended models:
anthropic/claude-opus-4-5 # Most capableanthropic/claude-sonnet-4-5 # Balancedanthropic/claude-haiku-3-5 # Fast, lightweightGoogle Gemini (gemini)
Section titled “Google Gemini (gemini)”GOOGLE_API_KEY=AIza...Important: The env var is
GOOGLE_API_KEY— notGEMINI_API_KEY.
Models:
gemini/gemini-2.5-flash # Fast, capablegemini/gemini-2.5-pro # Long contextxAI (xai)
Section titled “xAI (xai)”XAI_API_KEY=...Models:
xai/grok-3 # Most capablexai/grok-3-mini # Fast, cost-effectiveDeepSeek (deepseek)
Section titled “DeepSeek (deepseek)”Excellent for code tasks, highly cost-effective.
DEEPSEEK_API_KEY=...Models:
deepseek/deepseek-chat # V3 — general purposedeepseek/deepseek-reasoner # R1 — reasoningHugging Face (huggingface)
Section titled “Hugging Face (huggingface)”Access open models via the Hugging Face Inference API.
HUGGING_FACE_HUB_TOKEN=hf_...edgecrab --model huggingface/meta-llama/Llama-3.3-70B-Instruct "..."Z.AI (zai)
Section titled “Z.AI (zai)”Z.AI provides access to GLM model series.
ZAI_API_KEY=...Models:
zai/glm-4.5 # Latest GLMzai/glm-5 # Most capable GLMOllama (local, no API key)
Section titled “Ollama (local, no API key)”Run any model locally. Requires Ollama installed and running:
# Start Ollama (keep this running)ollama serve
# Pull a modelollama pull llama3.3ollama pull codestralNo API key needed. EdgeCrab connects to http://localhost:11434 automatically:
edgecrab --model ollama/llama3.3 "explain this code"edgecrab --model ollama/codestral "write a Rust async function"→ Local Models guide for full setup and model recommendations.
LM Studio (local, no API key)
Section titled “LM Studio (local, no API key)”Download a model in LM Studio and start its local server (default port 1234):
edgecrab --model lmstudio/your-loaded-model "..."OpenRouter (openrouter)
Section titled “OpenRouter (openrouter)”Access 600+ models from a single API endpoint and API key.
OPENROUTER_API_KEY=...edgecrab --model openrouter/anthropic/claude-opus-4-5 "..."edgecrab --model openrouter/google/gemini-2.5-flash "..."edgecrab --model openrouter/meta-llama/llama-3.3-70b-instruct "..."Switching Providers at Runtime
Section titled “Switching Providers at Runtime”Command line
Section titled “Command line”edgecrab --model anthropic/claude-opus-4-5 "refactor this module"Inside the TUI
Section titled “Inside the TUI”/model groq/llama-3.3-70b-versatileThe switch takes effect immediately — the conversation history carries over, with the new model seeing all previous messages.
Fallback Chain
Section titled “Fallback Chain”Configure automatic failover in config.yaml:
provider: openaimodel: gpt-4ofallback_providers: - anthropic/claude-sonnet-4-5 - ollama/llama3.3If the primary provider returns an error (rate limit, outage), EdgeCrab retries with the next in the chain.
Comparing Models for Coding Tasks
Section titled “Comparing Models for Coding Tasks”| Task | Recommended |
|---|---|
| Large refactor (100+ files) | anthropic/claude-opus-4-5 |
| Quick one-file fix | openai/gpt-4.1-mini or deepseek/deepseek-chat |
| Reasoning / complex logic | deepseek/deepseek-reasoner or xai/grok-3 |
| Offline / air-gapped | ollama/llama3.3 or ollama/codestral |
| Maximum model variety | openrouter/... (600+ models) |
| Budget-conscious | deepseek/deepseek-coder-v2 |
| Reasoning-heavy | openai/o3 |
| European data residency | mistral/mistral-large-latest |
Pro Tips
Section titled “Pro Tips”- Use
/modelin the TUI to experiment: type/model deepseek/deepseek-reasonermid-session to switch models without losing conversation history. - OpenRouter for prototyping: a single
OPENROUTER_API_KEYunlocks 600+ models. Iterate fast across different providers before committing to one API key. - DeepSeek R1 for hard reasoning:
deepseek/deepseek-reasonermatches o3-class reasoning at a fraction of the cost. Ideal for algorithm design and complex debugging. edgecrab doctorshows which providers are configured and their latency. Run it after adding a new key to verify the key works.- Fallback chain protects long runs: configure
fallback_providersinconfig.yamlso that a rate-limit spike doesn’t kill a multi-hour refactor.
Why is my GOOGLE_API_KEY not working with Gemini?
Make sure you’re using GOOGLE_API_KEY (not GEMINI_API_KEY). Also verify the key has the Generative Language API enabled in Google Cloud Console.
Can I use two providers in the same session?
Not simultaneously, but you can switch mid-session with /model provider/model-name. Each turn after the switch uses the new model.
Does EdgeCrab send conversation history to every provider I’ve configured? No. Only the active provider receives messages. Other API keys are only used if you explicitly switch to that provider.
How does auto-detection priority work?
EdgeCrab checks env vars in the order listed in the Provider Quick Reference table. The first key found sets the default provider. If you have multiple keys set, add provider: <name> to config.yaml to pin the preference.
Can I use a fine-tuned model?
Yes — any OpenAI-compatible endpoint accepts a custom model name. Set base_url and model.default in config.yaml.
See Also
Section titled “See Also”- Local Models — Ollama and LM Studio setup
- Environment Variables — all API key env var names
- Configuration Reference —
provider,model, andfallback_providersconfig keys