How are model providers configured?
Supported providers; per-stage model selection; OpenAI-compatible endpoints; local models.
Verdict
OpenDeepWiki and openDeepWiki (Go) are best if different stages need different models or a team manages models centrally. RepoWiki reaches the most providers with the least setup.
Models in the database, chosen per stage. OpenDeepWiki seeds 29 provider presets and reduces them to five request types (OpenAI, OpenAI Responses, Azure OpenAI, Anthropic, DeepSeek). Catalog, content and translation each have their own model. The built-in openrouter preset starts disabled, and setting it through environment variables does not enable it. openDeepWiki (Go) stores API keys as rows with a priority. anthropic gets a Claude client, and everything else goes through an OpenAI-compatible client. Each agent’s YAML can pin a model, and ProxyChatModel fails over across up to three models. Its Claude client sends headers that pose as the Claude Code CLI.
Config file, one model for every stage. deepwiki-open has nine provider classes in generator.json, with Google gemini-2.5-flash as the default and Ollama for local runs. The embedder is set separately. Its OpenRouter client does not stream and times out after 60 s. RepoWiki uses litellm provider/model strings with short aliases, and deepseek/deepseek-chat is the default. readmeX uses one OpenAI or Azure client, detected from the URL, with separate settings for chat, image and embedding models. It ignores its configured token limit and temperature. RepoAgent uses llama-index OpenAILike with gpt-4o-mini as the default. Local models work only behind an OpenAI-compatible server, despite the README. Its chat demo hard-codes gpt-4o-mini and gpt-4o.
Routed by prompt size. deepwiki-rs maps eight providers through rig. Prompts up to 32 KB go to model_efficient with model_powerful as fallback, and larger ones go to model_powerful. The default endpoint is ModelScope with Qwen models, and Ollama defaults to localhost:11434.
Pick: OpenDeepWiki for a cheap catalog model and a stronger content model. Pick: RepoWiki or deepwiki-open for quick file-based setup, including local models. Pick: openDeepWiki (Go) for automatic failover across several keys.
Per-project answers
AsyncFuncAI/deepwiki-open
answeredModel providers are configured through JSON config files and a client registry pattern. The primary config is api/config/generator.json, which defines providers and their models. The default provider is google with gemini-2.5-flash as the default model; OpenAI (gpt-5-nano as default), OpenRouter, Ollama, Bedrock, Azure, DashScope, and LiteLLM are all supported (generator.json lines 4-198). A LiteLLM variant of the config lives in generator.litellm.json with litellm as the default provider.
Each provider has a corresponding ChatStreamer subclass in api/chat/_stream.py that registers itself via the provider class attribute: OllamaChatStreamer, OpenRouterChatStreamer, OpenAIChatStreamer, AzureChatStreamer, LiteLLMChatStreamer, BedrockChatStreamer, DashScopeChatStreamer, GoogleGenerativeChatStreamer, and AnthropicChatStreamer. The ChatStreamer.create() factory method (line 40) looks up the provider name in a registry dict and instantiates the right class.
For per-stage model selection, get_model_config() in config.py (line 364) looks up a provider's configuration, resolves the model client class, and extracts model-specific parameters (temperature, top_p, etc.). The same provider+model tuple is passed through all requests (ChatCompletionRequest and WikiTaskRequest via RepoRequestBase schema, api/schemas/base.py line 9). The embedder is configured separately via DEEPWIKI_EMBEDDER_TYPE env var (openai | google | ollama | bedrock) and its own config file (embedder.json).
OpenAI-compatible endpoints are supported via several paths. The LiteLLMClient (api/clients/litellm.py) extends the OpenAI client, connecting to a LiteLLM proxy at LITELLM_BASE_URL (default localhost:4000). The OpenAIClient uses the standard OpenAI API. Any OpenAI-compatible endpoint can be configured by pointing the client to a different base URL. Local models run through OllamaClient (ollama.py) or via the Ollama provider with local models like qwen3:1.7b, llama3:8b, and qwen3:8b (generator.json lines 116-141).
AIDotNet/OpenDeepWiki
answeredProvider model. Providers are configured through database entities AiProviderConfig and AiModelConfig, or through model configs (ModelConfig). The AiProviderResolver (src/OpenDeepWiki/Services/AI/AiProviderResolver.cs:52) resolves a provider+model pair into a ResolvedAiModel with endpoint, API key, request type, token pricing, and capabilities. It queries the database for active non-deleted configurations.
Supported provider types. AiProviderResolver.ParseRequestType() (line 199–208) maps normalized provider type strings to AiRequestType enum values: OpenAI, AzureOpenAI, OpenAIResponses, Anthropic, DeepSeekOpenAI. The NormalizeProviderType() function (line 137–153) handles aliases: azure, azure-openai → AzureOpenAI; anthropic, claude → Anthropic; deepseek, deepseek-openai-chat → DeepSeekOpenAI; openai-chat, openai → OpenAI. The AgentFactory (src/OpenDeepWiki/Agents/AgentFactory.cs:60) constructs the appropriate HTTP client per type — for Anthropic it uses an Anthropic SDK client, for DeepSeek a DeepSeekOpenAIChatClient, for OpenAI the OpenAI SDK (chat or responses API).
Per-stage model selection. The WikiGeneratorOptions (src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs:9) has separate fields for each stage: CatalogModel (for catalog and mind map generation), ContentModel (for document content), TranslationModel (optional fallback to ContentModel). Each model field can be paired with a matching *ProviderId (e.g., CatalogProviderId, ContentProviderId) to bind a specific provider. WikiGeneratorOptionsConfigurator (src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptionsConfigurator.cs:5) wires environment variables: WIKI_LANGUAGES, WIKI_MAX_CONCURRENT_GENERATIONS, plus per-stage config via the WikiGenerator config section.
OpenAI-compatible endpoints. Any provider can use an arbitrary BaseUrl (line 210–226). If the base URL is empty, defaults are assigned per type (Anthropic → https://api.anthropic.com, DeepSeek → https://api.deepseek.com/v1, others → https://api.openai.com/v1). This makes any OpenAI-compatible endpoint (vLLM, Ollama, etc.) usable by setting the request type to OpenAI.
Built-in presets. AiProviderPresetCatalog (src/OpenDeepWiki/Services/AI/AiProviderPresetCatalog.cs:12) loads embedded JSON presets from Services.AI.BuiltinProviderPresets.json containing provider definitions like name, type, default base URL, default model list, and pricing. The presets support seeding on first run via AiProviderPresetSeeder.
Overrides. Each provider and model carries RequestOverridesJson and ThinkingConfigJson, allowing per-invocation passthrough of provider-specific parameters. The AiRequestOptions (src/OpenDeepWiki/Agents/AgentFactory.cs:26) exposes SupportsThinking, ThinkingEnabled, and all override fields, which are applied in the handler chain.
sopaco/deepwiki-rs
answeredModel providers are configured through the LLMConfig struct in src/config.rs. The LLMProvider enum supports 8 providers: OpenAI, Moonshot, DeepSeek, Mistral, OpenRouter, Anthropic, Gemini, and Ollama. Each is mapped to a rig provider client in src/llm/client/providers.rs via the ProviderClient enum. The ProviderClient::new() factory method creates the appropriate rig client, using builder patterns for custom base URLs. The only hardcoded URL check is for Anthropic: custom URLs are only used if they contain "anthropic" — otherwise it defaults to https://api.anthropic.com to avoid accidentally routing through a non-Anthropic endpoint when a global default URL is set.
Per-stage model selection is governed by evaluate_befitting_model() in src/llm/client/utils.rs: if combined system+user prompt is ≤32KB, it uses model_efficient with model_powerful as fallback; beyond 32KB, it uses model_powerful with no fallback. Both models come from config (model_efficient, model_powerful).
OpenAI-compatible endpoints are supported generically: OpenAI, Moonshot, and DeepSeek clients all accept custom base_url. For the OpenAI provider specifically, ProviderAgent::prompt() has an HTTP fallback path (prompt_via_http): when the rig agent fails with an API response parsing error, it retries via a raw reqwest POST to {base_url}/chat/completions with the same system/user messages, max_tokens, and temperature.
Ollama is supported with a dedicated ollama_extractor_wrapper that wraps the rig agent for structured extraction. Local models use api_base_url defaulting to http://localhost:11434 when provider is Ollama (set in cli.rs line 193-195). All providers support configurable max_tokens, temperature (optional), retry_attempts (default 3), retry_delay_ms (default 5000), and timeout_seconds (default 300).
OpenBMB/RepoAgent
answeredRepoAgent supports OpenAI-compatible endpoints via a single model provider abstraction. There is no multi-provider abstraction layer (no LangChain, no LiteLLM, no custom provider registry).
Configuration: Providers are configured through two settings classes in settings.py:
ChatCompletionSettings(settings.py:58-69):model(defaultgpt-4o-mini),temperature(default 0.2),request_timeout(default 60),openai_base_url(defaulthttps://api.openai.com/v1),openai_api_key(loaded from env, SecretStr field).ProjectSettings(settings.py:27-56):language,max_thread_count,ignore_list, etc.
These are parsed from environment variables via pydantic-settings by default, or set explicitly via CLI flags passed to SettingsManager.initialize_with_params() (settings.py:87-123).
LLM instantiation: The main doc-generation pipeline uses llama-index's OpenAILike class (chat_engine.py:17-25), which accepts any OpenAI-compatible base URL. This means any service that exposes an OpenAI-compatible API (Azure OpenAI, Ollama with an OpenAI proxy, vLLM, etc.) can be used by setting --base-url. The API key is passed through to this class.
Per-stage model selection: There are two distinct model tiers hardcoded in the chat-with-repo feature:
weak_model=gpt-4o-mini: used for query generation, keyword extraction, initial RAG response, and relevance reranking (rag.py:22-25)strong_model=gpt-4o: used only for the final RAG-AR (advanced retrieval-augmented generation) call (rag.py:26-31)
In the main doc-generation pipeline, only one model is used — whatever is configured in ChatCompletionSettings (chat_engine.py:17-25). There is no per-object-type or per-stage model selection.
Local models: The README claims "Local model support like Llama, chatGLM, Qwen, GLM4" (README.md:214), but the code contains no local-model abstraction. Since OpenAILike accepts any base URL, locally hosted models behind an OpenAI-compatible server (e.g., Ollama's OpenAI proxy, LocalAI, vLLM) would work transparently, but there is no built-in support for HuggingFace transformers, llama.cpp Python bindings, or any local inference engine. This is a README claim backed only by the generic OpenAI-compatible endpoint design.
Key management: The OpenAI API key is read from the openai_api_key environment variable (secret field, excluded from serialization) (settings.py:63).
aibox22/readmeX
answeredThe single ModelClient class (utils/model_client.py:10-455) handles both LLM and text-to-image (T2I) providers. It supports Standard OpenAI and Azure OpenAI, detected by checking if the base URL contains .openai.azure.com (model_client.py:60-73). The LLM and T2I providers can differ independently — each has its own config block (get_llm_config() and get_t2i_config() in config.py:168-196). Configuration comes from three sources merged by load_config() (config.py:21-98): (1) ~/.readmex/config.json — a JSON file with keys like LLM_API_KEY, LLM_BASE_URL, LLM_MODEL_NAME (default gpt-3.5-turbo), T2I_MODEL_NAME (default dall-e-3); (2) environment variables (LLM_API_KEY, LLM_BASE_URL, etc.) which override the config file; and (3) interactive prompt from validate_config() if required keys are missing (config.py:100-157). For Azure, the _extract_azure_info() method (model_client.py:75-110) parses the Azure endpoint URL to extract azure_endpoint, deployment_name, and api_version, then creates an AzureOpenAI client. For standard OpenAI, it creates OpenAI(base_url=..., api_key=...) — which means any OpenAI-compatible endpoint works (local models via Ollama/vLLM, Doubao, etc.) by pointing base_url at that server. Per-stage model selection: the same ModelClient instance is used for everything — README generation, page content, API docs, architecture diagrams — so there is no per-stage model routing. However, get_answer() accepts an optional model override parameter (model_client.py:188), and _generate_drawio_diagram() controls quality only through retry logic, not model choice. Embeddings use a separate config (EMBEDDING_API_KEY, EMBEDDING_BASE_URL, EMBEDDING_MODEL_NAME), additionally supporting a LOCAL_EMBEDDING boolean to switch between sentence-transformers and the web API (config.py:190-198).
he-yufeng/RepoWiki
answeredModel providers are configured through litellm, which supports 100+ providers via a provider/model string. The Config class (src/repowiki/config.py:50-115) loads settings from three sources in order: CLI flags, environment variables (REPOWIKI_MODEL, REPOWIKI_API_KEY, REPOWIKI_API_BASE, REPOWIKI_LANG), and ~/.repowiki/config.json. If no API key is set, it falls back to provider-specific env vars: DEEPSEEK_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEY (config.py:85-89).
Model aliases map common names to litellm model strings (config.py:18-32): deepseek → deepseek/deepseek-chat, claude → anthropic/claude-sonnet-4-6, gpt → gpt-5.4, gemini → gemini/gemini-3.1-pro-preview, qwen → openai/qwen3.7-plus, kimi → openai/kimi-k3, mimo → openai/mimo-v2.6-flash, and others. The mimo aliases ship Xiaomi's OpenAI-compatible endpoint via MODEL_API_BASES (config.py:34-43), which also maps qwen to DashScope, kimi to Moonshot, glm to BigModel, etc. Any other OpenAI-compatible endpoint can be targeted with repowiki config set api_base https://your-gateway/v1 (config.py:98-99).
There is no per-stage model selection — a single model is used across all four analysis passes and chat. The LLMClient (src/repowiki/llm/client.py:37-144) wraps litellm's acompletion() with retry logic for transient errors (RateLimitError, APIConnectionError, Timeout, etc.) (client.py:53-68), tracks token usage and cost (client.py:97-106), and supports both complete() (non-streaming) and stream() (async generator) methods. The response_format parameter can be passed for structured output (client.py:89). litellm itself is lazily imported to avoid import cost on zero-LLM commands like repowiki map (client.py:25-34).
weibaohui/openDeepWiki
answeredProvider configuration is managed through the APIKey model stored in the database. Each key has fields: provider, base_url, api_key, model, priority, status (enabled/disabled/unavailable). The EnhancedModelProviderImpl reads keys from the api_key repo to create model instances. Two provider types are supported: "anthropic" uses the claude.NewChatModel with native Claude config (supporting thinking features and the Claude Code HTTP client), while all other providers default to OpenAI-compatible via openai.NewChatModel — this means any OpenAI-compatible endpoint (local Ollama, vLLM, etc.) works by setting the appropriate base_url. Per-stage model assignment is configured per Agent YAML definition: each agent can set a model field (referencing an APIKey by name) or use_model_pool for multi-model fallback. The ProxyChatModel wraps the model with automatic retry, rate-limit detection, and failover across the priority-ordered model pool. On rate-limit errors, the RateLimiter marks the model unavailable and GetNextModel() picks the next available one from the pool. If no model name is specified, a dynamic ProxyChatModel auto-selects from all database-enabled keys.
← How are individual pages generated? · How is interactive Q&A / chat implemented? →