diff --git a/cortex/routers/settings.py b/cortex/routers/settings.py index b797670..f3395d3 100644 --- a/cortex/routers/settings.py +++ b/cortex/routers/settings.py @@ -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'''
  • {p} diff --git a/cortex/static/HELP.md b/cortex/static/HELP.md index a18f387..6b9534c 100644 --- a/cortex/static/HELP.md +++ b/cortex/static/HELP.md @@ -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. --- diff --git a/cortex/static/settings.html b/cortex/static/settings.html index fef4f7c..2141534 100644 --- a/cortex/static/settings.html +++ b/cortex/static/settings.html @@ -269,44 +269,18 @@

    - +
    -

    Gemini API Key

    +

    Model Registry

    - Paste your personal key from - aistudio.google.com/apikey - to use your own Gemini quota. Leave blank to use the shared server key. -

    -
    -
    - - -
    - -
    -

    - Current: {{ gemini_key_hint }} - - — remove - -

    -
    - - -
    -

    Local Models

    -

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

    - Manage local models → + Manage models →