LLM Providers & Models

Mudabbir supports six LLM providers, from free local models to cloud APIs. This guide covers everything: which provider to pick, which models to use, how they interact with agent backends, and how to configure them.

Quick Start: Which Provider Should I Use?

GoalProviderCostRecommended Backend
Best quality, zero configAnthropicPaid APIClaude Agent SDK or Mudabbir Native
Free cloud API, great qualityGeminiFree tier availableMudabbir Native
Fully local, no cloudOllamaFreeClaude Agent SDK or Mudabbir Native
Use OpenAI modelsOpenAIPaid APIOpen Interpreter
Custom endpoint (OpenRouter, vLLM, etc.)OpenAI-CompatibleVariesMudabbir Native
Tip

New to Mudabbir? Start with Gemini (free) or Anthropic (best quality). You can switch providers at any time from Settings without losing data.

Provider Details

Anthropic (Default)

The recommended provider for maximum capability. Claude models excel at coding, tool use, and complex reasoning.

Configuration:

Terminal window
export MUDABBIR_LLM_PROVIDER="anthropic"
export MUDABBIR_ANTHROPIC_API_KEY="sk-ant-..."
export MUDABBIR_ANTHROPIC_MODEL="claude-sonnet-4-5-20250929"

Available Models:

ModelIDBest For
Claude Sonnet 4.5claude-sonnet-4-5-20250929Best balance of speed and quality (default)
Claude Opus 4.5claude-opus-4-5-20250929Most capable, complex reasoning
Claude Haiku 4.5claude-haiku-4-5-20250929Fastest, cheapest, simple tasks
Claude Sonnet 4claude-sonnet-4-20250514Previous-gen balanced model
Claude Opus 4claude-opus-4-20250514Previous-gen flagship
Info

Get an API key at console.anthropic.com.

Gemini

Google’s Gemini models via their OpenAI-compatible API. Free tier available with generous limits. Internally, Mudabbir routes Gemini through the OpenAI-compatible code path using Google’s endpoint at https://generativelanguage.googleapis.com/v1beta/openai/.

Configuration:

Terminal window
export MUDABBIR_LLM_PROVIDER="gemini"
export MUDABBIR_GOOGLE_API_KEY="AIza..."
export MUDABBIR_GEMINI_MODEL="gemini-2.5-flash"

Available Models:

ModelIDBest For
Gemini 2.5 Flashgemini-2.5-flashBest price-performance (default)
Gemini 2.5 Progemini-2.5-proState-of-the-art reasoning
Gemini 2.5 Flash Litegemini-2.5-flash-liteFastest, cheapest
Gemini 3 Progemini-3-pro-previewLatest flagship (preview)
Gemini 3 Flashgemini-3-flash-previewLatest fast model (preview)
Tip

Get a free API key at AI Studio. The same key is also used for Mudabbir’s image generation tool.

Warning

Gemini 2.0 Flash and 2.0 Flash Lite are deprecated and will be retired on March 31, 2026. Use 2.5 Flash or newer.

Warning

Gemini requires the Mudabbir Native or Open Interpreter backend. It does not work with the Claude Agent SDK backend (the SDK uses Anthropic’s message format, which Gemini doesn’t support). Switch to Mudabbir Native in Settings → General → Agent Backend.

Ollama (Local)

Run models entirely on your machine. No API keys, no cloud, no costs. Requires Ollama installed and running.

Configuration:

Terminal window
export MUDABBIR_LLM_PROVIDER="ollama"
export MUDABBIR_OLLAMA_HOST="http://localhost:11434"
export MUDABBIR_OLLAMA_MODEL="llama3.2"

Recommended Models:

Modelollama pullParametersBest For
Llama 3.2ollama pull llama3.23BFast, general use (default)
Llama 3.1ollama pull llama3.18BBetter quality, more VRAM
Qwen 2.5 Coderollama pull qwen2.5-coder7BCoding tasks
Mistralollama pull mistral7BGeneral reasoning
DeepSeek Coder V2ollama pull deepseek-coder-v216BAdvanced coding

