Turn text-based business documents into a readable summary or structured, reviewable data. Choose a profile, inspect the extracted fields, make corrections, and export the result.
The app always offers an offline demo. It automatically enables OpenRouter, DeepSeek, and OpenAI when their corresponding keys are configured; you can switch provider for every document.
Requirements: Docker Desktop (or Docker Engine with Compose).
git clone <repository-url>
cd document-summary
docker compose up --buildOpen the app at http://localhost:8501.
Use Provider to choose Demo (offline), OpenRouter, DeepSeek, or OpenAI (GPT). Each live provider appears only when its own key is configured. The AI model menu then shows models belonging to that provider. Requests and billing go directly to the selected provider.
- Choose Extract structured information.
- Select Contract, Resume / CV, Receipt, or another profile.
- Leave Try a bundled sample selected.
- Click Analyze document.
- Review the summary, extracted fields, warnings, and source evidence.
- Correct the fields and click Save corrections and mark reviewed.
- Download JSON or CSV.
- Expand local history to reopen the reviewed result.
Choose Summarize a document when you only need a summary and key points. All bundled samples are fictional. Results are decision support and require human review.
- Supports General Document, Contract, Resume / CV, Invoice, Receipt, Meeting Notes, and Purchase Order profiles.
- Returns a universal summary plus fields relevant to the selected profile.
- Keeps the AI result separate from human corrections.
- Stores local history and provides JSON/CSV exports.
- Summary and most profiles: text-based PDF, DOCX, TXT, HTML, and CSV.
- Invoice Extraction: text-based PDF, DOCX, HTML, and TXT.
- Scanned/image-only PDFs are not supported because OCR is not included.
- Upload size and processing limits are configurable.
Demo extraction is deterministic and label-based. Optional OpenRouter mode is better suited to varied wording and real-world layouts, but its output still needs review against the source.
Raw source files are not retained after processing. SQLite keeps safe metadata, the job state, the extracted result, and (when used) a separate human-reviewed result. Local history is intended for a single-user demo.
Requirements: Python 3.11+, uv, and system
libmagic.
uv sync --group dev --locked
cp .env.example .envStart the API in one terminal:
uv run --no-sync uvicorn backend.main:app --reloadIn a second terminal, start the UI:
uv run --no-sync streamlit run frontend/app.pyOpen http://localhost:8501. Demo mode is deterministic and does not need an API key.
Put the key only in your local .env file:
SUMMARY_MODE=auto
OPENROUTER_API_KEY=replace_with_your_key
OPENROUTER_MODEL=openai/gpt-oss-20b:free
DEEPSEEK_API_KEY=replace_with_your_key
DEEPSEEK_MODEL=deepseek-v4-flash
OPENAI_API_KEY=replace_with_your_key
OPENAI_MODEL=gpt-4o-miniCheck the current catalog with:
uv run --no-sync python scripts/check_openrouter_model.pyModel availability, pricing, and quotas may change. Automated tests never contact external AI providers.
- UI: http://localhost:8501
- API health: http://localhost:8000/health
- Interactive API docs: http://localhost:8000/docs
The API also exposes workflow discovery, job status, provenance, review, history, and JSON/CSV export endpoints.
All automated tests are offline.
uv run --no-sync python -m compileall -q backend frontend tests
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync pytest -q
uv run --no-sync python scripts/generate_samples.py --check
uv run --no-sync python scripts/check_public_artifacts.py
uv run --no-sync python scripts/check_secrets.pyThe same checks run in GitHub Actions, including privacy and credential scans.
Raw source bytes are not retained after processing, and routine logs exclude document text and API keys. Filenames and DOCX archives are validated before processing.
Profiles, extraction fields, validation rules, exports, branding, and deployment can be adapted for a client project.
- OCR is not included.
- Background work is in-process and intended for a local/demo service.
- SQLite is intended for a single local/demo service.
- PDF export may be limited for some non-Latin text; Markdown and DOCX preserve Unicode better.
- Profile selection is manual; automatic classification is not included.
- Layout-aware table geometry and user-created schemas are not included.
- Extraction is decision support, not accounting or legal certification.
- Authentication, billing, compliance controls, and public hosting are outside this portfolio demo.