# OpenDeepWiki Mermaid Diagram Generation: Required AI Models and Configuration

> Discover the AI models needed for OpenDeepWiki Mermaid diagram generation. Learn how to configure ContentModel for seamless diagram creation in your documentation.

- Repository: [AIDotNet/OpenDeepWiki](https://github.com/aidotnet/opendeepwiki)
- Tags: how-to-guide
- Published: 2026-02-19

---

**OpenDeepWiki relies exclusively on the `ContentModel` configuration setting—defaulting to `gpt-5.2`—to generate Mermaid diagram syntax during the document content generation phase.**

OpenDeepWiki, maintained by the AIDotNet organization, is an open-source documentation generator that automates the creation of technical wiki content, including architecture and flow diagrams. Understanding which AI models power the OpenDeepWiki Mermaid diagram generation pipeline is essential for optimizing response quality, controlling API costs, and configuring self-hosted instances.

## Which AI Model Powers OpenDeepWiki Mermaid Diagram Generation?

OpenDeepWiki creates Mermaid diagrams as part of the **document-content generation** step. The AI model responsible for producing the diagram syntax is the **content-generation model** defined in `WikiGeneratorOptions.ContentModel`.

In [`src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs), the `ContentModel` property specifies which model handles all content generation tasks, including the required architecture and flow Mermaid diagrams:

```csharp
// src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs
public class WikiGeneratorOptions
{
    /// <summary>
    /// The AI model to use for document content generation.
    /// Default: gpt-5.2 (better quality for content generation).
    /// This model also produces the Mermaid diagram definitions.
    /// </summary>
    public string ContentModel { get; set; } = "gpt-5.2";
}

```

## Configuring the Content Model for OpenDeepWiki Mermaid Diagram Generation

You can override the default `gpt-5.2` model via [`appsettings.json`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/appsettings.json), environment variables, or the admin UI. The configuration applies to all content generation, including Mermaid diagrams.

### Using appsettings.json

Add the `WikiGenerator` section to your configuration file:

```json
{
  "WikiGenerator": {
    "ContentModel": "gpt-4o-mini",
    "CatalogModel": "gpt-4o-mini"
  }
}

```

### Using Environment Variables

Set the `WIKI_CONTENT_MODEL` variable before starting the service:

```bash
export WIKI_CONTENT_MODEL=gpt-4o-mini
dotnet run --project src/OpenDeepWiki/OpenDeepWiki.csproj

```

The mapping from environment variables to configuration options is handled in [`src/OpenDeepWiki/Services/Admin/SystemSettingDefaults.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/src/OpenDeepWiki/Services/Admin/SystemSettingDefaults.cs).

## Other AI Models in the OpenDeepWiki Pipeline

OpenDeepWiki defines additional model settings that are **not required** for basic Mermaid diagram creation:

| Model setting | Purpose | Required for Mermaid? |
|---------------|---------|----------------------|
| `CatalogModel` | Generates the repository catalog (folder and page structure). | **No** |
| `ContentModel` | Generates page content **and** Mermaid diagrams. | **Yes** |
| `TranslationModel` | Translates generated pages to additional languages. | **Only if you need translated diagrams** |

If you run OpenDeepWiki in a multilingual setup, the `ContentModel` generates the diagram once. The `TranslationModel` then translates the surrounding text, leaving the Mermaid syntax unchanged (node IDs and labels remain as-is).

## Source Code Implementation Details

The diagram generation logic resides in [`src/OpenDeepWiki/Services/Wiki/WikiGenerator.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/src/OpenDeepWiki/Services/Wiki/WikiGenerator.cs). This service calls the model defined in `ContentModel` via the `ExecuteAgentWithRetryAsync` method (around lines 24-30) when executing the content-generation prompt that produces Mermaid syntax.

Environment variable mapping is implemented in [`src/OpenDeepWiki/Services/Admin/SystemSettingDefaults.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/src/OpenDeepWiki/Services/Admin/SystemSettingDefaults.cs), ensuring that `WIKI_CONTENT_MODEL` properly overrides the default `gpt-5.2` value in `WikiGeneratorOptions`.

## Summary

- OpenDeepWiki uses the **`ContentModel`** configuration setting for all Mermaid diagram generation tasks.
- The default model is **`gpt-5.2`**, defined in [`src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs).
- Configure the model via [`appsettings.json`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/appsettings.json), the `WIKI_CONTENT_MODEL` environment variable, or the admin UI.
- **`CatalogModel`** and **`TranslationModel`** are not required for basic Mermaid diagram generation.

## Frequently Asked Questions

### What is the default AI model for OpenDeepWiki Mermaid diagram generation?

The default model is **`gpt-5.2`**, as specified in the `ContentModel` property of [`WikiGeneratorOptions.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/WikiGeneratorOptions.cs). This model handles all document content generation tasks, including the creation of Mermaid diagram syntax for architecture and flow charts.

### Can I use a different model for Mermaid diagrams than for other content?

No. OpenDeepWiki uses a single **`ContentModel`** setting for all content generation, including Mermaid diagrams. You cannot specify a separate model exclusively for diagram generation without modifying the source code in [`WikiGenerator.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/WikiGenerator.cs) where the `ExecuteAgentWithRetryAsync` method is called.

### Do I need to configure a separate model for translating Mermaid diagrams?

No. The **`TranslationModel`** only translates the surrounding text content. Mermaid diagrams are generated once by the **`ContentModel`** and remain unchanged during translation, as the node IDs and syntax structure are preserved as-is. You only need the translation model if you require the surrounding documentation text in multiple languages.

### How do I override the default model using environment variables?

Set the **`WIKI_CONTENT_MODEL`** environment variable before starting the service. This variable is mapped to `WikiGeneratorOptions.ContentModel` via [`SystemSettingDefaults.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/SystemSettingDefaults.cs), overriding the default `gpt-5.2` value. For example: `export WIKI_CONTENT_MODEL=gpt-4o-mini`.