Settings
The /settings page is a singleton stored in search_settings (one row, id=1). Three tabs.

Search Filters tab
Server-side rules that apply to every AI search query as non-negotiable WHERE clauses.
- Excluded countries — searchable multi-select; results never include trials whose country list intersects this set.
- Excluded statuses — default
Completed, Terminated, Withdrawn. Default-off statuses are silently filtered everywhere. - Excluded phases — coarse-grained phase filter.
- Excluded cancer types — keyword categories.
- Excluded study types — Interventional / Observational / Expanded Access.
- Only recruiting — single-switch shortcut; overrides Excluded statuses.
- Only with results — trials with posted results.
- Notes — admin-only free text.
Changes take effect within 5 minutes (in-process cache TTL) without a redeploy.
AI Models tab
Per-operation LLM model selection. Drives:
| Setting | Powers |
|---|---|
model_understand | Follow-up question generation (legacy AI Search; mostly unused now) |
model_query | SQL query generation (legacy AI Search; unused after Phase 6 deletion) |
model_upload | Document extraction in the upload flow |
model_chat | The conversational chat at /chat/* |
Both Gemini IDs (gemini-3-flash-preview, gemini-3.1-flash-lite, gemini-2.5-flash-lite, etc.) and OpenAI IDs (gpt-4.1-mini, gpt-4.1, etc.) work. The chat engine routes by model string.
Developer tab
- Dev mode — when on, API error responses include stack traces + tool context. Leave off in production.
- Notes — same field as Search Filters; visible only here.