AGWORKF · 02
AHMEDABADIST
VOL. 032025
SCROLL
HOME / WORK / PDF → Form in 20sMulti-model LLM orchestration · 2025
— CASE 02 / MULTI-MODEL LLM · VIVANSH INFOTECH

PDF → FORM
IN 20s.

Three LLMs in a single user flow — each chosen empirically for what it’s best at, glued together by a Pydantic-validated intermediate schema.

1h → 20sPer form · PDF → digital
200+Forms · month one
3LLMs · empirical pick
~7KTokens per form

— THE DESIGN MOVE

BUILD AN
INTERMEDIATE
JSON THAT
LLMs CAN WRITE
RELIABLY.

The platform’s native form schema was too deeply nested for any single LLM to emit in one pass — wrapper objects, type-specific aliases, radio-driven conditional containers nested arbitrarily.

The fix was a simplified intermediate JSON schema, validated by Pydantic, plus a deterministic conversion layer to the native form. That decoupled LLM understanding from structural correctness.

  • PDF converter. GPT-4o reads PDF → intermediate JSON → Pydantic → native. ~20s, ~7K tokens. Bulk: 100 PDFs in 5-10 min.
  • Conversational builder. GPT-4o suggests title/type; Qwen3-Coder writes blueprint; user iterates; GPT-4o-mini converts.
  • Model rationale. Each picked from head-to-head testing — not vibes.
PYTHONFASTAPIGPT-4oGPT-4o-MINIQWEN3-CODER-480BTOGETHER AIPYDANTIC
— WANT THE FULL STORY?

LET’S
BUILD.