Installation¶
This page sets Pagelore up with uv on your machine, with Postgres and Qdrant in Docker. To run everything in Docker, see Run with Docker.
1. Clone the repository¶
2. Create the env files¶
Copy the examples, then edit them. Every option is documented inside its file.
cp src/.env.example src/.env # the app (./run.sh)
cp docker/env/.env.example.postgres docker/env/.env.postgres # Postgres and pgAdmin
cp docker/env/.env.example.app docker/env/.env.app # the app in Docker (./run.sh docker)
| File | Set at least |
|---|---|
src/.env |
EMBEDDING_PROVIDER / EMBEDDING_MODEL (and EMBEDDING_URL or EMBEDDING_API_KEY if your provider needs one), VECTOR_DB_BACKEND / VECTOR_DB_URL, and POSTGRES_* |
docker/env/.env.postgres |
POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, and the pgAdmin login |
docker/env/.env.app |
The same settings as src/.env, for the API container. Hosts are the service names: postgres, qdrant |
The Postgres credentials must match
POSTGRES_USERNAME, POSTGRES_PASSWORD and POSTGRES_MAIN_DATABASE in
src/.env and docker/env/.env.app are the POSTGRES_USER,
POSTGRES_PASSWORD and POSTGRES_DB of docker/env/.env.postgres.
Postgres takes its credentials only when it first creates its data volume, so set them before the first start.
In src/.env, POSTGRES_PORT is the host port: 5432, or
POSTGRES_HOST_PORT if you set it in docker/.env.
If you skip this step, run.sh copies any missing file from its example and
runs with the example values.
3. Run it¶
# Install, start Postgres and Qdrant, create the tables and run the API
./run.sh --extras sentence-transformers
--extras takes the extras for your
embedding provider and vector DB, comma separated (for example
--extras ollama,ocr), and installs only those. After the first run,
./run.sh alone starts everything again.
| Command | What it does |
|---|---|
./run.sh |
Postgres + Qdrant in Docker, migrations, then the API with uv (auto reload) |
./run.sh docker |
Everything in Docker (see Run with Docker) |
./run.sh stop |
Stop the Docker services; their data is kept |
./run.sh --help |
All options |
Options in local mode:
| Option | |
|---|---|
--extras a,b |
Install these extras first (uv sync) |
--no-db |
Don't start Postgres or Qdrant (they already run elsewhere) |
--no-migrate |
Skip alembic upgrade head |
--no-reload |
Don't restart the API when the code changes |
--host HOST |
Default 127.0.0.1 |
--port PORT |
Default 8000 |
The interactive API docs (Swagger UI) are at http://localhost:8000/docs.
Or step by step¶
run.sh does these steps for you:
# 1. Install, with the extras for your embedding provider / vector DB
uv sync --extra sentence-transformers
# 2. Configure: every option is documented in the file
cp src/.env.example src/.env
# 3. Start Postgres and Qdrant
cp docker/env/.env.example.postgres docker/env/.env.postgres
docker compose -f docker/docker-compose.yml up -d postgres qdrant
# 4. Create the tables
cd src/models/db_schemes/pagelore
cp alembic.ini.example alembic.ini
# in alembic.ini: sqlalchemy.url = postgresql+psycopg://admin:admin@localhost:5432/pagelore
uv run alembic upgrade head
cd ../../../..
# 5. Run the API
cd src && uv run uvicorn main:app --reload
Pagelore refuses to start until the tables exist. See Database migrations.
Choosing your stack¶
The defaults work out of the box: a local sentence-transformers model
(all-MiniLM-L6-v2) and Qdrant. To use something else, set the provider in
src/.env and install its extra:
See Embedding providers and Vector databases for every choice.
Check it works¶
curl localhost:8000/api/v1/ # app name and version
curl localhost:8000/api/v1/embeddings/model # the configured embedding model
Next: the quick start.