Disclaimer: This repository was originally built for my own education and experimentation with local LLM stacks and Docker. It is not an official Ollama or Perplexica product, and it may contain custom modifications and configurations that differ from the original projects. Use at your own risk, but feel free to submit issues if you run into problems. Make sure you provide sufficient detail as to the nature of the setup and the issue(s) you're running into.
This repository provides a local LLM stack with:
- Ollama as the model runtime.
- Perplexica as the web UI and retrieval system.
It supports four setup categories:
- macOS Intel: Intel-based Macs (CPU-only for LLMs; AMD GPUs are not used by Ollama).
- macOS Apple Silicon: M-series Macs with Apple GPU/Neural Engine acceleration.
- Windows: Windows PCs with NVIDIA GPU acceleration (AMD support is more limited).
- Linux: Linux PCs with either integrated Intel GPUs (CPU-only) or dedicated GPUs (NVIDIA best supported; AMD/Intel Arc support varies).
Pick the setup category that matches the machine you are running on.
Note: The Discover/news widgets and the post-response media sidebar (images/videos) are disabled in this fork.
- Docker Desktop installed and running.
- Git installed.
- No local Node or build tools required. Everything runs via Docker.
Perplexica is included as a git submodule, so you need to initialize it before running any Docker or setup commands.
git clone --recurse-submodules https://github.com/devinsilvia/local-llm-lab
cd local-llm-labIf you already cloned without submodules, run:
git submodule update --init --recursive- macOS Sequoia 15.x on Intel.
- Ollama option A (preferred): install Ollama natively from the official macOS installer:
- Download the macOS Intel installer from
https://ollama.com/downloadand run it. - Move the Ollama app to
/Applicationswhen prompted. - Launch Ollama once to complete setup.
- Start it manually before Docker:
- Run once:
ollama run llama3to download and warm up a small model. - If using option A with the macOS Intel compose file: comment out the
ollamaservice and itsdepends_onentry indocker/compose.macos-intel.yaml, and ensureBASE_URL = "http://host.docker.internal:11434"inconfig/config.macos-intel.toml.
- Download the macOS Intel installer from
- Ollama option B: use the
ollamaDocker service defined indocker/compose.macos-intel.yaml(note: running that compose file as-is uses this option). - See the quick decision table below for the exact URL and command differences between option A and option B.
| Intel mode | docker/compose.macos-intel.yaml |
config/config.macos-intel.toml BASE_URL |
Perplexica provider URL in UI | Model commands |
|---|---|---|---|---|
| Native Ollama on host | Comment out ollama service and depends_on |
http://host.docker.internal:11434 |
http://host.docker.internal:11434 |
ollama list, ollama pull <model> |
| Dockerized Ollama (compose default) | Keep ollama service enabled |
http://ollama:11434 |
http://ollama:11434 |
docker compose -f docker/compose.macos-intel.yaml exec ollama ollama list and ... ollama pull <model> |
- Apple Silicon Mac (M1/M2/M3/M4 series), macOS Sequoia 15.x.
- Install Ollama natively from the Apple Silicon installer and start it before Docker:
- Download the macOS Apple Silicon installer from
https://ollama.com/downloadand run it. - Move the Ollama app to
/Applicationswhen prompted. - Launch Ollama once to complete setup.
- Run once:
ollama run llama3to download a small model.
- Download the macOS Apple Silicon installer from
- For best performance, Ollama must run natively, not in Docker, so it can use Apple GPU/Neural Engine acceleration.
- Start the service with
ollama serve(or simply run a model, which starts the service automatically). - Verify it is reachable at
http://localhost:11434.
- Start the service with
- Windows 11 (or Windows 10 22H2) with WSL 2 enabled.
- Install Docker Desktop for Windows and enable WSL 2 integration.
- Install Ollama for Windows and start it before Docker.
- Use
http://host.docker.internal:11434as the Ollama API URL in Perplexica. - NVIDIA GPUs are best supported; AMD support is more limited in Ollama on Windows.
- The Windows profile uses
docker/compose.windows.yaml(no Ollama container).
- CPU: modern 6- to 12-core (Intel 12th gen+ or AMD Ryzen 5000+).
- RAM: 32 GB recommended (16 GB minimum for smaller models).
- GPU: NVIDIA RTX 3060 (12 GB) or better for smooth 8-14B inference; AMD GPUs are currently less supported in Ollama on Windows.
- Storage: 200+ GB free SSD for models and data.
- Docker Engine or Docker Desktop installed and running.
- Install Ollama for Linux and start it before Docker.
- Use
http://host.docker.internal:11434as the Ollama API URL in Perplexica. - Integrated Intel GPUs are not well supported; treat as CPU-only.
- NVIDIA GPUs are best supported (CUDA). AMD/Intel Arc support varies by driver/ROCm.
- macOS Intel: use 4-8B models with quantization (e.g., 4-bit), such as Llama 3 8B or Mistral 7B variants; larger models are likely slow.
- macOS Apple Silicon: 8-14B models with appropriate quantization are feasible; unified memory allows bigger models, but speed and context size still matter.
- Windows: target 8-14B 4-bit models if you have a midrange NVIDIA GPU; drop to 4-8B on CPU-only or AMD.
- Linux (integrated Intel GPU): treat as CPU-only and use 4-8B quantized models.
- Linux (dedicated GPU): NVIDIA is best supported (CUDA) and can handle 8-14B 4-bit models; AMD/Intel Arc support varies—use smaller models if needed.
- Clone the repo and
cdinto it. - Choose your Ollama mode:
- Option A (native Ollama): start Ollama (
ollama serveimplicitly when you run a model) and keepBASE_URL = "http://host.docker.internal:11434"inconfig/config.macos-intel.toml. Also comment out theollamaservice and itsdepends_onentry indocker/compose.macos-intel.yaml. - Option B (Dockerized Ollama, compose default): keep the
ollamaservice indocker/compose.macos-intel.yamland useBASE_URL = "http://ollama:11434"inconfig/config.macos-intel.toml.
- Option A (native Ollama): start Ollama (
- Confirm the endpoint Perplexica should use:
- Native Ollama:
http://host.docker.internal:11434 - Dockerized Ollama:
http://ollama:11434
- Native Ollama:
- Start the stack (builds images if needed):
./scripts/run-macos-intel.sh- Or directly:
docker compose -f docker/compose.macos-intel.yaml up -d --build
- Open Perplexica at
http://localhost:3000. - Use the Perplexica UI upload feature (paperclip) to add documents for indexing.
- Install and start native Ollama.
- Run
ollama run llama3once to ensure the model is present. - Start the stack (builds images if needed):
./scripts/run-macos-apple-silicon.sh- Or directly:
docker compose -f docker/compose.macos-apple-silicon.yaml up -d --build
- Perplexica will call Ollama at
http://host.docker.internal:11434. - Open Perplexica at
http://localhost:3000. - Use the Perplexica UI upload feature (paperclip) to add documents for indexing.
- Install and start Ollama for Windows.
- Run
ollama run llama3once to ensure the model is present. - Start the stack (PowerShell, builds images if needed, uses
docker/compose.windows.yaml):./scripts/run-windows.ps1- Or directly:
docker compose -f docker/compose.windows.yaml up -d --build
- Perplexica will call Ollama at
http://host.docker.internal:11434. - Open Perplexica at
http://localhost:3000. - Use the Perplexica UI upload feature (paperclip) to add documents for indexing.
- Install and start Ollama for Linux.
- Run
ollama run llama3once to ensure the model is present. - Start the stack (builds images if needed):
./scripts/run-linux.sh- Or directly:
docker compose -f docker/compose.linux.yaml up -d --build
- Perplexica will call Ollama at
http://host.docker.internal:11434. - Open Perplexica at
http://localhost:3000. - Use the Perplexica UI upload feature (paperclip) to add documents for indexing.
Follow the same steps as above. NVIDIA GPUs are best supported (CUDA). AMD/Intel Arc support varies by driver/ROCm—if performance is poor, drop to smaller 4–8B models.
The first run usually takes you through a setup flow inside the web UI at http://localhost:3000.
Menu names can vary slightly by version, but the flow is typically:
- Open the UI and go to Settings or Connections.
- Add a provider/connection for Ollama.
- API URL depends on your Ollama mode:
http://ollama:11434when using the Dockerized Ollama service indocker/compose.macos-intel.yamlhttp://host.docker.internal:11434when using native Ollama on the host- API key: leave blank or use any placeholder if required by the form.
- Add a chat model and an embedding model.
- Provider:
Ollama - Model key: use the exact Ollama tag shown by
ollama list(this is the model name). - Example chat model key:
llama3.1:8b-instruct-q4_0 - Example embedding model key:
nomic-embed-textornomic-embed-text:latest
- Provider:
- Save the settings and return to the main chat UI.
Note: Perplexica uses tool calling during search. If your chat model does not support tools in Ollama, requests can hang or fail. Use a tool-capable model (for example llama3.1:8b-instruct-q4_0) to avoid web-search failures.
Perplexica v1.12.1 stores provider and model settings in its internal database under /home/perplexica/data, not in the config/*.toml files.
Note: Model selections are stored in browser localStorage. Clearing browser data resets these selections, so double-check your settings before running queries to ensure the intended Ollama chat and embedding models are selected. If your model provider is temporarily unavailable (for example, Ollama not running), Perplexica keeps your saved selection rather than overwriting it. In private/incognito windows, no selection is persisted, so the first available models are used until you choose your own.
If you do not see the setup flow, look for a Settings or Admin icon in the left sidebar or top navigation.
Use the command that matches where Ollama is running:
# Native Ollama on host
ollama listIf a model is missing, pull it once:
# Native Ollama on host
ollama pull llama3
ollama pull nomic-embed-text# Dockerized Ollama service (macOS Intel compose default)
docker compose -f docker/compose.macos-intel.yaml exec ollama ollama list
docker compose -f docker/compose.macos-intel.yaml exec ollama ollama pull llama3
docker compose -f docker/compose.macos-intel.yaml exec ollama ollama pull nomic-embed-textThen return to Perplexica and select the same model key.
Use these commands from the repo root.
docker compose -f docker/compose.macos-apple-silicon.yaml down
docker compose -f docker/compose.macos-apple-silicon.yaml up -d --builddocker compose -f docker/compose.macos-intel.yaml down
docker compose -f docker/compose.macos-intel.yaml up -d --build# Uses docker/compose.windows.yaml (no Ollama container).
docker compose -f docker/compose.windows.yaml down
docker compose -f docker/compose.windows.yaml up -d --builddocker compose -f docker/compose.linux.yaml down
docker compose -f docker/compose.linux.yaml up -d --buildPerplexica stores chat history and uploads in the named volume mounted at /home/perplexica/data.
You can either reset that volume or run a separate clean instance alongside the original.
This removes the named volumes, which clears chat history and uploads:
# Use the appropriate command for your profile:
docker compose -f docker/compose.macos-apple-silicon.yaml down -vCreate a new Compose file that uses a different named volume and a different port so it can run in parallel. For example, copy the compose file and change the port and volume name:
cp docker/compose.macos-apple-silicon.yaml docker/compose.macos-apple-silicon.fresh.yamlThen edit the copy to use a new volume and port:
services:
perplexica:
ports:
- "3001:3000"
volumes:
- perplexica_data_fresh:/home/perplexica/data
volumes:
perplexica_data_fresh:Start the clean instance with:
docker compose -f docker/compose.macos-apple-silicon.fresh.yaml up -d- Perplexica fails to reach Ollama: check that:
- Ollama is running,
- The Ollama API URL in the UI matches the profile (
http://ollama:11434vshttp://host.docker.internal:11434), - Ports are correctly mapped in the compose file.
- Chat hangs in "Brainstorming": the selected model likely does not support tool calling.
- Switch to a tool-capable model (for example
llama3.1:8b-instruct-q4_0).
- Switch to a tool-capable model (for example
- Performance issues:
- macOS Intel: try smaller models or lower concurrency.
- macOS Apple Silicon: verify Ollama is using GPU (native, not Docker) and avoid other heavy GPU tasks.
- Windows: ensure GPU drivers are current and reduce model size if you see timeouts.
- Linux: NVIDIA is best supported; AMD/Intel Arc may require smaller models and lower concurrency.
- iOS input zoom: forcing inputs below 16px can trigger Safari zoom on focus; if that happens, revert the font size override in
perplexica/src/app/globals.css. - Docker build snapshot error: if you see
failed to prepare extraction snapshotduringdocker compose ... --build, clear build cache withdocker builder prune(ordocker builder prune -aif needed). Running this occasionally can also free disk space.
- The Perplexica source lives in the
perplexica/git submodule. - The Docker builds use the checked-out tag in that submodule.
- To update to a new release tag, edit
PERPLEXICA_TAGinscripts/update-perplexica.shand run it. - Keep the
image: perplexica-local:<tag>value indocker/compose.*.yamlaligned withPERPLEXICA_TAG. - See
PERPLEXICA_UPDATE_WORKFLOW.mdfor a recommended workflow to pull upstream changes while keeping local modifications.
File uploads are stored under /home/perplexica/data/uploads inside the container.
The compose files mount a named volume to /home/perplexica/data so uploaded files persist and are visible to the chat.
This repository is licensed under the MIT License. See LICENSE.