=== pipeline.yaml
version: 1
path: ./index
categories:
  text:
    name: Text documents
    template: text
    parse:
      use: pdfium
      join_lines: true
    clean:
    - use: header_footer_strip
      min_page_ratio: 0.5
    - use: dedupe_blocks
    chunk:
      use: sentence_window
      sentences_per_chunk: 5
      overlap_sentences: 1
route:
- category: text
index:
  embed:
    use: qwen3-embedding-0.6b
  store:
    use: lancedb
    metric: cosine
    build_fts: true
retrieve:
  search:
    use: hybrid_rrf
    top_k: 20
    rrf_k: 60
    query_expansion: none
  rerank:
  - use: cross_encoder
    model: cross-encoder/ms-marco-MiniLM-L-6-v2
    top_k: 5
answer:
  use: search
  top_k: 5
models:
  download: never
  cache_dir: /models
source:
  use: files
  location: ./docs

# Access control is off. To turn it on, add a block like this, then fill in
# roles() in policy.py. A folder rule matches the document's path in the source.
# access:
#   default: []
#   folders:
#     - match: contracts/
#       roles: [legal]
=== pyproject.toml
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.13,<3.14"
dependencies = [
    "pandion[files,lancedb,local,pdfium,sql]~=<pin>",
    "pandion-api~=<api-pin>",
    "uvicorn>=0.30,<1",
]

[dependency-groups]
dev = ["pytest>=8"]

# An application, not a library: `uv sync` installs the dependencies and nothing else.
[tool.uv]
package = false
=== .env.example
# Names only. Put the values in .env (never commit it) or in your platform's secret store.

# A SQLAlchemy url for conversations. Empty keeps them in a SQLite file in index/.
DATABASE_URL=

# Optional, set in the environment and not here:
# USER_ID_HEADER=x-user-id   the header your gateway puts the user's id in
# MODELS_DIR=/models         where the models are
=== Dockerfile
FROM python:3.13-slim@sha256:ae14d4ce8771606477a81446e7ef429edd6762305fc50c84507c1041fa8285d1
COPY --from=ghcr.io/astral-sh/uv:0.12.17@sha256:10787c682e4184e4f290de1171fd4703dc63de99221f10fe1c99002ce7fa9acc /uv /usr/local/bin/uv

# The same HF_HOME at build and at run, so the models pulled below are the ones the server loads.
ENV UV_COMPILE_BYTECODE=1 \
    UV_LINK_MODE=copy \
    HF_HOME=/models/hf \
    PATH="/app/.venv/bin:$PATH"
WORKDIR /app

# uv.lock is yours: run `uv lock` once and commit it. The build fails without it.
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev

COPY pipeline.yaml serve.py policy.py ./
# Public weights only, no secret. At run time pipeline.yaml says download: never.
RUN pandion models pull pipeline.yaml

RUN useradd --create-home app && mkdir -p /app/index /models && chown -R app /app /models
USER app
EXPOSE 8000
CMD ["uvicorn", "serve:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
=== README.md (head)
# project

This folder is a Pandion server for your documents. It answers questions over HTTP from the pipeline in `pipeline.yaml`, and you build it into a container image.