Verify connectivity:

Terminal window
mudabbir --check-ollama

This runs 4 checks: server reachable, model available, API compatibility, and tool calling support.

Info

Ollama automatically skips smart model routing since there’s only one model to route to.

OpenAI

Use OpenAI’s GPT models directly.

Configuration:

Terminal window
export MUDABBIR_LLM_PROVIDER="openai"
export MUDABBIR_OPENAI_API_KEY="sk-..."
export MUDABBIR_OPENAI_MODEL="gpt-4o"

Available Models:

ModelIDBest For
GPT-4ogpt-4oBest overall (default)
GPT-4o Minigpt-4o-miniFast, cost-effective
o1o1Complex reasoning
o3-minio3-miniBalanced reasoning
Warning

OpenAI provider works with Open Interpreter only. It does not work with Claude Agent SDK (different API format) or Mudabbir Native. To use OpenAI models with Mudabbir Native, use the OpenAI-Compatible provider with base URL https://api.openai.com/v1.

OpenAI-Compatible

Connect to any endpoint that implements the OpenAI Chat Completions API. This includes hosted services (OpenRouter, Together AI, Fireworks) and self-hosted servers (vLLM, LiteLLM, text-generation-inference).

Configuration:

Terminal window
export MUDABBIR_LLM_PROVIDER="openai_compatible"
export MUDABBIR_OPENAI_COMPATIBLE_BASE_URL="https://openrouter.ai/api/v1"
export MUDABBIR_OPENAI_COMPATIBLE_API_KEY="sk-or-..."
export MUDABBIR_OPENAI_COMPATIBLE_MODEL="anthropic/claude-3.5-sonnet"
export MUDABBIR_OPENAI_COMPATIBLE_MAX_TOKENS=0 # 0 = no limit

Popular services:

ServiceBase URLNotes
OpenRouterhttps://openrouter.ai/api/v1100+ models, pay-per-token
Together AIhttps://api.together.xyz/v1Open-source models
Fireworks AIhttps://api.fireworks.ai/inference/v1Fast inference
LiteLLM Proxyhttp://localhost:4000/v1Self-hosted proxy to any provider
vLLMhttp://localhost:8000/v1Self-hosted model serving

Verify connectivity:

Terminal window
mudabbir --check-openai-compatible

This runs 2 checks: API connectivity and tool calling support.

Info

The max_tokens setting (0 by default) controls the maximum output tokens per request. Set to 0 for no limit, which is recommended for most models.

Warning

Backend note: OpenAI-Compatible endpoints work with Mudabbir Native (recommended) and Open Interpreter. They only work with the Claude Agent SDK if the endpoint implements the Anthropic Messages API format (e.g., LiteLLM proxy). Most endpoints (OpenRouter, Together AI, Fireworks, vLLM) speak OpenAI format only.

Auto (Default)

When llm_provider is set to "auto" (the default), Mudabbir auto-detects the best available provider:

  1. Anthropic — if MUDABBIR_ANTHROPIC_API_KEY is set
  2. OpenAI — if MUDABBIR_OPENAI_API_KEY is set
  3. Ollama — fallback (no key needed)

This means Mudabbir works out of the box with Ollama if no API keys are configured.


Backend Compatibility Matrix

Not every provider works with every agent backend. Here’s the full compatibility matrix:

ProviderClaude Agent SDKMudabbir NativeOpen Interpreter
AnthropicYesYesYes
GeminiNoYesYes
OllamaYesYesYes
OpenAINoNoYes
OpenAI-CompatiblePartialYesYes
FeatureClaude Agent SDKMudabbir NativeOpen Interpreter
Smart Model RoutingYesYes (Anthropic only)No
Fast-Path (simple msgs)YesNoNo
Built-in Tools8 SDK tools6 native toolsCode execution
MCP Server SupportYesYesNo
StreamingYesYesYes
Security HooksPreToolUse hooksRegex + path jailNone
Tool Call FormatAnthropic Messages APIAuto-convertedLiteLLM
Warning

