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
%PDFheader.
Security rules
- Keep
LLAMA_CLOUD_API_KEYin.envor 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
- Add authentication and job ownership checks.
- Add Alembic migrations before schema changes.
- Move from SQLite to PostgreSQL when traffic requires it.
- Add structured logs and error monitoring.
- 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.