3f8a1626a7b26f391b0aa7c1e477cd92c167ced1
AI Answers for SearXNG
Does not block result loading time.
A SearXNG plugin that generates an AI answer using search results as RAG grounding context. Supports Google Gemini and OpenAI-compatible providers (OpenRouter, Ollama, etc.).
Installation
Place ai_answers.py into the searx/plugins directory of your instance (or mount it in a container) and enable it in settings.yml:
plugins:
- name: ai_answers
active: true
Configuration
Set the following environment variables:
General
LLM_PROVIDER:openrouter(default) orgemini.GEMINI_MAX_TOKENS: Defaults to500.GEMINI_TEMPERATURE: Defaults to0.2.
OpenRouter / OpenAI / Ollama
OPENROUTER_API_KEY: Your API key.OPENROUTER_MODEL: Defaults togoogle/gemma-3-27b-it:free.OPENROUTER_BASE_URL: Defaults toopenrouter.ai. (Change tolocalhost:11434for Ollama).
Google Gemini
GEMINI_API_KEY: Your Google AI API key.GEMINI_MODEL: Defaults togemma-3-27b-it.
How It Works
After search completes, the plugin extracts the top 6 results as context. A client-side script calls the stream endpoint with a signed token. The LLM response streams back. Token by token rendering is soon.
Ollama (Local)
LLM_PROVIDER=openrouter
OPENROUTER_API_KEY=ollama
OPENROUTER_MODEL=gemma3:27b
OPENROUTER_BASE_URL=localhost:11434
Description
A SearXNG plugin that generates local AI overviews powered by Ollama, using search results as RAG context.
Languages
Python
100%