Skip to content

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.sh

The installer:

  1. Checks that Docker and Compose 2.24 or newer are running.
  2. Writes .env with new secrets and an admin account with a random password. It keeps an existing .env.
  3. Downloads the reranker model into models/ (about 0.6 GB). --no-reranker skips it.
  4. Turns on SearXNG and the reranker, and the code sandbox when gVisor (runsc) is registered with Docker.
  5. 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.
  6. 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 lms command.
  • 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> ScholarLens
bash
cd ScholarLens

2. 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 start
bash
lms load qwen/qwen3.6-35b-a3b --parallel 2 --context-length 65536 -y
bash
lms load text-embedding-qwen3-embedding-4b -y

If 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 .env

Fill in at least:

  • JWT_SECRET: the output of openssl 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 --wait

This 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 postgres

Copy .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 5020

The 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 ci
bash
npm run dev

5. 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.

  1. Add the gVisor package source:

    bash
    curl -fsSL https://gvisor.dev/archive.key | sudo gpg --dearmor -o /usr/share/keyrings/gvisor-archive-keyring.gpg
    bash
    echo "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.list
  2. Install it and register it with Docker:

    bash
    sudo apt-get update && sudo apt-get install -y runsc
    bash
    sudo runsc install
    bash
    sudo systemctl restart docker
  3. Check it. The kernel version should end in gvisor:

    bash
    docker run --rm --runtime=runsc python:3.13-slim-trixie uname -r
  4. Start the sandbox with a token:

    bash
    echo "SANDBOX_TOKEN=$(openssl rand -hex 24)" >> .env
    bash
    docker compose -f scholarlens-stack.yml --profile sandbox up -d --build sandbox
  5. Give the API the same token and the address: SANDBOX_TOKEN and SANDBOX_URL=http://172.31.250.10:5009 in backend/.env (or http://sandbox:5009 when 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 pull
bash
docker compose -f scholarlens-stack.yml up -d --build --wait

On 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.