Case index
Case File 002Personal ProjectStatus: Closed2024

QFix Resume Tailor — Single-Page LLM Resume Compiler

A multi-stage LLM layout compiler that guarantees strict single-page PDF resume outputs.

Layout guarantee
Strict 1-Page

Enforced via pdf-parse page counting and scaling.

Memory footprint
< 2GB

Optimized serverless Puppeteer using @sparticuz/chromium.

Parsing engine
LaTeX to HTML

Direct regex parser for resume.cls structures.

Opening brief

LLM-generated resumes frequently spill onto multi-page PDF outputs, breaking strict single-page hiring constraints.

Outcome on record

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.

Exhibit A

Project description

Filed statement

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.

Exhibit B

Why I built this

Filed statement

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.

Exhibit C

Process and execution

Approach

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.
Responsibilities

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.
Exhibit D

Notable decisions

Decision

Strict layout constraint compiler

Enforced 1-page limits using dynamic CSS scaling and LLM shortening triggers when pdf-parse detects > 1 page.

Decision

LaTeX-to-HTML regex parser

Converted LaTeX resume.cls structures into semantic HTML directly, eliminating the overhead of full LaTeX compilers.

Decision

Serverless Chromium optimization

Tuned headless browser launch flags to operate under strict Vercel 2GB memory limits without process crashing.

Exhibit E

What I learned from this

Filed statement

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.