A document-AI pipeline that rests at ~€18 a month.
The firm had already proven the idea on-premises: ingest a PDF permit, OCR it, extract the structured fields with a Greek-language LLM, and write the result to a database. It worked, but it ran on always-on GPU servers, driven from a notebook.
- Always-on GPU cost: the OCR and LLM models ran on GPU servers that billed around the clock, whether a document was being processed or not.
- Operated from a notebook: the pipeline lived in a Jupyter notebook over Kubernetes pods, not something you could hand to operations.
- Not reproducible: no infrastructure-as-code, no clean way to stand the environment up again.
- Greek-language documents: the OCR and extraction had to handle Greek permits accurately, which rules out most off-the-shelf English-only tooling.
They wanted the same results on AWS: usage-based, reproducible, and costing nothing when no documents are flowing.

Upload
A PDF dropped into an S3 bucket triggers the pipeline: object-driven, no always-on scheduler.
OCR
A Lambda invokes PaddleOCR on SageMaker (table detection and recognition) and writes the result to the next bucket.
Extract
A second Lambda calls the Greek LLM (Krikri) on SageMaker to pull the structured fields as JSON.
Store
A third Lambda writes the structured row into Aurora PostgreSQL, and every component scales back to zero.
// cost figures are indicative AWS list-price estimates (eu-central-1, EUR); per-PDF cost rises under sparse traffic where each document pays a GPU cold-start.
“GPU OCR and a Greek LLM that wake when a PDF lands and scale back to zero: a document-AI pipeline that costs about €18 a month at rest.”
A scale-to-zero document pipeline
S3-driven · serverlessEach stage triggers the next on object-create in S3 (OCR, then extraction, then the database write) with no always-on orchestrator. When the documents stop, every GPU endpoint and the database scale back to zero, so the pipeline costs almost nothing at rest and wakes on demand when a PDF arrives.
OCR and a Greek LLM on SageMaker
PaddleOCR · KrikriPaddleOCR (table detection and recognition) and the Greek-language model ilsp/Llama-Krikri-8B-Instruct run as SageMaker Asynchronous Inference endpoints with a minimum of zero instances. They wake from zero using the canonical HasBacklogWithoutCapacity step-scaling pattern: a request arrives, the alarm fires, an instance spins up.
Serverless data, locked down
Aurora · KMS · VPCAurora PostgreSQL Serverless v2 scales to a minimum of 0 ACU: encrypted with a customer-managed KMS key, SSL enforced, and reachable only from the in-VPC database Lambda. Credentials live in Secrets Manager with rotation; the VPC has no NAT, reaching S3 and Secrets Manager through private endpoints.
All Terraform, with cost guardrails
one repo · clean applyThe whole stack is Terraform from a single repository that applies cleanly from an empty AWS account. AWS Budgets and CloudWatch alarms guard against cost runaway, and we handed it over with architecture docs, an operational runbook, a knowledge-transfer session, and a path to a client-owned AWS account.
Same results, a completely different cost shape.
Before: the pipeline ran on GPU servers that were on 24/7, orchestrated by hand from a notebook. You paid for the GPUs whether or not a single document was processed.
After: a usage-based AWS pipeline that idles at about €18/month and charges roughly €0.03–€0.10 per PDF under batch traffic. The GPU models and the database spin up on demand and scale back to zero, and the whole thing is reproducible Terraform.
S3 + Lambda
Three S3 buckets and three container Lambdas chain the stages: a new object in one bucket triggers the next stage. No scheduler, no idle compute between documents.
SageMaker async
Asynchronous inference endpoints with a minimum of zero instances, woken by the HasBacklogWithoutCapacity scale-from-zero pattern: the standard way to run GPU models that cost nothing while idle.
Terraform
One repository, remote state, least-privilege IAM, customer-managed KMS, and AWS Budgets, applies clean from an empty account and hands over to the client's own.