How are LLM providers selected and configured?
Supported providers; config surface; tool-calling / structured-output usage; local-model support.
Verdict
Hermes Agent supports the most providers. Inbox Zero and Khoj have the most useful fallback chains, and Agenvoy is the only one that picks a model for each request on its own.
Broad catalogues with local models. Hermes Agent declares 42 provider overlays, resolves the rest from models.dev, and picks the wire protocol per model: OpenAI chat, Anthropic messages, Codex Responses or Bedrock Converse. Leon lists 13 providers, including local llama.cpp and SGLang. Setup can reuse keys already stored by Codex or Claude Code. Rakazo uses Pi with OpenRouter as the default. Users can connect ChatGPT, Claude, Copilot or xAI subscriptions by OAuth, and each bot can pin a model. OpenClaw loads providers as plugins and maps host.docker.internal in Docker so a container can reach local Ollama or LM Studio.
Routing and fallback built in. Inbox Zero defines model tiers such as DEFAULT_LLMS and NANO_LLMS. Each is an ordered provider:model chain, so later entries are fallbacks, and Ollama works. Khoj stores models as admin rows of three types. A base URL covers local servers, and a failed call moves to lower-priority settings rows on retryable errors. Agenvoy asks a dispatcher LLM to label each request as code, research, work, chat or fetch. The label sets the model tier and reasoning effort, at the cost of one extra call. The editor found that the optional beta dispatcher sends request text to a hosted third-party classifier.
Narrow or delegated. OpenBot accepts only openai, anthropic and google. A base-URL override is the only way to use a local model. QM delegates model calls to its harness and defaults to claude-opus-5. Its answer said there was no local support, but the editor confirmed that admins can register any OpenAI- or Anthropic-compatible endpoint for Pi-based harnesses. Waku turns every provider into the Anthropic message shape, so structured output is not available.
Pick: Hermes Agent or Rakazo to bring your own models and subscriptions. Pick: Inbox Zero or Khoj when outages must fail over. Pick: Leon for local models first.
Per-project answers
openclaw/openclaw
answeredSupported providers. The provider abstraction lives in packages/ai/src/ — the providers.ts:2 registers built-in API providers. Stream-wrappers for individual providers are in src/llm/providers/stream-wrappers/ with adapters for Anthropic, OpenAI, Google, MiniMax, Moonshot, and ZAI. Each wrapper handles provider-specific streaming nuances: Anthropic prompt caching semantics (anthropic-family-cache-semantics.ts), Google thinking payloads (google-thinking-payload.ts), OpenAI service tier observation (openai-service-tier-observation.ts), reasoning effort utils (reasoning-effort-utils.ts). Model contracts (including Anthropic-specific ones) are defined in packages/llm-core/src/model-contracts/.
Config surface. The ModelRegistry interface in src/llm/model-registry.ts:4 provides getAll(), getAvailable(), find(), and hasConfiguredAuth(). Model pickers resolve from the model catalog (src/model-catalog/, packages/model-catalog-core/). Per-agent model overrides are handled by src/sessions/model-overrides.ts. Provider-level config (endpoint class, provider family, API type) is described by AiProviderRequestCapabilities in packages/ai/src/host.ts:11.
Tool-calling / structured-output usage. Tool-calling support is inferred from the provider transport system — packages/ai/src/host.ts provides AiTransportPluginHost with resolveProviderStream() and stream wrapping. The agent harness in src/agents/ manages MCP tool bundles (agent-bundle-mcp-*.ts), tool policies (src/agents/tool-policy-match.ts, src/agents/agent-tools.policy.ts), and tool error handling (tool-error-summary.ts). The packages/ai/src/transports.ts module provides low-level HTTP/stream transport.
Local-model support. The Docker setup includes extra_hosts: host.docker.internal to reach host-side LM Studio/Ollama (docker-compose.yml:66). The OPENCLAW_EXTENSIONS build arg in the Dockerfile:11 allows including bundled local-model provider plugins. The env-api-keys.ts in packages/ai/ supports API key configuration from environment variables. The provider runtime (src/provider-runtime/operation-retry.ts) handles retry logic.
Provider auth. OAuth flows for Anthropic and OpenAI are in src/llm/utils/oauth/ with anthropic.ts and openai-chatgpt.ts. Secret credential management is handled through the secrets subsystem (src/secrets/).
NousResearch/hermes-agent
answeredSupported providers: 40+ providers configured in hermes_cli/providers.py:28-92 via HERMES_OVERLAYS dict plus dynamic lookup from models.dev. Includes: OpenAI (native + Codex/Responses), Anthropic (Messages API), Nous Portal, OpenRouter, xAI/Grok, Google Vertex, AWS Bedrock, Azure Foundry, GitHub Copilot, Qwen, DeepSeek, Alibaba/DashScope, LM Studio, Ollama (cloud + local), vLLM, llama.cpp, Zhipu/GLM, Minimax, StepFun, together, Fireworks, Novita, Nebius, and custom endpoints via custom_providers config.
Config surface: Providers are resolved through a 7-level chain (resolve_provider_full() at providers.py:533): user providers: config → lossy-alias registry → built-in overlays → user providers (canonical/raw) → custom_providers → managed llamacpp → models.dev direct. Each ProviderDef carries id, transport (openai_chat, anthropic_messages, codex_responses, bedrock_converse), base URL, auth type (api_key, oauth_device_code, oauth_external, external_process, aws_sdk, vertex), and env vars. The determine_api_mode() function (providers.py:371) picks the wire protocol from host-mandated, provider overlay, or dynamic model-based routing.
Tool-calling / structured output: The agent uses OpenAI-compatible function calling for all chat_completions providers and Anthropic-style tool_use blocks for anthropic_messages providers. The codex_responses transport uses OpenAI's Responses API with deterministic tool call IDs (chat_completion_helpers.py, codex_responses_adapter.py). Structured output (JSON mode) is supported through provider-specific response_format parameters.
Local-model support: LM Studio (lmstudio provider, auto-detected at 127.0.0.1:1234/v1) with explicit or JIT load modes (ensure_lmstudio_runtime_loaded() at run_agent.py:482). llama.cpp managed local runtime (hermes_cli/local_runtime/) auto-stages GGUF models. Ollama is supported as a custom endpoint alias. vLLM/sglang work through the custom provider.
khoj-ai/khoj
answeredKhoj supports three LLM providers with a model-agnostic routing layer:
Supported providers. OpenAI (ChatModel.ModelType.OPENAI), Anthropic (ANTHROPIC), and Google Gemini (GOOGLE). Each ChatModel row stores the model name, a foreign key to AiModelApi (which holds api_key and optional api_base_url), a model_type, vision_enabled flag, price_tier, and max_prompt_size. The AiModelApi abstraction allows any OpenAI-compatible endpoint to serve as a provider — the base URL is fully configurable, enabling local models via Ollama, VLLM, LMStudio, etc.
Config surface. Server admins configure models via the Django admin panel (backed by ServerChatSettings). Models are slotted into positions: chat_default (free), chat_advanced (paid), plus fast/deep variants for free and paid users. Slots are resolved per-request via aget_chat_model_slot(). Users can override their model via UserConversationConfig.setting. Model fallback is chained: send_message_to_model_wrapper() tries the primary model first, then iterates through all fallbacks (from all ServerChatSettings entries ordered by priority), retrying on rate-limit/API/timeout errors. Non-retryable errors (auth, invalid model) propagate immediately.
Tool-calling/structured output. The utils.py for OpenAI (processor/conversation/openai/utils.py) detects StructuredOutputSupport level per model: TOOL (native function/tool calling), SCHEMA (JSON Schema in response_format), OBJECT (basic json_object), or NONE. For Anthropic, tool definitions are passed in the Anthropic tool-use format. Structured output schemas use the OpenAI response_format with json_schema and Anthropic's tool-use respectively. For non-schema-capable models, clean_json() strips markdown fences and falls back to string parsing.
Local-model support. Any OpenAI-compatible API endpoint works: set KHOJ_DEFAULT_CHAT_MODEL and OPENAI_BASE_URL (e.g., to http://localhost:11434/v1/ for Ollama). The is_local_api() helper detects localhost URLs and skips HTTPS upgrades.
Other model types: Text-to-image (OpenAI DALL-E, Replicate, Google Imagen), speech-to-text (OpenAI Whisper), text-to-speech (ElevenLabs), and embedding models (sentence-transformers from HuggingFace, configurable via SearchModelConfig).
leon-ai/leon
answeredLeon supports 13 LLM providers, mapped by LLM_PROVIDERS_MAP in llm-provider.ts (lines 36–50): OpenAI, Anthropic, DeepSeek, Groq, OpenRouter, ZAI, MiniMax, MoonshotAI, Cerebras, HuggingFace, LlamaCPP (local), SGLang (local), and Celeris. Each has a provider class under server/src/core/llm-manager/llm-providers/ (e.g. openai-llm-provider.ts extends AISDKRemoteLLMProvider, which is a thin OpenAI/AI SDK responses-API shim). Local model support comes via llamacpp-llm-provider.ts (node-llama-cpp binary) and sglang-llm-provider.ts (OpenAI-compatible server), both marked in llm-routing.ts (lines 26–29) as LOCAL_PROVIDERS. Configuration surfaces in config.sample.yml (lines 16–92): set llm.default to a <provider>/<model> string, with optional per-mode overrides under llm.workflow and llm.agent. API keys are read from environment variables (e.g. LEON_OPENAI_API_KEY). The provider config catalog is at llm-provider-account-configs.ts (lines 19–40). Tool-calling & structured outputs are central to the agent loop: react-llm-duty.ts builds OpenAI-compatible tool definitions from the toolkit registry, bundles them into the provider call, and the provider must support tool calling (LEON.md, line 37: "Agent models must support tool calling"). Structured output uses JSON Schema on completions via ajv validation (llm-provider.ts line 5, inference.ts lines 1–50). For autonomous sub-tasks, the runInference() helper (inference.ts, lines 26–50) accepts a jsonSchema parameter for structured results. The AI SDK wrapper (@ai-sdk/* packages in package.json lines 80–90: @ai-sdk/anthropic, @ai-sdk/openai, @ai-sdk/deepseek, etc.) provides a unified provider abstraction. Fellow discovery (server/src/core/llm-manager/fellows/) can auto-detect API keys from other AI tools (Claude Code, Codex, OpenCode, Pi, Hermes, T3 Code, OpenClaw) to reuse existing credentials without re-entering them.
yc-software/qm
answeredLLM providers are configured via environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY) and the HARNESS config (pi, opencode, codex, claude). The model catalog (src/model/model-catalog.ts) aggregates from four sources: built-in models from @earendil-works/pi-ai (Anthropic/OpenAI base models), model overlays (src/model/model-overlay.ts — admin-customizable price/speed/label overrides), custom providers (src/model/custom-providers.ts), and gateway models (src/model/gateway-models.ts). Model selection (src/model/pi-models.ts) resolves model IDs with resolveModel(), which looks up the built-in catalog then falls through to overlays and custom providers. The default agent model is claude-opus-5 (DEFAULT_AGENT_MODEL_ID). Tool-calling and structured output are managed through the Pi harness (src/harness/pi-harness.ts) which uses pi-ai's ModelRuntime — standard tool definitions are created via createTurnTools() with Pi's ToolDefinition interface. Effort/thinking levels include auto, default, adaptive, low through max/ultracode. Fast mode is supported on all harnesses (harnessSupportsFastMode). There is no local-model support — the system requires API access to Anthropic, OpenAI, or OpenRouter. The admin UI has routes for model registry management (src/api/routes/admin/model-registry.ts, src/api/routes/admin/model-providers.ts, src/api/routes/admin/custom-providers.ts). A model verification system (src/model/model-verification.ts) and browser-model fallback (src/model/browser-model.ts) exist for edge cases.
elie222/inbox-zero
answeredSupported providers. The app supports 14 LLM providers configured via environment variables in apps/web/env.ts:7-23: anthropic, azure, azure-foundry, vertex, google, openai, bedrock, openrouter, groq, cerebras, aigateway, ollama, openai-compatible, codex-cli, claude-code. Each maps to a Vercel AI SDK provider (@ai-sdk/anthropic, @ai-sdk/openai, @ai-sdk/google, etc.) instantiated in apps/web/utils/llms/model.ts. The provider enum is in apps/web/utils/llms/config.ts:3-19.
Configuration surface. The primary configuration is via env vars: DEFAULT_LLMS, ECONOMY_LLMS, CHAT_LLMS, NANO_LLMS, and DRAFT_LLMS (apps/web/env.ts:116-120). Each is a colon-separated chain of provider:model entries — the first valid entry is the primary, later entries serve as fallbacks. Individual API keys are set per provider (ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, etc.). Users can also set a personal aiApiKey, aiProvider, and aiModel on their User record (apps/web/prisma/schema.prisma:94-96), which overrides the deployment defaults. The per-use-case model type mapping (apps/web/utils/llms/use-cases.ts) routes LlmUseCase.AssistantChat to the "chat" model tier.
Tool-calling / structured outputs. All LLM interactions use the Vercel AI SDK (ai package). The main chat agent uses ToolLoopAgent (apps/web/utils/llms/index.ts:959) with a tool registry of ~25 Zod-defined tools. The generateObject wrapper adds JSON repair via jsonrepair on parse failures (apps/web/utils/llms/index.ts:168-178). Structured output is requested through the SDK's generateObject which uses provider-native structured output modes when available (OpenAI response_format, Gemini response_mime_type, etc.).
Local model support. Ollama is supported: the OLLAMA_BASE_URL env var configures the endpoint and OLLAMA_MODEL picks the model. The generic openai-compatible provider extends this to any OpenAI-compatible API endpoint, letting users run local models through tools like LocalAI or LM Studio (apps/web/utils/llms/model.ts:296-312).
Fallback chain. The selectDeploymentModelByType function builds a chain of model candidates from the env var. If the primary provider fails (rate limit, server error, content filter), the system falls through to the next provider in the chain (apps/web/utils/llms/index.ts:927), attempting each until one succeeds.
CopilotKit/OpenBot
answeredSupported providers. Three providers are hardcoded in TypeScript and Python: openai, anthropic, google (shared/model-providers.ts:42). Each has a spec row in shared/model-providers.json (shared/model-providers.json:1-38) defining its API key environment variable, base URL override variable, and default model. The default models are gpt-5.5 (OpenAI), claude-sonnet-4-5 (Anthropic), and gemini-2.5-flash (Google). Each agent-framework adapter chooses which SDK it can drive — adding Google's spec doesn't make agent-mastra (which loads no Google module) able to call Gemini.
Configuration surface. Provider and model are selected through environment variables (server/src/copilot.ts:205-220): BOT_PROVIDER and BOT_MODEL override the defaults from the spec file. An empty provider string defaults to OpenAI (matching what the desktop writes when switching back). Base URLs can be overridden per provider (OPENAI_BASE_URL, ANTHROPIC_BASE_URL, GOOGLE_GENERATIVE_AI_BASE_URL) — the Anthropic variant automatically versions to /v1 if missing. Per-Bot defaults are defined in the bots section of model-providers.json, keyed by agent directory name (e.g., agent-bot defaults to OpenAI/gpt-5.5, agent-langgraph to OpenAI/gpt-5.5).
Tool-calling and structured output. The built-in agents use the AG-UI client's AbstractAgent interface for tool calling, with middleware for memory injection and learning. The approval auto-review uses structured JSON schema output (server/src/approvals/policy.ts:188-194) via Zod: { verdict, preApproved, reason, safety }. The Composio integration passes action schemas (as published by the vendor) directly to the model as function definitions. MCP tools are listed with their JSON Schema parameters and returned as model-callable tools.
Local model support. There is no built-in local model support beyond the base URL override mechanism. Any provider that speaks an OpenAI-compatible API can be pointed at by setting OPENAI_BASE_URL to a local endpoint (e.g., Ollama, vLLM). The Google provider similarly supports GOOGLE_GENERATIVE_AI_BASE_URL. No quantized, local-first, or on-device model is shipped.
gpt-5.5 is the default in the JSON spec, but when the provider is switched through environment variables, runtimeModelForEnvironment falls back to gpt-5.6-terra.elie222/rakazo
answeredSupported providers. Rakazo uses the Pi AI framework (@earendil-works/pi-ai) for model access. packages/core/src/model-providers.ts lists popular providers: openrouter, openai-codex (ChatGPT Plus/Pro OAuth), anthropic, openai, google, vercel-ai-gateway, and deepseek. The POPULAR_MODEL_PROVIDER_IDS array (line 46) controls the order in the UI. The full list comes from Pi's builtin model catalog (@earendil-works/pi-ai/providers/all), which is supplemented by CodexCatalogCache for OpenAI Codex models and OpenRouter's real-time catalog.
Configuration surface. Model configuration flows through four layers:
- Deployment defaults (
packages/adapters/src/deployment-model.ts):PI_DEFAULT_PROVIDER(defaultopenrouter) andOPENROUTER_API_KEYorANTHROPIC_API_KEYenv vars. The default model isopenai/gpt-6-lunaon OpenRouter, orclaude-sonnet-5for Anthropic. - User credentials stored in
ModelCredentialrows (DB). Users connect providers through the UI, either by pasting an API key or via OAuth (device-code for ChatGPT/Copilot/xAI, auth-url for Claude Pro/Max).packages/adapters/src/pi-oauth.tsmanages these flows. - Per-bot overrides: each bot can pin a specific provider/model/thinking level.
- Runtime fallback: if no credential resolves, the Pi runtime's built-in models serve as catch-all (
runtimeFallbackModel).
The selectConfiguredModel() function in executor.ts (line 3507) merges all layers, preferring bot override > user default > deployment default > runtime fallback.
Tool-calling / structured output. The Pi runtime (PiAgentRuntime in packages/adapters/src/pi-runtime.ts) drives the LLM stream with declarative tool definitions. Tools are assembled from three sources: built-in tools (packages/adapters/src/builtin-tools.ts), connector tools from the integration stack, and agent skills. The model responds with tool calls, which the executor routes through applyTool() — handling approval gates, secret injection, computer sandbox commands, and payment connectors. Structured output is not explicitly used in the application layer; it relies on function-calling schemas via Pi.
Local-model support. A local provider (pi-local-provider.ts) registers Ollama-compatible endpoints set via RAKAZO_LOCAL_MODELS env var. OpenAI-compatible providers can be added through the UI with a custom base URL. The PiOpenAiCompatibleCatalog and probeOpenAiCompatibleModels() support probing unknown endpoints for their model list. Thinking levels are clamped via clampCatalogThinkingLevel() (line 24 of model-providers.ts) to what the model actually supports.
POPULAR_MODEL_PROVIDER_IDS is openrouter, openai-codex, anthropic, openai, google and vercel-ai-gateway. It does not include deepseek.ShenSeanChen/waku-agent
answeredLLM providers are configured in waku/providers.toml and loaded as Provider dataclasses in waku/loop/models.py. PROVIDERS supports: anthropic, openai, gemini, deepseek, minimax, kimi, glm, openrouter, opencode_zen, opencode_go, and waku-platform (hosted free tier). Each has kind (anthropic or openai), key_env, default model ids, and optional endpoints. Anthropic-wire providers use the Anthropic SDK directly. OpenAI-wire providers go through OpenAICompatClient (waku/loop/models.py lines 393-513) which translates formats. User selects provider via WAKU_PROVIDER env var. Tool calling uses tool_use pattern: schemas from ToolRegistry.schemas() passed as tools= parameter. Structured output is not used; tools return strings. small_model is used for retrieval gate, consolidation, and triage. Model ids are resolved through models_for() with env overrides and cross-provider leakage prevention. The hosted free tier uses TurnTagged client with X-Waku-Turn headers for metering. Timeout defaults to 120 seconds. Local model support works through OpenAI-compatible endpoints.
agenvoy/Agenvoy
answeredLLM provider selection and configuration is handled by go-llm-router (a Go package github.com/pardnchiu/go-llm-router). The provider.Agent interface provides Send() and SendStream() methods. The keychain/keychain.go resolves provider config from the OS keychain: it supports API-key-based providers (claude, openai, gemini, grok, deepseek, mistral, nvidia, openrouter, cloudflare, ollama-cloud), OAuth-based providers (copilot, codex, grok-oauth with token refresh), Claude Code as a subprocess (claude-code), and a generic compat provider for OpenAI-compatible endpoints. Models are registered in ~/.config/agenvoy/config.json as a flat list of model names like [email protected]. Tiered routing (internal/session/config/tier.go) classifies model names into tiers S/A/B/C based on heuristics (e.g., claude-fable → S, claude-sonnet → A, claude-haiku → B, gemma → C), with a fallback priority rank. LLM-driven agent selection (internal/agents/exec/selectAgent.go) calls a dispatcher model with a prompt listing available agents and the user request, asking it to return which model(s) to use and a work type (code/research/work/chat/fetch). The work type determines the reasoning level (xhigh/high/medium/low/none). If no dispatcher model is configured, the first registered model is used. An optional dispatcher_beta mode uses a faster Jev classifier for the routing decision. Structured output / tool calling is handled by go-llm-router's native support — the agent sends tool definitions to the LLM, and tool calls are extracted from the response choices at execute.go:706-763. Reasoning effort is specified per-model through the provider.Reasoning enum (none/low/medium/high/xhigh) from the go-llm-router, and reasoning tags like </think> are parsed as a fallback. Context window management uses model-specific thresholds from compact.CheckThreshold() (based on 80% of the model's context window). Local models are supported via the compat provider pointing at a local endpoint (e.g., Ollama at http://localhost:11434/v1) and the ollama-cloud provider (which is Ollama's cloud offering, not local — but the compat provider covers truly local endpoints).
dispatcher_beta classifier is a hosted third-party service (api.typesafe.ai, model jev-latest) that receives the request text and recent turns, not a local or faster in-process classifier.← How are actions on the user's behalf gated? · How is it deployed and self-hosted? →