=== pipeline.yaml
version: 1
path: ./index
categories:
  manuals:
    name: Manuals and guides
    template: manuals
    parse:
      use: docling
      heading_hierarchy: true
      do_table_structure: true
      table_mode: fast
      do_ocr: false
      content_layers:
      - body
    clean:
    - use: dedupe_blocks
    chunk:
      use: layout_blocks
      section_level: 4
      max_tokens: 512
      keep_tables_whole: true
      heading_context: true
route:
- category: manuals
index:
  embed:
    use: qwen3-embedding-0.6b
  store:
    use: lancedb
    metric: cosine
    build_fts: true
retrieve:
  search:
    use: hybrid_rrf
    top_k: 30
    rrf_k: 60
    query_expansion: none
  rerank:
  - use: cross_encoder
    model: BAAI/bge-reranker-v2-m3
    top_k: 5
answer:
  use: chat
  model: claude-sonnet-5
  max_chunks: 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[anthropic,docling,files,lancedb,local,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.

# The key for anthropic models.
ANTHROPIC_API_KEY=

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

