AI setup: providers and presets
FileDB has two independent places to configure AI — split deliberately, because they have a different relationship to your data.
Global presets — for the conversational features
AI Chat, AI Agent, and Smart Export are plain stateless /chat/completions calls, with no coupling to specific data. So they share one global named preset, easy to switch, stored in settings_ai.json next to the executable:
{
"active": "prod-openai",
"presets": [
{"name": "prod-openai", "provider": "openai", "base_url": "https://api.openai.com/v1", "api_key": "sk-...", "model": "gpt-4o-mini"},
{"name": "local-proxy", "provider": "custom", "base_url": "https://api.ai-mediator.ru/v1", "api_key": "...", "model": "claude-sonnet"}
]
}
provider is just a UI hint (which default fields to show); the actual call always goes through base_url + api_key, so any OpenAI-compatible /chat/completions endpoint works — including proxies in front of Anthropic or other models.
Managed via the API or the web UI:
curl $URL/api/ai/settings -H "X-Token: $TOK"
curl -X POST $URL/api/ai/preset/save -H "X-Token: $TOK" -d '{"name":"prod-openai","provider":"openai","base_url":"https://api.openai.com/v1","api_key":"sk-...","model":"gpt-4o-mini"}'
curl -X POST $URL/api/ai/preset/activate -H "X-Token: $TOK" -d '{"name":"prod-openai"}'
curl -X POST $URL/api/ai/preset/delete -H "X-Token: $TOK" -d '{"name":"local-proxy"}'
Embeddings config — one per database
Embeddings, hybrid search, and AI import mapping are configured separately for every .fdb file, through the /embeddings web UI — not through settings_ai.json. The reason: a vector is tightly coupled to whichever provider and model produced it — silently repointing a database at a different provider would make vector search compare incomparable things and quietly return garbage. So each database keeps its own independent provider, model, key, and base_url (4 supported providers: OpenAI/compatible, Voyage AI, Google Gemini, Yandex Cloud), and switching providers on a live database requires reindexing.
AI import mapping reuses the api_key/base_url from this per-database config (not the global preset) — see the "Smart Export and AI Import Mapping" page.