Install on Linux
This page installs Scholar Lens on a Linux PC with an NVIDIA GPU, as on the reference machine. It is for whoever sets up the server. Allow about an hour, most of it for model downloads.
The reference machine is Ubuntu with an RTX 5090 (32 GB). The full model set needs about 30 GB of GPU memory. For a smaller GPU, see Local models.
Quick install with Docker
If you only want to run Scholar Lens, not develop it, one command does the whole Docker install. Start LM Studio's server with the models loaded first (step 2), then, from the repository folder:
bash
./install.shThe installer:
- Checks that Docker and Compose 2.24 or newer are running.
- Writes
.envwith new secrets and anadminaccount with a random password. It keeps an existing.env. - Downloads the reranker model into
models/(about 0.6 GB).--no-rerankerskips it. - Turns on SearXNG and the reranker, and the code sandbox when gVisor (
runsc) is registered with Docker. - Sets up podcast voices (
--tts=kokoro|chatterbox|none, Kokoro by default) and, only with--video, the podcast video service (about a 2.7 GB image). Both choices are kept in.env. - Builds the images, starts the stack and waits until every service is healthy.
Then open http://localhost:5000 and sign in as admin with the ADMIN_PASSWORD from .env. Change it on the Account page. Run ./install.sh again after git pull to update; ./install.sh --stop stops the stack and keeps your data.
The rest of this page is the step-by-step install, for development or a custom setup.
What you need
- Docker Engine with Compose v2.24 or newer.
- LM Studio with its
lmscommand. - For development on the host: Python 3.13 (the project uses a conda environment called
learning) and Node 24. - For code cells: gVisor.
- Optional, for the reranker on the GPU: the NVIDIA Container Toolkit.
1. Get the code
bash
git clone <repository-url> ScholarLensbash
cd ScholarLens2. Start the models
Download qwen/qwen3.6-35b-a3b and text-embedding-qwen3-embedding-4b in LM Studio. Then start the server and load both:
bash
lms server startbash
lms load qwen/qwen3.6-35b-a3b --parallel 2 --context-length 65536 -ybash
lms load text-embedding-qwen3-embedding-4b -yIf the API will run in Docker, turn on Serve on Local Network in LM Studio so containers can reach it. Local models explains these choices.
3. Write the .env file
bash
cp .env.example .envFill in at least:
JWT_SECRET: the output ofopenssl rand -hex 32.POSTGRES_PASSWORD: a password for the database.LLM_MODEL=qwen/qwen3.6-35b-a3b.
Every other setting has a working default. See the configuration reference.
4. Choose how to run it
Option A: everything in Docker
bash
docker compose -f scholarlens-stack.yml up -d --build --waitThis starts the database, the API, the worker and the UI. Go to step 5.
Option B: the API and UI on the host (development)
Start only the database:
bash
docker compose -f scholarlens-stack.yml up -d postgresCopy .env.example to backend/.env too, and set DATABASE_URL with your password, for example postgresql+psycopg://scholarlens:<password>@127.0.0.1:5002/scholarlens.
Install and start the backend from the backend folder:
bash
pip install -e ".[dev]"bash
uvicorn app.main:app --port 5020The API runs the database migrations when it starts, and runs the job worker inside itself.
Install and start the UI from the frontend folder:
bash
npm cibash
npm run dev5. Create the admin account
Open http://localhost:5021. The setup screen asks for the first account, which is the admin. Then follow Getting started to upload a reading and ask a question.
6. Add the optional services
Each one is a single command and one setting. See Stack services for the list. The most useful is the reranker, which improves retrieval and enables the coverage checks.
Install gVisor for code cells
The code sandbox runs under gVisor's runsc runtime.
Add the gVisor package source:
bashcurl -fsSL https://gvisor.dev/archive.key | sudo gpg --dearmor -o /usr/share/keyrings/gvisor-archive-keyring.gpgbashecho "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gvisor-archive-keyring.gpg] https://storage.googleapis.com/gvisor/releases release main" | sudo tee /etc/apt/sources.list.d/gvisor.listInstall it and register it with Docker:
bashsudo apt-get update && sudo apt-get install -y runscbashsudo runsc installbashsudo systemctl restart dockerCheck it. The kernel version should end in
gvisor:bashdocker run --rm --runtime=runsc python:3.13-slim-trixie uname -rStart the sandbox with a token:
bashecho "SANDBOX_TOKEN=$(openssl rand -hex 24)" >> .envbashdocker compose -f scholarlens-stack.yml --profile sandbox up -d --build sandboxGive the API the same token and the address:
SANDBOX_TOKENandSANDBOX_URL=http://172.31.250.10:5009inbackend/.env(orhttp://sandbox:5009when the API runs in the stack).
Test the sandbox in Settings checks the connection.
After a reboot
LM Studio and the API don't start by themselves. Run the three lms commands from step 2, then start the stack services you use. Docker restarts the containers that were running.
Upgrade
Pull the new code, then rebuild what changed:
bash
git pullbash
docker compose -f scholarlens-stack.yml up -d --build --waitOn a host install, run pip install -e ".[dev]" in backend and npm ci in frontend, then restart the API. The API applies new migrations when it starts. See Backups and upgrades.