← lab
AutoDocxPdf
202512 req/min under a 15 RPM ceiling
The problem
Autonomous Docker-based documentation generator: feed it a Repomix context file, a Gemini key, and live app URLs → it produces professional DOCX/PDF with AI content, code/app screenshots, and Mermaid architecture diagrams.
The constraint
Gemini free tier = 15 requests/minute. A full doc run needs dozens of calls (plan, sections, screenshot targets, diagrams). v1.0 hit 429s constantly. The fix became the project's real engineering content.
What the git log says
- $ v1.2.2 — intelligent rate limiting: default delay 2s→5s (12 req/min, under the 15 RPM ceiling), per-request-type delays, per-minute counter, exponential backoff on 429s.
- $ v1.2.2 — section-count optimization (9–15 by project size), max 8 screenshots with priority selection, max 3 diagrams — reduce calls, don't just pace them.
- $ v1.2.4 — Docker: container restart loops fixed (restart policy 'no'); ChromeDriver/Chromium mismatch solved using the system ChromeDriver from apt.
- $ v1.2.5 — TOC, hyperlinks, contributor metadata; docs rewrite that corrected its own claims (Flash-Lite not Pro; Selenium for screenshots, Puppeteer only inside mermaid-cli).
What I learnt
Rate limits are an architecture input, not an ops nuisance — the cheapest request is the one you never make. Multi-agent isn't glamour: it's mostly contracts between agents and retry semantics. And honest docs are a feature.
PythonGemini APISeleniumPuppeteerDocker