Inspiration
💡 Inspiration
As a student, I was constantly overwhelmed by the sheer volume of reading. Preparing for exams, parsing academic papers, and reading textbook PDFs was consuming hours of my time. I just wanted a way to upload my documents, ask questions in natural language, and get accurate answers instantly. I built DocLean to solve my own reading bottleneck.
But as I built it, I realized this wasn't just a student problem. I watched friends in accounting auditing financial statements, startup founders analyzing competitor reports, and lawyers reviewing contracts. They all faced the exact same time drain: hours spent digging through pages just to find a single figure. They all needed a tool like DocLean.
However, when I began designing a prototype, I hit a massive wall: the cost of AI. Sending a 100-page PDF to a high-quality LLM on every single query consumes thousands of tokens. If I wanted to turn DocLean into a real business or even host a free tool for my peers, the API inference bills would bankrupt me. Traditional AI readers are financially unsustainable at scale because they waste money sending fluff, page numbers, and boilerplate text.
That is when I realized I had to solve two different problems:
- The User's Problem: Reading long documents (which I solved with the DocLean app experience).
- My Problem as a Builder: Keeping AI inference affordable so I can scale the service (which I solved using Paritok).
🛠️ How I Built It
I coordinated text extraction, prompt optimization, and decentralized inference into a single high-fidelity dashboard:
- The Application Layer (DocLean): The FastAPI backend parses uploaded files (PDFs or pasted text) using
pypdf, extracting clean text segments for an interactive React dashboard. - The Cognitive Prompt Shrinker (Paritok-4B): Instead of sending the raw text, DocLean routes the context and query to the hosted Paritok server. Paritok analyzes the query, strip-mines the document, and deletes all boilerplate, headers, and irrelevant text—keeping only the exact semantic chunks needed to answer the question.
- Decentralized Reasoning (0G Labs): The highly compressed prompt is sent to 0G Labs'
0GM-1.0-35B-A3B-SIAmodel via the decentralized compute network to generate the final, high-fidelity answer.
🚧 Challenges I Faced
As a solo developer, building robust fault tolerance was critical. Under heavy traffic, the hosted Paritok compression endpoint would occasionally take longer than 20 seconds to analyze massive documents, risking an application timeout.
My Solution: I engineered a custom backend timeout circuit breaker in Python. If the Paritok API times out, the backend catches the error and automatically falls back to forwarding the raw document directly to the 0G Compute model. This guarantees that the user always gets a successful response, even if the compression layer is temporarily degraded.
I also designed a custom substring-matching algorithm that tracks exactly which lines of text were deleted vs. preserved during compression, displaying a live dynamic visual diff inside the dashboard.
🧠 What I Learned & The Business Model
I learned that building a viable AI product is as much about infrastructure efficiency as it is about prompt engineering.
By leveraging Paritok to shrink input prompt sizes by up to 96%+, I can build a highly sustainable subscription business model around DocLean. Because I am not burning thousands of tokens on AI noise, my operating costs remain near zero. This allows me to offer a generous free tier to students and researchers, and an incredibly affordable premium tier to professionals like accountants and analysts—making AI document analysis economically viable for the first time.
🔮 What's Next for DocLean
Next, I plan to introduce semantic chunking so that documents exceeding 100 pages are automatically split, compressed independently, and then merged. This will allow DocLean to support unlimited document sizes for near-zero cost.
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for DocLean
Built With
- 0g-labs
- css3
- decentralized-compute
- fastapi
- javascript
- paritok
- pypdf
- python
- react
- rest-api
- uvicorn
- vite
Log in or sign up for Devpost to join the conversation.