fix: settings page and help docs updated for model registry V2

settings.html:
- Remove Gemini API Key section (keys now managed in Model Registry)
- Rename "Local Models" → "Model Registry" with updated description
  covering all providers (Anthropic, Google, local hosts)
- Update button text: "Manage local models" → "Manage models"

settings.py: remove dead gemini_key template variable lookups

HELP.md:
- Fix navigation path: ☰ → Account → Model Registry → Manage models
- Restructure Model Registry section as ordered steps (1: providers/hosts,
  2: add models, 3: assign roles) so dependency order is clear
- Add explicit note that accounts/hosts must exist before adding models

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-04-27 21:07:05 -04:00
parent 9f6b162fbd
commit 6e56024815
3 changed files with 40 additions and 72 deletions

View File

@@ -42,20 +42,11 @@ def _settings_page(username: str, personas: list[str], success: str = "", error:
html = (_STATIC / "settings.html").read_text()
html = html.replace("{{ username }}", username)
# Connected Google account
# Connected Google account (OAuth sign-in)
auth_data = _read_auth(username)
google_email = auth_data.get("google_email") or ""
html = html.replace("{{ google_email }}", google_email)
# Gemini API key — show masked hint only, never the full key
gemini_key = auth_data.get("gemini_api_key") or ""
if gemini_key:
hint = f"Saved (…{gemini_key[-4:]})"
else:
hint = "Using server key"
html = html.replace("{{ gemini_key_hint }}", hint)
html = html.replace("{{ gemini_key_set }}", "true" if gemini_key else "false")
persona_items = "\n".join(
f'''<li>
<a href="/{username}/{p}" class="persona-link">{p}</a>

View File

@@ -109,57 +109,60 @@ Each response shows a **model tag** (bottom-right of message) with the model lab
---
## Model Registry ( Settings → Models )
## Model Registry
The Model Registry is where you configure which AI models are available and which handles each task type.
Configure which AI models are available and which handles each task type.
**Navigate to:** Settings (top-right of any page) → **Models**
**Navigate to:** (top-right menu) → **Account** → scroll to **Model Registry****Manage models**
### Cloud Providers
---
**Anthropic** — Claude is accessed via the Claude Code CLI. No API key setup needed in the registry — just make sure you're authenticated (`claude auth login` in a terminal).
### Step 1 — Set up providers and hosts
**Google** — Gemini models use the Gemini API with an explicit API key:
1. Settings → Models → Cloud Providers → Google → **Add account**
2. Enter a label (e.g. "Work", "Personal") and your Gemini API key
3. Get a free key at [aistudio.google.com](https://aistudio.google.com/apikey) — free tier is sufficient for most use
4. Add one account per Google account you want to use
Do this before adding models — models need a provider account or local host to attach to.
### Local Hosts
**Anthropic (Claude):** Nothing to configure. Claude uses your existing CLI OAuth session. If Claude isn't working, run `claude auth login` in a terminal.
For Open WebUI, Ollama, LM Studio, OpenRouter, or any OpenAI-compatible server:
1. Settings → Models → Local Hosts → expand **Add host**
2. Enter a label, the API URL (e.g. `http://192.168.1.100:3000`), and an optional API key
3. Choose **Type**: Open WebUI / Ollama, or OpenAI-compatible (OpenRouter, etc.)
4. Save, then use **Fetch models** on the host card to verify connectivity
**Google (Gemini):** Add one entry per API key you want to use:
1. Scroll to **Cloud Providers → Google** → click **+ Add Google account**
2. Enter a label (e.g. "Work", "Personal") and your API key
3. Get a free key at [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
### Adding a Model
**Local hosts** (Open WebUI, Ollama, OpenRouter, etc.):
1. Scroll to **Local Hosts** → click **+ Add host** to expand the form
2. Enter a label, the API URL (e.g. `http://192.168.1.100:3000`), and optional API key
3. Set **Type**: Open WebUI / Ollama, or OpenAI-compatible (for OpenRouter, LM Studio, etc.)
4. Click **Fetch models** on the saved host card to verify connectivity
Settings → Models → Add Model. Use the tabs to select provider:
---
| Tab | How it works |
### Step 2 — Add models
Scroll to **Add Model**. Select the provider tab, fill in the details, click **Add Model**:
| Tab | What you need |
|---|---|
| **Local** | Select a host → enter model name (or use "Fetch from host" to pick from a live list) |
| **Google** | Pick a Gemini model from the catalog → select which Google account to use |
| **Anthropic** | Pick a Claude model from the catalog → uses your CLI OAuth session |
| **Local** | Select a host (from Step 1) → enter model name, or use **Fetch from host** to pick from a live list |
| **Google** | Select a Gemini model from the catalog → select a Google account (from Step 1) |
| **Anthropic** | Select a Claude model from the catalog → uses your CLI session automatically |
Enter a label (auto-filled from the catalog), context window size, and optional tags. Click **Add Model**.
The label and context window size auto-fill from the catalog — edit them if you want. Tags are optional.
### Role Assignments
---
Once models are added, assign them to task types at the bottom of Settings → Models:
### Step 3 — Assign models to roles
Scroll to **Role Assignments** at the bottom of the page. Each role has **Primary**, **Backup 1**, and **Backup 2** slots — Primary is tried first, then backups in order. Changes save automatically.
| Role | Used for |
|---|---|
| **Chat** | Regular conversation — the main chat model |
| **Chat** | Regular conversation |
| **Orchestrator** | Agent mode tool loop |
| **Distill** | Memory distillation (short/mid/long) |
| **Distill** | Memory distillation (short / mid / long) |
| **Coder** | Code-focused tasks |
| **Research** | Research and long-context tasks |
| **Research** | Long-context research tasks |
Each role has **Primary**, **Backup 1**, and **Backup 2** slots. If Primary fails or is unreachable, Backup 1 is tried, then Backup 2. Changes save immediately on select.
Leave all slots empty to use the server-default model (configured in `.env`).
Leave all slots empty to use the server default.
---

View File

@@ -269,44 +269,18 @@
</p>
</div>
<!-- Gemini API key -->
<!-- Model Registry link -->
<div class="section">
<h2>Gemini API Key</h2>
<h2>Model Registry</h2>
<p style="font-size:0.8rem; color:#94a3b8; margin-bottom:0.85rem; line-height:1.55;">
Paste your personal key from
<a href="https://aistudio.google.com/apikey" target="_blank" rel="noopener"
style="color:#a78bfa;">aistudio.google.com/apikey</a>
to use your own Gemini quota. Leave blank to use the shared server key.
</p>
<form method="POST" action="/settings/gemini-key">
<div class="field">
<label for="gemini_api_key">API Key</label>
<input type="text" id="gemini_api_key" name="gemini_api_key"
placeholder="{{ gemini_key_hint }}"
autocomplete="new-password" spellcheck="false"
data-1p-ignore data-lpignore="true" data-form-type="other">
</div>
<button type="submit">Save Key</button>
</form>
<p id="gemini-key-status" style="font-size:0.75rem; color:#94a3b8; margin-top:0.5rem;">
Current: {{ gemini_key_hint }}
<span id="gemini-remove-wrap" style="{{ gemini_key_set == 'false' and 'display:none' or '' }}">
<a href="#" id="gemini-remove-link" style="color:#f87171;">remove</a>
</span>
</p>
</div>
<!-- Local models link -->
<div class="section">
<h2>Local Models</h2>
<p style="font-size:0.8rem; color:#94a3b8; margin-bottom:0.85rem; line-height:1.55;">
Configure OpenAI-compatible hosts and models (Open WebUI, Ollama, LM Studio, etc.).
Configure AI providers (Anthropic, Google), local hosts (Open WebUI, Ollama, OpenRouter, etc.),
and assign models to roles — chat, orchestrator, distill, and more.
</p>
<a href="/settings/models"
style="display:inline-block; padding:0.55rem 1rem; background:#7c3aed; border-radius:6px;
color:#fff; font-size:0.88rem; font-weight:600; text-decoration:none;
transition:background 0.15s;">
Manage local models →
Manage models →
</a>
</div>