API format matters. The Claude Agent SDK speaks the Anthropic Messages API format. It only works with endpoints that understand this format: Anthropic (native), Ollama v0.14+ (added Anthropic compat), and Anthropic-compatible proxies like LiteLLM. Endpoints that only speak OpenAI format (Gemini, OpenAI, OpenRouter, Together AI) will not work with Claude SDK — use Mudabbir Native instead.

Tip

Mudabbir Native is the most versatile backend for non-Anthropic providers. It auto-converts between Anthropic and OpenAI API formats, so it works with every provider except plain OpenAI (use OpenAI-Compatible with https://api.openai.com/v1 as a workaround).

The default and most capable backend. Uses the official Claude Agent SDK as a subprocess with built-in agentic tools.

Important: API format requirement. The Claude SDK uses the Anthropic Messages API format for all communication. This means it only works with endpoints that understand Anthropic’s message format — not endpoints that only speak OpenAI’s Chat Completions format.

How it connects to providers:

All providers are passed to the Claude CLI subprocess via environment variables (ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY):

ProviderWorks?How
AnthropicYesNative — just set ANTHROPIC_API_KEY
OllamaYesOllama v0.14+ implements the Anthropic Messages API natively
GeminiNoGemini only speaks OpenAI format — use Mudabbir Native instead
OpenAINoOpenAI only speaks OpenAI format
OpenAI-CompatiblePartialOnly if the endpoint speaks Anthropic format (e.g., LiteLLM proxy)
Info

The Claude Agent SDK also supports enterprise cloud providers like Amazon Bedrock, Google Vertex AI, and Azure AI Foundry for Anthropic models.

Warning

Using Gemini or OpenAI? Switch to Mudabbir Native backend in Settings → General → Agent Backend. Mudabbir Native handles the API format conversion automatically.

Built-in SDK tools: Bash, Read, Write, Edit, Glob, Grep, WebSearch, WebFetch — these are provided by the Claude SDK itself and don’t need configuration.

Fast-path optimization: For messages classified as SIMPLE by the model router, Mudabbir bypasses the CLI subprocess entirely and calls the Anthropic API directly. This saves ~1.5–3 seconds of subprocess startup time per simple message. The fast-path requires an API key.

Security: Uses PreToolUse hooks to intercept and block dangerous Bash commands before execution.

Persistent client: The subprocess is reused across messages. It only reconnects when the model or tool configuration changes, avoiding repeated startup overhead.

MCP servers: Fully supported. Loads enabled MCP server configs and passes them to the SDK subprocess. Supports stdio, SSE, and HTTP transports.

Best for: Anthropic and Ollama users who want maximum capability, coding tasks, complex multi-step reasoning, and tool-heavy workflows.

Mudabbir Native

Custom orchestrator that uses the Anthropic SDK for reasoning and Open Interpreter for code execution. Provides a transparent, user-controlled agentic loop with integrated security layers. This is the most versatile backend — it supports every provider by auto-converting between API formats.

How it connects to providers:

Mudabbir Native creates different API clients depending on the provider, automatically handling format differences:

ProviderClientSDKNotes
AnthropicAsyncAnthropicAnthropic SDKDirect API, no base URL needed
OllamaAsyncAnthropicAnthropic SDKbase_url=ollama_host, api_key="ollama"
GeminiAsyncOpenAIOpenAI SDKAuto-converts tool format
OpenAI-CompatibleAsyncOpenAIOpenAI SDKAuto-converts tool format
OpenAI❌ Not supportedUse OpenAI-Compatible instead

Automatic format conversion: When using Gemini or OpenAI-Compatible providers, Mudabbir Native automatically:

  • Converts Anthropic-format tool definitions to OpenAI function-calling format
  • Converts message history between Anthropic and OpenAI formats
  • Maps OpenAI’s finish_reason to Anthropic’s stop_reason
  • Handles tool_calls response objects with id, function.name, function.arguments

This means you get the same tool-use experience regardless of provider — the conversion is invisible.

API timeouts:

ProviderTimeoutRetriesWhy
Anthropic90s2Reliable API, higher retries
Ollama120s1Local, may be slow on first load
Gemini180s1Longer for thinking models
OpenAI-Compatible180s1Longer for thinking models

Built-in tools: shell, read_file, write_file, edit_file, list_dir, remember, recall, forget — plus any MCP tools configured.

Security layers:

  1. Dangerous command regex — blocks rm -rf /, mkfs, dd, etc.
  2. Sensitive path protection — SSH keys, AWS credentials, .env files
  3. File jail — restricts filesystem access to ~/.mudabbir/ by default
  4. Output redaction — hides API keys and passwords from responses

Smart routing: Supported for Anthropic provider only. Disabled for Ollama and Gemini.

MCP servers: Supported. Tools are registered with mcp_<server>__<tool> naming convention.

Best for: Users who want fine-grained control, transparency, and strong security guardrails. Works well with Gemini for a free, full-featured setup.

Open Interpreter

Lightweight wrapper around Open Interpreter. Delegates model management entirely to Open Interpreter’s own provider system, which uses LiteLLM under the hood.

How it connects to providers:

ProviderModel FormatAPI BaseNotes
Anthropicclaude-sonnet-4-5-20250929(auto)API key passed directly
Geminigemini-2.5-flash(auto)Via LiteLLM
Ollamaollama/llama3.2Ollama host URLAuto-prefixed with ollama/
OpenAIgpt-4o(auto)API key passed directly
OpenAI-CompatibleModel nameYour base URLAPI key passed directly
Info

Open Interpreter uses LiteLLM internally, which supports 100+ LLM providers. Any model supported by LiteLLM can be used.

Ollama prefix: Ollama models are automatically prefixed with ollama/ (e.g., llama3.2 becomes ollama/llama3.2). This is required by LiteLLM to identify the provider.

Streaming: Runs in a thread pool with queue-based chunk streaming. Filters verbose console output and emits only user-facing messages and tool results.

Tool execution: Open Interpreter handles code execution directly — it generates and runs code in a sandboxed environment. Mudabbir wraps the output into standardized tool_use/tool_result events for the Activity panel.

Limitations:

  • No MCP server support
  • No smart model routing
  • No PreToolUse security hooks
  • Less granular tool control compared to other backends

Best for: Quick prototyping, users familiar with Open Interpreter, scenarios where code execution is the primary use case.


Smart Model Routing

When using Anthropic as the provider, Mudabbir can automatically select the model size based on message complexity. This optimizes cost by using cheaper models for simple queries.

How It Works

Each incoming message is classified into a tier:

TierDescriptionDefault ModelWhen
SimpleGreetings, yes/no, quick factsclaude-haiku-4-5-20251001Short messages matching simple patterns
ModerateGeneral tasks, search, moderate reasoningclaude-sonnet-4-5-20250929Default fallback
ComplexCoding, debugging, multi-step planningclaude-opus-4-6Long messages or 1+ complex keywords

Classification Signals

  • Simple patterns: “hi”, “hello”, “thanks”, “what is X?”, “remind me”, short messages under 30 characters
  • Complex signals: “plan”, “architect”, “debug”, “implement”, “analyze”, “optimize”, “research”
  • Threshold: 1 complex signal + message > 30 chars = COMPLEX; 2+ complex signals = COMPLEX; > 400 chars = COMPLEX

Configuration

Terminal window
export MUDABBIR_SMART_ROUTING_ENABLED=true
export MUDABBIR_MODEL_TIER_SIMPLE="claude-haiku-4-5-20251001"
export MUDABBIR_MODEL_TIER_MODERATE="claude-sonnet-4-5-20250929"
export MUDABBIR_MODEL_TIER_COMPLEX="claude-opus-4-6"
Info

Smart routing is automatically skipped for Ollama, Gemini, and OpenAI-Compatible providers since they use a single configured model.


Configuration Reference

SettingEnv VariableDefaultDescription
llm_providerMUDABBIR_LLM_PROVIDERautoProvider selection
anthropic_api_keyMUDABBIR_ANTHROPIC_API_KEYAnthropic API key
anthropic_modelMUDABBIR_ANTHROPIC_MODELclaude-sonnet-4-5-20250929Anthropic model
google_api_keyMUDABBIR_GOOGLE_API_KEYGoogle API key (Gemini + image gen)
gemini_modelMUDABBIR_GEMINI_MODELgemini-2.5-flashGemini model
openai_api_keyMUDABBIR_OPENAI_API_KEYOpenAI API key
openai_modelMUDABBIR_OPENAI_MODELgpt-4oOpenAI model
ollama_hostMUDABBIR_OLLAMA_HOSThttp://localhost:11434Ollama server URL
ollama_modelMUDABBIR_OLLAMA_MODELllama3.2Ollama model
openai_compatible_base_urlMUDABBIR_OPENAI_COMPATIBLE_BASE_URLEndpoint URL
openai_compatible_api_keyMUDABBIR_OPENAI_COMPATIBLE_API_KEYEndpoint API key
openai_compatible_modelMUDABBIR_OPENAI_COMPATIBLE_MODELEndpoint model name
openai_compatible_max_tokensMUDABBIR_OPENAI_COMPATIBLE_MAX_TOKENS0Max output tokens (0 = no limit)
smart_routing_enabledMUDABBIR_SMART_ROUTING_ENABLEDtrueEnable auto model selection
model_tier_simpleMUDABBIR_MODEL_TIER_SIMPLEclaude-haiku-4-5-20251001Model for simple tasks
model_tier_moderateMUDABBIR_MODEL_TIER_MODERATEclaude-sonnet-4-5-20250929Model for moderate tasks
model_tier_complexMUDABBIR_MODEL_TIER_COMPLEXclaude-opus-4-6Model for complex tasks

Setting via config.json

All settings can also be set in ~/.mudabbir/config.json:

{
"llm_provider": "gemini",
"gemini_model": "gemini-2.5-flash",
"smart_routing_enabled": false
}

Setting via Dashboard

Open the web dashboard (default at http://localhost:8888) and go to Settings > General to select your provider and model from dropdown menus.


Security Notes

  • API keys are encrypted at rest using Fernet + PBKDF2 in ~/.mudabbir/secrets.enc. They are never stored in plaintext in config.json.
  • Environment variables override config file values and are never written to disk.
  • The Gemini provider reuses the google_api_key field, which is also used for image generation. One key covers both features.

Troubleshooting

Ollama: “Model not found”

Terminal window
ollama list # See available models
ollama pull llama3.2 # Download a model
mudabbir --check-ollama # Run connectivity check

Gemini: “API key invalid”

  1. Go to AI Studio and create/verify your key
  2. Make sure the key is saved in Settings > API Keys > Google API Key
  3. Ensure the Gemini API is enabled for your Google Cloud project

OpenAI-Compatible: “Cannot connect”

Terminal window
mudabbir --check-openai-compatible # Run connectivity check

Verify:

  • The base URL is correct and includes /v1 if needed
  • The server is running and accessible
  • The model name matches what the endpoint expects

Wrong provider being used

If llm_provider is "auto", Mudabbir picks the first available key (Anthropic > OpenAI > Ollama). Set an explicit provider to override:

Terminal window
export MUDABBIR_LLM_PROVIDER="gemini"