PDF Extractor Docs

Run and maintain

Operations and limits

Validation rules

  • The name must end with .pdf.
  • The MIME type must identify a PDF.
  • The file must not be empty.
  • The file must be within MAX_FILE_SIZE_MB.
  • The file must start with the %PDF header.

Security rules

  • Keep LLAMA_CLOUD_API_KEY in .env or a secret store.
  • Do not commit .env.
  • Do not expose external IDs through the public API.
  • Do not return raw provider errors to browser users.
  • Do not log the full PDF or extracted private data.

SQLite limit

SQLite is correct for one API instance and moderate local traffic. SQLite has one writer at a time. Use PostgreSQL before you scale to multiple application instances or frequent concurrent writes.

Required production changes

  1. Add authentication and job ownership checks.
  2. Add Alembic migrations before schema changes.
  3. Move from SQLite to PostgreSQL when traffic requires it.
  4. Add structured logs and error monitoring.
  5. Set data retention rules for results and source files.

When to add Celery

Add Celery only when the application runs its own long jobs. Examples include OCR, custom post-processing, batch operations, embeddings, or retry workflows. Do not add Celery only to wait for LlamaCloud.