# How are model providers configured?

> Open-source DeepWiki — a good answer covers: Supported providers; per-stage model selection; OpenAI-compatible endpoints; local models.

Canonical page: https://llms-technical-reviews.com/open-source-deepwiki/q/providers/

## Verdict

[deepwiki-open](/p/deepwiki-open/) reads providers from `api/config/generator.json`. Each provider has a `ChatStreamer` subclass that registers itself: Google (default, `gemini-2.5-flash`), OpenAI, OpenRouter, Ollama, Bedrock, Azure, DashScope, LiteLLM and Anthropic. Each request names one provider and model, and that pair is used for the outline, every page and chat, so you cannot use a different model per stage. The embedder is set separately with `DEEPWIKI_EMBEDDER_TYPE`. For OpenAI-compatible endpoints you set a base URL, or go through LiteLLM. Ollama allows fully local runs. Its OpenRouter client is non-streaming with a 60 s timeout, which this site had to raise for whole-repo outlines.

[OpenDeepWiki](/p/opendeepwiki/) keeps providers and models as database rows managed in an admin console. It seeds them from 29 built-in presets. `AiProviderResolver` reduces them to five request types (OpenAI, OpenAI Responses, Azure OpenAI, Anthropic, DeepSeek), and any OpenAI-compatible URL works. Catalog, content and translation each have their own model and provider binding. Per-model overrides cover thinking modes and request parameters. One gotcha: a built-in preset such as `openrouter` starts disabled, and the env-var migration does not enable it.

Pick deepwiki-open for quick, file-based setup and local models. Pick OpenDeepWiki if you need a cheap model for the catalog and a stronger one for content, or if you manage models centrally for a team.

## Per-project answers

### AsyncFuncAI/deepwiki-open (answered)

Model 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).


Citations: [api/config/generator.json:1-198](https://github.com/AsyncFuncAI/deepwiki-open/blob/d92819a9c9f3b99416e3580ff235fc9d3adf8b89/api/config/generator.json#L1-L198) · [api/config.py:364-417](https://github.com/AsyncFuncAI/deepwiki-open/blob/d92819a9c9f3b99416e3580ff235fc9d3adf8b89/api/config.py#L364-L417) · [api/clients/litellm.py:8-69](https://github.com/AsyncFuncAI/deepwiki-open/blob/d92819a9c9f3b99416e3580ff235fc9d3adf8b89/api/clients/litellm.py#L8-L69) · [api/schemas/base.py:9-44](https://github.com/AsyncFuncAI/deepwiki-open/blob/d92819a9c9f3b99416e3580ff235fc9d3adf8b89/api/schemas/base.py#L9-L44) · [api/config/generator.litellm.json:1-30](https://github.com/AsyncFuncAI/deepwiki-open/blob/d92819a9c9f3b99416e3580ff235fc9d3adf8b89/api/config/generator.litellm.json#L1-L30)

### AIDotNet/OpenDeepWiki (answered)

**Provider 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.


Citations: [src/OpenDeepWiki/Services/AI/AiProviderResolver.cs:1-228](https://github.com/AIDotNet/OpenDeepWiki/blob/d33113c88c56458c202fa6904ec114387319f1f5/src/OpenDeepWiki/Services/AI/AiProviderResolver.cs#L1-L228) · [src/OpenDeepWiki/Agents/AgentFactory.cs:17-80](https://github.com/AIDotNet/OpenDeepWiki/blob/d33113c88c56458c202fa6904ec114387319f1f5/src/OpenDeepWiki/Agents/AgentFactory.cs#L17-L80) · [src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs:1-241](https://github.com/AIDotNet/OpenDeepWiki/blob/d33113c88c56458c202fa6904ec114387319f1f5/src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs#L1-L241)
