AI Provider Config
Configure which AI model answerLoops uses for deflection and embeddings.
answerLoops uses AI for two things:
- Chat — generating answers to questions
- Embeddings — converting text to vectors for semantic search
Platform default
Set OPENAI_API_KEY in .env. This is used by all orgs that haven't configured a custom key in Settings.
OPENAI_API_KEY=sk-proj-...Per-org keys (via Settings UI)
Each org can override the platform key in Settings → AI Model. Keys are encrypted at rest using ENCRYPTION_KEY.
Supported providers: OpenAI, Anthropic, Google Gemini, Groq, Mistral, xAI (Grok), and any OpenAI-compatible endpoint (Ollama, LM Studio, vLLM).
Model ID is a live dropdown, not a fixed list. After entering an API key, click Refresh models to fetch that provider's current model list directly from its own API — this stays accurate as providers ship new models, instead of a hardcoded list going stale. If the live fetch fails, or before you've run it, Model ID falls back to a small built-in list of recent models, or you can type any model ID directly.
Embeddings
Embeddings use OpenAI's text-embedding-3-small by default. This can be changed per-org in Settings → Embeddings.
Only OpenAI does embeddings natively. If the chat provider is anything else (Anthropic, Gemini, Groq, Mistral), enter a separate OpenAI API key in the embedding key field — the save is rejected without one, and knowledge-base search and every KB import would otherwise fail. An OpenAI-compatible endpoint can serve embeddings too (e.g. Ollama's nomic-embed-text).
Embedding vectors are stored in the database alongside each KB article. Changing the embedding model requires re-importing all KB articles.
Self-hosted AI (Ollama)
To use Ollama instead of a cloud provider:
- Run Ollama:
ollama serve - Pull a model:
ollama pull llama3.2 - In Settings → AI Model → Chat provider: OpenAI-compatible
- Base URL:
http://localhost:11434/v1 - Model ID:
llama3.2 - Leave API key blank
Ollama runs on the host machine, not inside Docker. Use http://host.docker.internal:11434/v1 as the base URL when running answerLoops in Docker on Mac/Windows.