"Rules do not exist for the sake of control. They exist for the sake of compatibility. But what happens when every state has its own track gauge?"


๐Ÿ’ก Inspiration

When reviewing the Hack Apertus challenge tracks, I wanted to build something fundamentally useful for society โ€” a system tackling a real problem, while pushing my own engineering boundaries by working hands-on with the Swiss National Supercomputing Centre (CSCS Alps).

Switzerlandโ€™s federalist strength is also its greatest data paradox: 26 cantons, 4 national languages, and ~300,000 parliamentary affairs trapped in disparate, idiosyncratic PDF documents.

In the Track 2A (OpenParlData) challenge description, three critical gaps were highlighted: the Format Gap, the Extraction Gap, and the Verification Gap. When rules and formats diverge like railway gauges, democratic transparency grinds to a halt. I set out to prove that in just 7 days, a sovereign, open-weights AI model could bridge these gaps into a single, unified, verifiable standard.


โš™๏ธ What It Does

SEVERIN (Swiss Extraction & Verifiable Entity Representation for Parliamentary Inter-cantonal Networks) is a sovereign AI extraction platform that ingests heterogeneous Swiss parliamentary documents across all 26 cantons and the Federal Assembly:

  1. Unified Semantic Normalization: Translates chaotic cantonal PDF layouts across 4 languages (DE, FR, IT, RM) into a single, rigorous Pydantic v2 schema (ParliamentaryAffair) harmonizing 8 affair types.
  2. 100% Verifiable Provenance: Every single extracted fact, author, question, and government reply is tied to a 1-indexed physical PDF page number and an exact verbatim quote.
  3. Zero Hallucinations by Design: Enforces the "Rule of Absence" โ€” if an affair does not allocate budget credits or does not have an executive response yet, fields return strict null / [], never invented numbers.
  4. Interactive Full-Stack Platform: Features a split-screen PDF viewer, real-time citation validation badges, and live CSCS inference telemetry.

๐Ÿ“บ Demo Video: Watch the 3-minute Walkthrough
๐Ÿ”— GitHub: https://github.com/vero-code/severin


๐Ÿ› ๏ธ How I Built It

  • Supercomputing Brain: Powered by swiss-ai/Apertus-v1.5-8B running remotely on NVIDIA Grace Hopper GH200 nodes at CSCS Alps in Lugano via an OpenAI-compatible API (temperature=0.0).
  • Data Model & Guardrails: Built with Pydantic v2 using strict schemas (extra="forbid"). I engineered a tailored Defensive Normalizer to handle multilingual JSON formatting quirks from smaller LLMs without masking live errors.
  • Multi-Modal Document Parsing: Implemented physical page extraction via pypdf. For pure raster scans with zero extractable text (e.g. Canton Obwalden), I designed the system to automatically trigger Apertus Vision OCR via Pillow image extraction.
  • Backend & Frontend: Developed with FastAPI (OpenAPI 3.1) and a sleek React 19 single-page application.
  • Turnkey Reproducibility: Packaged the entire local stack into a multi-stage Docker container with a single entrypoint: make run.

๐Ÿง— Challenges I Ran Into

  • Multilingual Structural Idiosyncrasies: Handling German interpellation numbering, French formal questions, and Italian parliamentary addresses required careful prompt engineering to ensure Apertus 8B preserved exact sentence structures without truncating text.
  • Scientific Integrity vs. Deceptive Fallbacks: I committed to strict academic honesty: live CSCS inference is never deceptively masked by cached mocks. If an API call fails or hits limits, it is logged openly.
  • Physical Page Anchoring: Matching model text snippets to physical PDF bounding boxes required me to build custom whitespace and ligature normalization to ensure 100% character-level provenance against source documents.

๐Ÿ† Accomplishments I'm Proud Of

  • Built solo in 7 days: A complete, production-grade proof-of-concept from scratch.
  • 100.0% Verifiable Provenance: Achieved 19/19 verbatim citation matches across a 5-jurisdiction multilingual benchmark (CHE, ZH, GE, TI, GR).
  • Extreme Efficiency on CSCS Alps: Cold latency averages 5.12s, dropping to 3.16s on warm cache requests thanks to vLLM PagedAttention prefix caching, at an average cost of only 0.000047 CHF per document.
  • Complete Academic Report: Authored a rigorous 6-page technical report following the competition standard.

๐ŸŽ“ What I Learned

  • How to architect reliable, deterministic workflows with the CSCS Alps supercomputing infrastructure and take advantage of PagedAttention token caching.
  • That small, sovereign 8B open-weight models, when paired with strict Pydantic schemas and algorithmic verification, can achieve zero-hallucination document extraction rivaling proprietary 70B+ models at a fraction of the cost.

Built With

Share this project:

Updates

Submission history