Document Intelligence MVP
Provider-agnostic semantic document analysis with structured export
Overview
Most document AI tools lock you into a single provider. If that provider's model regresses, raises prices, or goes down, your pipeline breaks. Document Intelligence MVP was built with a different philosophy: the LLMLLMLarge language model, the kind of model behind ChatGPT and Claude. is a plug-in, not the foundation. Swap providers without changing your workflow.
The tool lets users upload PDFs and extract structured insights — summaries, key entities, structured Q&A, clause extraction — using whichever model fits their needs: cloud-hosted frontier models for accuracy, local Ollama models for privacy-sensitive documents, or cheaper providers for high-volume batch work.
Problem Statement
Teams working with large volumes of documents — contracts, research papers, reports, proposals — spend enormous time manually reading and extracting key information. Existing tools either require a specific LLM provider or produce unstructured outputs that need further processing before they're useful.
My Role
Solo project. Full-stack design and implementation — system architecture, FastAPI backend, React frontend, provider abstraction layer, prompt engineering per provider, and DOCX export pipeline.
Key Features
- Multi-Model Support: Supports Anthropic Claude, OpenAI GPT-4, Google Gemini, Groq, and local Ollama models from a single interface
- Semantic Extraction: Executive summary, key entity extraction, structured Q&A, full document outline
- Hot-Swappable Providers: Provider selector — switch models mid-session without re-uploading documents
- Automated Generation: Exports results as cleanly formatted DOCX files with section headers, entity tables, and summary blocks
- Real-Time Data: Streaming responses for large documents so users see output as it's generated, not after a long wait
- Unified Abstraction Layer: FastAPI backend normalising different provider APIs into a single interface
- Frontend Dashboard: Clean React frontend with drag-and-drop upload, provider config panel, and results viewer
Technical Architecture
- Frontend: React, component-based UI with real-time streaming output display
- Backend: Python, FastAPI with async request handling
- Provider abstraction: unified LLMClient interface with adapters per provider handling auth, request format, streaming, and error normalisation
- File processing: PDF parsing pipeline extracting text per page with metadata preservation
- Export: DOCX generation from structured extraction results using python-docx
- Local model support: Ollama integration for fully offline, privacy-safe document processing
Challenges and Learnings
Abstracting over five providers sounds simple until you deal with their differences in streaming protocols, token limits, rate limiting behaviour, error formats, and response schemas. Building a single interface that handled all of these without leaking provider-specific logic into the application layer required a clean adapter pattern and careful error handling at each boundary.
Streaming across providers was the most technically involved part — each provider has a slightly different SSE or chunked response format, and normalising these into a consistent frontend stream required provider-specific parsing logic behind a unified async generator interface.
Outcome
A working, production-quality multi-provider document intelligence tool demonstrating provider-agnostic LLM architecture. Directly applicable to enterprise document workflows in legal, finance, research, and operations contexts. The abstraction pattern developed here influenced how I think about LLM integration in all subsequent projects.