/// case_study · aws · data & ai

A document-AI pipeline that rests at ~€18 a month.

We migrated a Greek engineering firm's on-premises permit-processing prototype to a serverless AWS pipeline: GPU OCR and a Greek-language LLM that wake when a PDF arrives and scale back to zero, all in Terraform.
/profile
A Greek engineering & geospatial consulting firm
/workload
PDF permit ingestion → OCR → extraction → database
/engagement
On-prem PoC → serverless AWS, in Terraform
/shape
5 phases · ~1 week
/// the_problem

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.

/// how_the_pipeline_runs
Serverless document-processing pipeline on AWS: S3, Lambda, SageMaker, Aurora
// the pipeline on AWS: each stage triggers the next, and every GPU model and the database scales to zero between documents.
01

Upload

A PDF dropped into an S3 bucket triggers the pipeline: object-driven, no always-on scheduler.

02

OCR

A Lambda invokes PaddleOCR on SageMaker (table detection and recognition) and writes the result to the next bucket.

03

Extract

A second Lambda calls the Greek LLM (Krikri) on SageMaker to pull the structured fields as JSON.

04

Store

A third Lambda writes the structured row into Aurora PostgreSQL, and every component scales back to zero.

/// by_the_numbers
~€18/mo
idle baseline: GPU OCR, the LLM, and the database all scale to zero
~€0.05
typical marginal cost per PDF under batch traffic
3
GPU models on SageMaker, all scale-to-zero: 2× OCR + a Greek LLM
~1 wk
from on-prem prototype to a live AWS pipeline

// 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.”
/// what_we_delivered
01

A scale-to-zero document pipeline

S3-driven · serverless

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

02

OCR and a Greek LLM on SageMaker

PaddleOCR · Krikri

PaddleOCR (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.

03

Serverless data, locked down

Aurora · KMS · VPC

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

04

All Terraform, with cost guardrails

one repo · clean apply

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

/// from_always-on_to_scale-to-zero

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.

/// how_it_works
object-driven

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.

wake on demand

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.

reproducible

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.

services involved: aws · ai

/// why_it_works

Document AI that costs nothing when nothing's happening.

01Idles at ~€18/month: no more always-on GPU servers
02Wakes on demand: OCR, a Greek LLM, and the database spin up per document
03Reproducible Terraform: applies clean from an empty AWS account
04Locked down: KMS, SSL, private VPC, Secrets Manager, budget guardrails
/// ready_when_you_are

Got a GPU workload that's on 24/7?