Choosing a stack¶
Start with the smallest stack that meets today's needs. Every stack uses the same API and the same messages (qaechi-contracts), so your application code does not change when you move up.
Comparison and minimum requirements¶
| Library | Lite | Scale | Batch | Enterprise | |
|---|---|---|---|---|---|
| Overview | |||||
| Best for | One Python application | A team, a PoC, internal tools | Many systems, steady high volume | Bulk or nightly loads | Core business processes |
| Volume | Per request | Up to thousands a day | Tens of thousands a day and more | Hundreds of thousands per run | Unlimited |
| Components | None (a library) | 1 parser service, dashboards | API, workers, Kafka, database, Redis, sink | Coordinator, workers, Kafka, storage | Scale + outbox, CDC, Kubernetes |
| Servers | Your existing app server | 1 small server | 1 large server, or several by role | Several, for the run only | Your platform |
| Minimum requirements (recommended in brackets) | |||||
| OS | Linux, macOS, Windows | 64-bit Linux (x86_64, arm64) Ubuntu 22.04+, Debian 12+, Rocky 9+ | Same as Lite | Same as Scale | Same as Scale |
| Python | 3.11 or later (tested 3.11 to 3.13) | Not needed (images ship 3.13) | Not needed | Not needed | Not needed |
| Containers | Not needed | Docker Engine 27+, Compose v2 | One host: Compose v2 Production: Kubernetes 1.30+ | Docker or Kubernetes 1.30+ | Kubernetes 1.30+ |
| CPU | 1 vCPU (2) | 2 vCPU (4) | One host: 4 vCPU (8) Production: per component | Per component | Per component |
| Memory | 1 GB (2) | 4 GB (8) | One host: 8 GB (16) Production: per component | Per component | Per component |
| Disk | 1 GB free | 20 GB SSD (50) | One host: 50 GB SSD (100) Production: per component | SSD, object storage | SSD, persistent volumes |
| Network | LLM endpoint (optional) | + PyPI, Docker Hub while building | Same as Lite, plus managed Kafka and DB | Same as Scale | Air-gapped possible (image mirror) |
These are starting points. Large PDFs need more memory per worker; size your deployment by
running scripts/loadtest.py from qaechi-stack on your own documents.
Ports, security and per-component production sizes: Deployment.
Modules per stack and where they run¶
Each cell names the server the module is installed on. A dash means the stack does not use that module.
| Module | Library | Lite | Scale | Batch | Enterprise |
|---|---|---|---|---|---|
| qaechi-parser libraryLibrary | App server (in process) | - | - | - | - |
| parser APIServer | - | Parser server | 2+ API servers (behind a load balancer) | API server | Kubernetes pods |
| parser workerServer | - | Built into the API (background) | N worker nodes | Worker nodes (scaled for the run) | Kubernetes pods (KEDA autoscaling) |
| qaechi-sinkServer | - | - | Next to your database | Next to your database | Kubernetes pods |
| qaechi-contractsLibrary | - | Optional (calling apps) | Services that publish jobs | Services that publish jobs | Business services |
| KafkaInfrastructure | - | - | 3 messaging servers or managed (MSK) | Shared with Scale | Managed Kafka |
| Job store databaseInfrastructure | - | Optional: parser server or a managed DB | Database server (primary + standby) | Shared with Scale | Managed database |
| RedisInfrastructure: result cache, shared rate limit | - | - | 1 Redis server or managed (ElastiCache) | Shared with Scale | Managed Redis |
| ObservabilityInfrastructure: VictoriaMetrics, Tempo, Grafana | - | Parser server | Monitoring server | Monitoring server | ELK or your observability platform |
| batch coordinatorServer | - | - | - | 1 container per run | - |
| outbox, CDC relayLibrary and server | - | - | - | - | Business service servers, CDC server |
Install commands and how each module scales: Modules.
Library¶
Best for: one Python application that parses documents itself and waits for the result.
flowchart LR
app["Your application<br/>(Python)"] -- "parse_file(path)" --> lib["qaechi-parser<br/>(same process)"]
lib --> res["Values with<br/>quote and page"]
res --> app
- Install with
pip install "qaechi-parser[parse]"; addllmfor LLM extraction. - Call
qaechi.parser.parse_file(path, doc_type)and get anExtractionback. - Store the result wherever your system keeps its data.
Server layout¶
| Server | Installed | Notes |
|---|---|---|
| Your existing application server | Your application + qaechi-parser[parse] |
No extra server; runs within your application's resources |
| LLM endpoint (optional) | A cloud or in-house LLM | Only if you use one |
Move to Lite when services in other languages need to call it, or when you want throughput and quality on a dashboard.
Lite¶
Best for: several applications or a small team sending documents over HTTP, with visibility into processing.
flowchart LR
subgraph yours["Your systems"]
app["Your application<br/>(any language)"]
end
subgraph lite["Lite stack (one server)"]
api["qaechi-parser<br/>HTTP service"]
obs["Metrics, traces,<br/>Grafana dashboard"]
end
app -- "1. POST /jobs" --> api
api -- "2. jobId right away" --> app
app -- "3. GET /jobs/{id}, /results/{id}" --> api
api -. "metrics and traces" .-> obs
- Your application submits a job and gets a job ID right away; parsing runs in the background.
- It checks the job status, then reads the result: every value with its quote and page.
- The dashboard shows jobs per minute, p95 latency and the share of values with verified evidence.
Server layout¶
| Server | Installed | Size |
|---|---|---|
| Parser server (1) | parser API (qaechi-parser serve), VictoriaMetrics, Tempo, Grafana |
2 vCPU, 4 GB, 20 GB SSD (recommended 4 vCPU, 8 GB) |
| Database (optional) | PostgreSQL, MySQL or MongoDB | On the parser server or a managed database |
| Application servers | Your applications (HTTP calls only) | Nothing to install |
Set up: stacks/lite in qaechi-stack. Results are kept in memory
by default; set QAECHI_DATABASE_URL to persist them in PostgreSQL, MySQL or MongoDB.
Scale¶
Best for: documents arriving all day from several systems, more than one process can handle, or results that must land in your operational database without polling.
flowchart TB
subgraph intake["① Intake"]
direction LR
app["Your application"] -- "POST /jobs" --> api["parser API"] -- "publish" --> jobs[("Kafka<br/>jobs topic")]
end
subgraph proc["② Parallel processing and delivery"]
direction LR
w["parser workers × N"] -- "result event" --> results[("Kafka<br/>results topic")] --> sink["qaechi-sink"] -- "values and evidence" --> db[("Your database<br/>PostgreSQL, Supabase,<br/>MySQL, MongoDB, webhook")]
end
intake --> proc
- Your application submits jobs exactly as with Lite. The API stores each job and publishes it to Kafka.
- Worker processes parse in parallel; throughput scales with the number of replicas.
- Each finished job produces a result event that any service can subscribe to.
- qaechi-sink writes values, pages and quotes into your database, or calls your webhook.
- Your application reads the results where it already reads its data.
Redelivered messages are skipped, interrupted jobs are retried a bounded number of times, and unreadable messages go to a dead-letter topic. Details: Architecture.
Server layout (production)¶
| Server role | Installed | Per instance | Count |
|---|---|---|---|
| API servers | parser API | 1 vCPU, 1 GB | 2 or more, behind a load balancer |
| Worker nodes | parser worker (qaechi-parser worker) |
1 vCPU, 1 to 2 GB per process | As needed, up to the jobs topic's partitions |
| Messaging servers | Kafka 4.4 (KRaft) | 2 vCPU, 8 GB, 100 GB SSD | 3, or managed (Amazon MSK) |
| Database servers | PostgreSQL, MySQL or MongoDB (job store and sink target) | 2 vCPU, 8 GB, 50 GB SSD | Primary + standby, or managed |
| Cache server | Redis 7+ or compatible (result cache and shared LLM rate limit) | 1 vCPU, 2 GB | 1, or managed (Amazon ElastiCache) |
| Sink server | qaechi-sink (same network as the database) | 0.5 vCPU, 512 MB | 1 to 2 |
| Monitoring server | VictoriaMetrics, Tempo, Grafana | 2 vCPU, 4 GB, 50 GB SSD | 1 |
For a PoC or medium volume, all of the above runs from one Compose file on a single server (4 vCPU, 8 GB, 50 GB SSD or more).
Set up: stacks/scale in qaechi-stack. In production, use a
managed Kafka (for example Amazon MSK), a managed database and a managed Redis (for example Amazon ElastiCache).
Batch¶
Best for: loading a large archive once, or every night, for example to build a RAG index.
flowchart LR
m["Manifest<br/>(100k files)"] --> c["batch coordinator"]
c -- "split" --> jobs[("Kafka jobs")]
jobs --> w["workers × N<br/>(scaled for the run)"]
w --> results[("results")]
results --> c
results --> sink["sink"] --> out[("Parquet, pgvector,<br/>your database")]
c --> rep["Progress and<br/>final report"]
The same workers and sink as Scale, plus a coordinator that splits the manifest, tracks progress and writes a report. Part of roadmap stage C.
Server layout¶
| Server role | Installed | Notes |
|---|---|---|
| Coordinator | batch coordinator (qaechi-batch serve) |
1 container per run |
| Worker nodes | parser worker | Scaled out for the run, then back down |
| Messaging, database, sink | Kafka, database, qaechi-sink | Can be shared with a Scale deployment |
| Storage | Object storage, Parquet, pgvector | Source documents and loaded results |
Enterprise¶
Best for: parse requests that are part of a business transaction (an order, a claim, a contract) and must never be lost, or data that may not leave your network.
flowchart TB
subgraph svc["① Business transaction (one commit)"]
direction LR
biz["Business data<br/>(order, claim)"] ~~~ out["Outbox record<br/>(parse request)"]
end
subgraph relay["② Request relay"]
direction LR
cdc["CDC relay<br/>(Eventuate, Debezium)"] --> jobs[("Kafka<br/>jobs topic")]
end
subgraph proc["③ Processing and delivery"]
direction LR
w["parser workers × N"] --> results[("results topic")] --> sink["qaechi-sink"] --> back[("Your database")]
end
svc --> relay --> proc
The business change and the parse request commit in one transaction, and change data capture publishes the request. No dual write, so no lost request. Add an in-house LLM, Kubernetes that scales on queue lag, and ELK. Contact us
Server layout¶
| Server role | Installed | Notes |
|---|---|---|
| Business service servers | Your application + qaechi-outbox | The outbox table shares the business database transaction |
| CDC server | Eventuate or Debezium | Relays the outbox to Kafka |
| Kubernetes cluster | parser API, parser workers (KEDA), qaechi-sink | Helm chart |
| Messaging, database | Managed Kafka, managed database | In your cloud or data center |
| Inference servers | In-house LLM (GPU or CPU) | No external calls |
| Monitoring | ELK or your observability platform | Connected over OpenTelemetry |