AI Tools #Perplexica#AI search#Ollama

Perplexica: Self-Hosted AI Search With Local LLMs

Set up Perplexica with Docker, connect it to Ollama for local LLMs, integrate SearXNG, use focus modes, and compare it to Perplexity.ai.

7 min read

Perplexity.ai is genuinely useful, but it sends every query to their servers, logs your searches, and charges $20/month for full access to the best models. Perplexica is the open-source self-hosted equivalent — it combines a local or remote LLM with SearXNG (a privacy-respecting metasearch engine) to answer questions with citations, entirely on your own infrastructure.

This guide walks through the Docker setup, connecting Ollama for local model inference, configuring the SearXNG integration, understanding focus modes, and how the experience compares to Perplexity.ai in practice.

How Perplexica Works

When you submit a query to Perplexica:

  1. The query is reformulated into effective search terms by the LLM.
  2. SearXNG executes the search across multiple search engines (Google, Bing, DuckDuckGo, etc.) and returns raw results.
  3. Perplexica fetches and parses the top result pages.
  4. The page content is chunked and embedded using a local embedding model.
  5. The most relevant chunks are retrieved and passed to the LLM as context.
  6. The LLM writes an answer with inline citations pointing to source URLs.

This pipeline means Perplexica always searches the live web — it is not limited to a training data cutoff, unlike a standalone local LLM. The combination of fresh web data and local inference is the core value proposition.

Prerequisites

You need Docker and Docker Compose installed. Optionally, install Ollama for local model inference (you can also configure it to use OpenAI or other cloud APIs).

Pull a capable Ollama model:

ollama pull llama3:8b           # Minimum capable model
ollama pull llama3.3:70b        # Better quality, requires 48+ GB RAM
ollama pull nomic-embed-text    # For local embeddings

Docker Setup

Clone the Perplexica repository:

git clone https://github.com/ItzCrazyKns/Perplexica
cd Perplexica

Copy and edit the configuration file:

cp sample.config.toml config.toml
nano config.toml

The key sections to configure:

[GENERAL]
PORT = 3000
SIMILARITY_MEASURE = "cosine"

[API_KEYS]
OPENAI = ""             # Leave blank to use local Ollama only
GROQ = ""               # Optional: Groq for faster inference

[API_ENDPOINTS]
SEARXNG = "http://searxng:4000"   # Internal Docker network name
OLLAMA = "http://host.docker.internal:11434"

[CHAT_MODEL]
PROVIDER = "ollama"
NAME = "llama3:8b"

[EMBEDDING_MODEL]
PROVIDER = "local"
NAME = "xenova/all-MiniLM-L6-v2"  # Browser-compatible embedding

The host.docker.internal address lets the Docker container reach your host machine’s Ollama server. On Linux, you may need to use your host’s actual LAN IP instead.

Launch the full stack:

docker compose up -d

This starts two containers:

  • perplexica-app: The Next.js frontend and API server on port 3000
  • searxng: The SearXNG search engine on port 4000 (internal only)

Visit http://localhost:3000 to access the UI.

Configuring SearXNG

SearXNG is a metasearch engine that queries multiple search providers simultaneously while removing tracking parameters. Perplexica’s Docker Compose file includes a pre-configured SearXNG instance, so you do not need to set it up separately.

The SearXNG config lives at searxng/settings.yml. By default it queries Google, Bing, and DuckDuckGo. You can adjust the engine list, add specific engines for news or academic sources, or add your own SearXNG instance if you already have one running:

[API_ENDPOINTS]
SEARXNG = "https://your-existing-searxng-instance.example.com"

If you use an external SearXNG instance, make sure it has the json output format enabled in its settings.

Using Ollama for Local LLM Inference

Perplexica supports a range of Ollama models. The quality of answers scales with model capability, but so does inference speed and memory requirements:

ModelVRAM/RAMQualitySpeed
llama3.2:3b4 GBAcceptableFast
llama3:8b8 GBGoodModerate
llama3.3:70b48 GBExcellentSlow
mistral:7b8 GBGoodModerate
qwen2.5:14b12 GBVery goodModerate

Switch models in the Perplexica UI settings panel without restarting Docker — the model change takes effect on the next query.

Using Groq for Faster Cloud Inference

If local inference is too slow but you still want web search privacy, Groq provides a good middle ground — the search queries still go through your SearXNG instance, and only the LLM inference step uses the Groq API:

[API_KEYS]
GROQ = "gsk_your-groq-key"

[CHAT_MODEL]
PROVIDER = "groq"
NAME = "llama-3.3-70b-versatile"

Focus Modes

Perplexica’s focus modes restrict the search scope to specific source types. In the UI, click the compass icon next to the search bar to select:

Focus ModeWhat It Searches
AllGeneral web search
AcademicArXiv, PubMed, and academic sources
WritingReturns drafts and writing assistance without web search
YouTubeYouTube video metadata and transcripts
Wolfram AlphaMathematical and factual computation
RedditReddit discussions and community opinions

Academic mode is particularly valuable. When researching technical topics, it surfaces actual papers from ArXiv with proper citations, which is significantly more useful than a general web search returning blog posts about the same topic.

Reddit mode is underrated for product research — it surfaces real user opinions and troubleshooting threads rather than SEO-optimized marketing content.

Perplexica vs Perplexity.ai

FeaturePerplexicaPerplexity.ai
PrivacyFully local optionQueries logged to Perplexity
CostFree (self-hosted)Free tier / $20/month Pro
Model quality (best)Llama 3.3 70BClaude 3.5 Sonnet / GPT-4o
Answer qualityGood to very goodExcellent
Citation qualityGoodExcellent
Focus modes6 modes5 modes
Image searchNot currentlyYes
Mobile appNoYes
Follow-up questionsYesYes
Setup requiredDocker + configNone

Perplexity.ai still wins on raw answer quality because it has access to the most capable closed models. For research-grade questions where you need the best possible synthesis, the cloud service has an edge. But Perplexica on a capable local model is genuinely close, and the privacy advantage is absolute — your queries never leave your machine.

Performance Tuning Tips

  • CPU-only mode: If you have no GPU, llama3.2:3b is usable but slow (20–40 seconds per query). Add more RAM before adding a bigger model.
  • Embedding speed: The default xenova/all-MiniLM-L6-v2 runs in-browser and can be slow on first use. Switch to Ollama’s nomic-embed-text for faster server-side embeddings.
  • SearXNG caching: Enable SearXNG’s Redis cache in settings.yml to speed up repeat queries on the same topic.
  • Result count: Reduce MAX_SEARCH_RESULTS in config.toml if queries are slow — fewer pages to scrape means faster response.

Perplexica is the best self-hosted AI search option available right now. If you are comfortable with Docker and want web-augmented AI answers without giving your search history to any company, it is an hour of setup well spent.

#self-hosted #SearXNG #Ollama #AI search #Perplexica