# raghul-18/adaptify architecture

> Architecture diagram of the GitHub repository raghul-18/adaptify, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raghul-18/adaptify
- Repository: https://github.com/raghul-18/adaptify

## Overview

Adaptify presents the Open WebUI experience: users authenticate, choose a model, send a prompt, and receive a response, optionally enriched with documents or web results. The backend also exposes model-provider, audio, image, and administration capabilities. The graph preserves these documented product branches and core backend modules; several frontend-to-backend links are dashed because their implementation was not excerpted, and unsampled modules are represented only where the source index establishes their presence.

Main entry points: [`backend/open_webui/apps/webui/main.py`](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/main.py) (Web UI API), [`backend/open_webui/config.py`](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/config.py) (Configuration), [`backend/open_webui/apps/webui/internal/db.py`](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/internal/db.py) (Database layer), [`backend/open_webui/apps/rag/main.py`](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/rag/main.py) (RAG service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app_shell["App shell<br/>[+layout.svelte]"]
  node_chat_ui["Chat interface<br/>[Chat.svelte]"]
  node_api_client["API client<br/>[index.ts]"]
  node_playground["Model playground<br/>[Playground.svelte]"]
  node_workspace["Workspace tools<br/>[Models.svelte]"]
end

subgraph group_conversation["Conversation services"]
  node_webui_app["Web UI API<br/>[main.py]"]
  node_ollama_api["Ollama API<br/>[main.py]"]
  node_openai_api["OpenAI API<br/>[main.py]"]
  node_function_runtime["Function runtime<br/>[utils.py]"]
end

subgraph group_knowledge["Knowledge and media"]
  node_rag_api["RAG service<br/>[main.py]"]
  node_rag_search["Web search<br/>[main.py]"]
  node_image_service["Image generation<br/>[main.py]"]
  node_audio_service["Audio service<br/>[main.py]"]
end

subgraph group_administration["Identity and administration"]
  node_auth_routes["Authentication<br/>[auths.py]"]
  node_user_store[("User records<br/>[users.py]")]
  node_auth_store[("Auth records<br/>[auths.py]")]
  node_function_store[("Function records<br/>[functions.py]")]
  node_model_store[("Model records<br/>[models.py]")]
  node_tool_store[("Tool records<br/>[tools.py]")]
end

subgraph group_foundation["Runtime foundation"]
  node_database_layer[("Database layer<br/>[db.py]")]
  node_configuration["Configuration<br/>[config.py]"]
  node_environment["Environment settings<br/>[env.py]"]
  node_payload_utils["Payload utilities<br/>[payload.py]"]
  node_task_utils["Task utilities<br/>[task.py]"]
  node_misc_utils["Message utilities<br/>[misc.py]"]
  node_tool_utils["Tool execution<br/>[tools.py]"]
  node_webhook_utils["Webhooks<br/>[webhook.py]"]
end

node_user(("User"))
node_ollama_service{{"Ollama server"}}
node_openai_service{{"OpenAI-compatible service"}}
node_image_provider{{"Image provider"}}
node_audio_provider{{"Audio provider"}}

node_user -->|"uses"| node_app_shell
node_app_shell -.->|"opens chat"| node_chat_ui
node_chat_ui -.->|"submits prompt"| node_api_client
node_api_client -.->|"sends requests"| node_webui_app
node_webui_app -.->|"routes model work"| node_ollama_api
node_webui_app -.->|"routes model work"| node_openai_api
node_ollama_api -.->|"forwards requests"| node_ollama_service
node_openai_api -.->|"forwards requests"| node_openai_service
node_user -->|"tests models"| node_playground
node_user -->|"manages models"| node_workspace
node_webui_app -->|"executes functions"| node_function_runtime
node_webui_app -->|"loads functions"| node_function_store
node_webui_app -->|"looks up models"| node_model_store
node_user -->|"adds knowledge"| node_rag_api
node_rag_api -->|"uses search"| node_rag_search
node_rag_api -.->|"enriches chat"| node_webui_app
node_user -->|"requests images"| node_image_service
node_image_service -->|"generates with"| node_image_provider
node_user -->|"uses voice"| node_audio_service
node_audio_service -.->|"requests audio"| node_audio_provider
node_user -.->|"authenticates"| node_auth_routes
node_auth_routes -->|"checks credentials"| node_auth_store
node_auth_routes -->|"checks users"| node_user_store
node_auth_store -->|"reads and writes"| node_database_layer
node_user_store -->|"reads and writes"| node_database_layer
node_function_store -->|"reads and writes"| node_database_layer
node_model_store -->|"reads and writes"| node_database_layer
node_tool_store -.->|"reads and writes"| node_database_layer
node_webui_app -.->|"uses tool support"| node_tool_utils
node_tool_utils -->|"loads tools"| node_tool_store
node_webui_app -.->|"builds payload"| node_payload_utils
node_payload_utils -->|"uses task helpers"| node_task_utils
node_payload_utils -->|"uses message helpers"| node_misc_utils
node_webui_app -.->|"uses settings"| node_configuration
node_ollama_api -->|"reads settings"| node_configuration
node_openai_api -->|"reads settings"| node_configuration
node_rag_api -->|"reads settings"| node_configuration
node_image_service -->|"reads settings"| node_configuration
node_audio_service -->|"reads settings"| node_configuration
node_configuration -->|"uses environment"| node_environment
node_auth_routes -.->|"sends notifications"| node_webhook_utils

click node_app_shell "https://github.com/raghul-18/adaptify/blob/main/src/routes/(app)/%2Blayout.svelte"
click node_chat_ui "https://github.com/raghul-18/adaptify/blob/main/src/lib/components/chat/Chat.svelte"
click node_api_client "https://github.com/raghul-18/adaptify/blob/main/src/lib/apis/index.ts"
click node_playground "https://github.com/raghul-18/adaptify/blob/main/src/lib/components/playground/Playground.svelte"
click node_workspace "https://github.com/raghul-18/adaptify/blob/main/src/lib/components/workspace/Models.svelte"
click node_webui_app "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/main.py"
click node_ollama_api "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/ollama/main.py"
click node_openai_api "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/openai/main.py"
click node_function_runtime "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/utils.py"
click node_rag_api "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/rag/main.py"
click node_rag_search "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/rag/search/main.py"
click node_image_service "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/images/main.py"
click node_audio_service "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/audio/main.py"
click node_auth_routes "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/routers/auths.py"
click node_user_store "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/users.py"
click node_auth_store "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/auths.py"
click node_function_store "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/functions.py"
click node_model_store "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/models.py"
click node_tool_store "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/tools.py"
click node_database_layer "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/internal/db.py"
click node_configuration "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/config.py"
click node_environment "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/env.py"
click node_payload_utils "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/payload.py"
click node_task_utils "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/task.py"
click node_misc_utils "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/misc.py"
click node_tool_utils "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/tools.py"
click node_webhook_utils "https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/webhook.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_shell,node_chat_ui,node_api_client,node_playground,node_workspace,node_user toneBlue
class node_webui_app,node_ollama_api,node_openai_api,node_function_runtime toneAmber
class node_rag_api,node_rag_search,node_image_service,node_audio_service,node_ollama_service toneMint
class node_auth_routes,node_user_store,node_auth_store,node_function_store,node_model_store,node_tool_store toneRose
class node_database_layer,node_configuration,node_environment,node_payload_utils,node_task_utils,node_misc_utils,node_tool_utils,node_webhook_utils,node_openai_service,node_image_provider,node_audio_provider toneIndigo
```

## Components

### Web experience

- [App shell](https://github.com/raghul-18/adaptify/blob/main/src/routes/(app)/%2Blayout.svelte): `src/routes/(app)/+layout.svelte`
- [Chat interface](https://github.com/raghul-18/adaptify/blob/main/src/lib/components/chat/Chat.svelte): `src/lib/components/chat/Chat.svelte`
- [API client](https://github.com/raghul-18/adaptify/blob/main/src/lib/apis/index.ts): `src/lib/apis/index.ts`
- [Model playground](https://github.com/raghul-18/adaptify/blob/main/src/lib/components/playground/Playground.svelte): `src/lib/components/playground/Playground.svelte`
- [Workspace tools](https://github.com/raghul-18/adaptify/blob/main/src/lib/components/workspace/Models.svelte): `src/lib/components/workspace/Models.svelte`

### Conversation services

- [Web UI API](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/main.py): `backend/open_webui/apps/webui/main.py`
- [Ollama API](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/ollama/main.py): `backend/open_webui/apps/ollama/main.py`
- [OpenAI API](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/openai/main.py): `backend/open_webui/apps/openai/main.py`
- [Function runtime](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/utils.py): `backend/open_webui/apps/webui/utils.py`

### Knowledge and media

- [RAG service](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/rag/main.py): `backend/open_webui/apps/rag/main.py`
- [Web search](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/rag/search/main.py): `backend/open_webui/apps/rag/search/main.py`
- [Image generation](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/images/main.py): `backend/open_webui/apps/images/main.py`
- [Audio service](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/audio/main.py): `backend/open_webui/apps/audio/main.py`

### Identity and administration

- [Authentication](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/routers/auths.py): `backend/open_webui/apps/webui/routers/auths.py`
- [User records](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/users.py): `backend/open_webui/apps/webui/models/users.py`
- [Auth records](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/auths.py): `backend/open_webui/apps/webui/models/auths.py`
- [Function records](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/functions.py): `backend/open_webui/apps/webui/models/functions.py`
- [Model records](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/models.py): `backend/open_webui/apps/webui/models/models.py`
- [Tool records](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/models/tools.py): `backend/open_webui/apps/webui/models/tools.py`

### Runtime foundation

- [Database layer](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/apps/webui/internal/db.py): `backend/open_webui/apps/webui/internal/db.py`
- [Configuration](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/config.py): `backend/open_webui/config.py`
- [Environment settings](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/env.py): `backend/open_webui/env.py`
- [Payload utilities](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/payload.py): `backend/open_webui/utils/payload.py`
- [Task utilities](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/task.py): `backend/open_webui/utils/task.py`
- [Message utilities](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/misc.py): `backend/open_webui/utils/misc.py`
- [Tool execution](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/tools.py): `backend/open_webui/utils/tools.py`
- [Webhooks](https://github.com/raghul-18/adaptify/blob/main/backend/open_webui/utils/webhook.py): `backend/open_webui/utils/webhook.py`

### Other components

- **User**
- **Ollama server**
- **OpenAI-compatible service**
- **Image provider**
- **Audio provider**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Chat interface: opens chat
- Chat interface → API client: submits prompt
- API client → Web UI API: sends requests
- Web UI API → Ollama API: routes model work
- Web UI API → OpenAI API: routes model work
- Ollama API → Ollama server: forwards requests
- OpenAI API → OpenAI-compatible service: forwards requests
- User → Model playground: tests models (evidence: `README.md`)
- User → Workspace tools: manages models (evidence: `README.md`)
- Web UI API → Function runtime: executes functions (evidence: `backend/open_webui/apps/webui/main.py`)
- Web UI API → Function records: loads functions (evidence: `backend/open_webui/apps/webui/main.py`)
- Web UI API → Model records: looks up models (evidence: `backend/open_webui/apps/webui/main.py`)
- User → RAG service: adds knowledge (evidence: `README.md`)
- RAG service → Web search: uses search (evidence: `backend/open_webui/apps/rag/main.py`)
- RAG service → Web UI API: enriches chat
- User → Image generation: requests images (evidence: `README.md`)
- Image generation → Image provider: generates with (evidence: `backend/open_webui/apps/images/main.py`)
- User → Audio service: uses voice (evidence: `README.md`)
- Audio service → Audio provider: requests audio
- User → Authentication: authenticates
- Authentication → Auth records: checks credentials (evidence: `backend/open_webui/apps/webui/routers/auths.py`)
- Authentication → User records: checks users (evidence: `backend/open_webui/apps/webui/routers/auths.py`)
- Auth records → Database layer: reads and writes (evidence: `backend/open_webui/apps/webui/models/auths.py`)
- User records → Database layer: reads and writes (evidence: `backend/open_webui/apps/webui/models/users.py`)
- Function records → Database layer: reads and writes (evidence: `backend/open_webui/apps/webui/models/functions.py`)
- Model records → Database layer: reads and writes (evidence: `backend/open_webui/apps/webui/models/models.py`)
- Tool records → Database layer: reads and writes
- Web UI API → Tool execution: uses tool support (evidence: `backend/open_webui/apps/webui/main.py`)
- Tool execution → Tool records: loads tools (evidence: `backend/open_webui/utils/tools.py`)
- Web UI API → Payload utilities: builds payload (evidence: `backend/open_webui/apps/webui/main.py`)
- Payload utilities → Task utilities: uses task helpers (evidence: `backend/open_webui/utils/payload.py`)
- Payload utilities → Message utilities: uses message helpers (evidence: `backend/open_webui/utils/payload.py`)
- Web UI API → Configuration: uses settings (evidence: `backend/open_webui/apps/webui/main.py`)
- Ollama API → Configuration: reads settings (evidence: `backend/open_webui/apps/ollama/main.py`)
- OpenAI API → Configuration: reads settings (evidence: `backend/open_webui/apps/openai/main.py`)
- RAG service → Configuration: reads settings (evidence: `backend/open_webui/apps/rag/main.py`)
- Image generation → Configuration: reads settings (evidence: `backend/open_webui/apps/images/main.py`)
- Audio service → Configuration: reads settings (evidence: `backend/open_webui/apps/audio/main.py`)
- Configuration → Environment settings: uses environment (evidence: `backend/open_webui/config.py`)
- Authentication → Webhooks: sends notifications (evidence: `backend/open_webui/apps/webui/routers/auths.py`)
