QFix Resume Tailor — Single-Page LLM Resume Compiler
A multi-stage LLM layout compiler that guarantees strict single-page PDF resume outputs.
Enforced via pdf-parse page counting and scaling.
Optimized serverless Puppeteer using @sparticuz/chromium.
Direct regex parser for resume.cls structures.
LLM-generated resumes frequently spill onto multi-page PDF outputs, breaking strict single-page hiring constraints.
Achieved guaranteed single-page PDF output using pdf-parse page counting, custom regex LaTeX-to-HTML parser, and Vercel serverless Puppeteer pipeline under 2GB RAM limits.
Project description
QFix Resume Tailor addresses non-deterministic LLM output lengths by introducing a closed-loop layout compiler that counts generated PDF pages using pdf-parse.
If page count exceeds one, the system triggers aggressive LLM shortening and applies CSS scaling factors (0.92 ratio) until a single-page output is strictly met.
Features a custom regex LaTeX-to-HTML parser matching resume.cls structures and a serverless Puppeteer pipeline on Vercel under 2GB RAM limits.
Why I built this
Job applicants struggle when AI resume builders produce multi-page PDFs that violate 1-page recruitment guidelines.
Built to demonstrate how deterministic layout compilers and retry mechanisms can tame non-deterministic LLM outputs.
Process and execution
How the work moved
- Engineered a multi-stage layout compiler that counts generated PDF pages via pdf-parse and dynamically triggers aggressive LLM shortening or applies CSS scale factors (0.92 ratio) to strictly enforce single-page output.
- Built a regex-driven parsing layer in TypeScript to convert complex LaTeX templates (specifically matching the resume.cls structure) into compliant semantic HTML.
- Configured a headless browser PDF generation pipeline using puppeteer-core and @sparticuz/chromium optimized to execute reliably under Vercel serverless environment resource constraints (under 2GB memory limit).
- Integrated Gemini 2.5 Flash using LangChain, incorporating custom exponential backoff logic and retry mechanisms to handle LLM rate limiting (HTTP 429) during peak traffic.
What I owned
- Led the work as Lead Architect & Developer.
- Turned messy context into a clearer operating model, interaction direction, and rollout shape.
- Worked across stakeholders to move the project from framing into execution.
Notable decisions
Strict layout constraint compiler
Enforced 1-page limits using dynamic CSS scaling and LLM shortening triggers when pdf-parse detects > 1 page.
LaTeX-to-HTML regex parser
Converted LaTeX resume.cls structures into semantic HTML directly, eliminating the overhead of full LaTeX compilers.
Serverless Chromium optimization
Tuned headless browser launch flags to operate under strict Vercel 2GB memory limits without process crashing.
What I learned from this
Regex parsers can bypass full LaTeX compiler overhead when converting structured templates to semantic HTML.
Exponential backoff and rate-limit handling are essential for serverless LLM pipelines.