# Open WebUI Model List — Hardcoded, Not Dynamic

Open WebUI (running via Docker on port 3081) does **not** dynamically pull the model list from the OpenAI-compatible API endpoint (`OPENAI_API_BASE_URL`). Instead, it stores a hardcoded list of model IDs in its SQLite database.

## The Problem

When you add/remove models from llama-swap, Open WebUI will NOT see the changes because its model list is cached in the database.

## How to Check

```bash
docker exec open-webui python3 -c "
import sqlite3, json
conn = sqlite3.connect('/app/backend/data/webui.db')
row = conn.execute('SELECT data FROM config LIMIT 1').fetchone()
config = json.loads(row[0])
models = config['openai']['api_configs']['0']['model_ids']
for m in models:
    print(f'  - {m}')
"
```

## How to Update

```bash
docker exec open-webui python3 -c "
import sqlite3, json
conn = sqlite3.connect('/app/backend/data/webui.db')
row = conn.execute('SELECT id, data FROM config LIMIT 1').fetchone()
config = json.loads(row[1])
config['openai']['api_configs']['0']['model_ids'] = [
    'qwen36-35b-mtp',
    'gemma-12b',
    'gemma-26b-200k',
    'nemotron-term-14b',
    'qwen3-coder-next',
    'glm-4.7-flash-reap',
]
conn.execute('UPDATE config SET data = ?, updated_at = datetime(\"now\") WHERE id = ?',
    (json.dumps(config), row[0]))
conn.commit()
print('Open WebUI model list updated')
"
docker restart open-webui
```

Always restart the container after updating — the model list is loaded at startup.
