Self-hosted service
neural-maze/production-ocr-course avatar
neural-maze/production-ocr-course

production-ocr-course: a Kubernetes OCR pipeline built around vLLM and a Rust gateway

Build, deploy, and scale a production-grade OCR pipeline using Rust, vLLM, Redis, KEDA, and Kubernetes.

505 stars149 forksRustApache-2.0

At a glance

What is it?
The repository is a six-week course plus working code for a self-scaling document understanding pipeline: a Rust Axum gateway, Redis as the queue, a Python worker, and Qwen 3.5 served by vLLM. It is aimed at engineers who already know how to call an OCR API and now want the cluster around it.
Who is it for?
Adopt it if you run AKS or GKE, already have GPU quota, and want a worked example of splitting a Rust ingest gateway from GPU inference through Redis. Skip it if you need a supported library with a stable API, or if you cannot get A100 and T4 capacity, since the course assumes both node pools exist.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 25 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • neural-maze/production-ocr-course505 ★ · +98
Star history
Repository2026-09-172026-11-22
neural-maze/production-ocr-course407505

98 Stars in the last 66 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The gap this course targets: OCR that returns text versus OCR that returns structure

The README opens by rejecting the shape of most OCR tutorials: call an API, get text back, stop. What it builds instead is what it calls a production-grade, self-scaling Visual Document Understanding pipeline, deployed on Kubernetes on AKS or GKE. The distinction it draws is between transcription and reasoning about charts, tables and layout, and it puts a Small Language Model, Qwen 3.5 (4B), on the reasoning side rather than a frontier model.

The audience is stated plainly: ML/AI Engineers and Platform Engineers who already know how to call an OCR API and want to know what it takes to run one in production. That framing matters for evaluating the repository. This is not a drop-in library and it is not trying to be. The deliverable is a six-week cohort structure, one systems article per week plus a live office hours session, with the entire repository open from day one and a standalone deployment walkthrough per week. If you want a package you can import, the repository layout will disappoint you. If you want the cluster, the node pools and the autoscaling economics worked through, that is the actual subject.

How the pipeline moves a document: Rust gateway, Redis, /dev/shm, vLLM

The architecture separates ingestion from inference, and the separation is the point. Files enter through a high-concurrency Rust gateway built on Axum, named client_rt_producer in the repository. The README describes 10MB payload limits and atomic HSET writes to Redis. Redis is not a cache here; it is the queue that decouples the gateway from the GPU.

On the other side sits a Python worker, client_rt_consumer, which collects work in a 100ms window before dispatching it. Between the layout encoder and the inference engine the handoff is zero-copy and RAM-disk based, through /dev/shm. The inference engine is vLLM serving Qwen 3.5 4B, and the README attributes the throughput to continuous batching, PagedAttention and Multi-Token Prediction, with a stated figure of 1.86 pages per second.

Scaling is split by workload type. T4 node pools handle layout detection and A100 node pools handle inference, and KEDA scales them independently, from zero up to bursting load. Week 3 covers tuning MAX_NUM_BATCHED_TOKENS, chunked prefills and MTP. Week 6 puts the whole thing behind an Internal Load Balancer and an enterprise gateway (Azure APIM or GCP API Gateway) so nothing is publicly exposed, and wraps the pipeline as an MCP server for use by AI agents, Claude Code named among them. The design choice worth noting is that the gateway never touches a GPU and the GPU never parses a multipart upload. That is what makes the two node pools independently scalable.

Getting started: account setup, GPU quota, then the per-week walkthroughs

The top-level README does not give a single install command. Its Getting Started section orders the work explicitly: create your cloud account and claim free credits, then GPU quota, then the full deployment guide for your cloud of choice. Nothing runs before the quota is approved, so treat that as step zero rather than a formality.

The code itself is split across top-level directories: client_rt_producer/ for the Rust Axum gateway, client_rt_consumer/ for the Python worker, server/, k8s/, and one deployment directory per week. The README links a standalone deployment walkthrough for each of weeks 3 through 6, for example week4_rust_gateway_deployment/README.md for the gateway and week3_vllm_deployment/README.md for the vLLM inference engine. Those walkthroughs, not the top-level README, carry the actual commands, so start there rather than guessing at a build invocation.

What the README does specify about the gateway is its shape: an Axum service handling heavy payloads with 10MB limits, writing atomically to Redis with HSET. The atomic write is what keeps a partially uploaded document from being picked up by the consumer mid-write, so the failure to watch for is a Redis connection error at startup rather than a request error later. The Kubernetes side is under k8s/, with the per-week manifests in the week3 through week6 deployment directories. The README does not document the resource names or namespaces, so read the manifests before applying them, and confirm in the pod output that the T4 and A100 pools are scheduled separately. If pods sit Pending, the GPU quota or the node taints from week 1 are the likely cause.

Where this course is the wrong tool

The README does not document rollback, and that is the first real limitation. A course that walks you through provisioning T4 and A100 node pools, GPU drivers and operators, KEDA scaling rules and an API gateway does not tell you how to back any of it out. If your team needs a reversible deployment story before it starts, this repository does not supply one.

The second constraint is cost and access. The pipeline assumes A100 capacity for inference and T4 capacity for layout. GPU quota is not a configuration detail you can substitute away; the README treats claiming it as a prerequisite step. Teams without that quota, or without an AKS or GKE account, cannot follow the course as written.

The third is the nature of the artifact. The repository has no published GitHub releases, and the deliverable is a cohort-structured course rather than a versioned library. Anything you build by following along is yours to maintain. The 1.86 pages per second figure is stated in the README for the described configuration; it is a property of that specific setup on that specific hardware, not a number you should expect to reproduce on different GPUs, a different batch configuration, or a different document mix. If your documents are plain scans with no tables or charts, the layout-first two-stage pipeline adds a stage you do not need, and a single-stage OCR model will be simpler to operate.

Compared with calling a hosted OCR API

The obvious alternative is a hosted document AI service from a cloud provider. The difference in approach is not accuracy, it is where the boundary sits. A hosted API hands you an endpoint and a per-page price and keeps the GPUs, the batching and the scaling on its side of the line. This repository puts all of that on your side: you own the node pools, the KEDA rules, the Redis queue and the gateway policies.

That trade is worth naming precisely. You gain control over the model, since Qwen 3.5 4B runs in your cluster and no document leaves your network, which is what the Internal Load Balancer and enterprise gateway in week 6 are there to guarantee. You gain the ability to tune batching parameters like MAX_NUM_BATCHED_TOKENS against your own traffic. You lose the operational simplicity entirely, and you take on GPU quota, driver management and scale-to-zero tuning as ongoing work. For a team processing a few thousand pages a month, the hosted API wins on total effort. For a team with a document volume that makes per-page pricing painful, or a data residency requirement that rules out sending documents out, the self-hosted pipeline is the reason to read this repository at all.

Maintenance cost, the six-week structure and the Apache-2.0 licence

The last push to the repository was on 2026-09-01, so it is recent, but the README describes a cohort running on a weekly cadence with articles on Wednesdays and office hours on Fridays. That is a delivery format, not a support commitment, and nothing in the repository promises that the manifests keep working as vLLM, KEDA or the cloud gateway APIs change. Budget for the fact that a vLLM upgrade can invalidate the week 3 tuning guidance, and that APIM and GCP API Gateway policies in week 6 are cloud-specific and drift independently of this repository.

The licence is Apache-2.0, which permits commercial use and modification and includes a patent grant. That is the permissive end of the spectrum, but it says nothing about the models the course uses: Qwen 3.5 and the GLM-OCR SDK carry their own terms, and the Apache-2.0 file in this repository does not extend to them. Check those licences separately before shipping anything built from week 2 or week 3. The README also points readers to The Neural Maze Substack for weekly articles, so part of the material lives outside the repository and is not covered by the licence file here.

Editorial conclusion

Adopt it if you run AKS or GKE, already have GPU quota, and want a worked example of splitting a Rust ingest gateway from GPU inference through Redis. Skip it if you need a supported library with a stable API, or if you cannot get A100 and T4 capacity, since the course assumes both node pools exist. Before committing, read week3_vllm_deployment/README.md and week4_rust_gateway_deployment/README.md end to end, and check the k8s/ manifests for the KEDA scaling rules, because the top-level README describes the architecture but the per-week walkthroughs carry the deployment detail.

Frequently asked questions

What is an OCR course, and what does production-ocr-course cover?

It is a six-week course plus an open-source codebase for building a self-scaling OCR and Visual Document Understanding pipeline on Kubernetes. The README describes a Rust Axum ingest gateway, Redis as the queue, a Python worker, and Qwen 3.5 4B served by vLLM on AKS or GKE.

How does OCR work step by step in production-ocr-course?

Files enter through the Rust Axum gateway, which writes them atomically to Redis with HSET. A Python worker collects work in a 100ms window, hands documents to the layout encoder through a zero-copy /dev/shm transfer, and vLLM serves Qwen 3.5 4B for the reasoning stage. KEDA scales the T4 and A100 node pools independently.

Does production-ocr-course use Qwen?

Yes. The README names Qwen 3.5 (4B) as the Small Language Model behind the pipeline, served through vLLM with continuous batching, PagedAttention and Multi-Token Prediction. Week 3 is dedicated to deploying and tuning that inference engine.

Is production-ocr-course free to use?

The repository is open source under Apache-2.0 from day one, and the README says the entire repository is open-source. Running it is not free: the pipeline assumes T4 and A100 node pools on AKS or GKE, and the README treats claiming GPU quota as a prerequisite step.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. neural-maze/production-ocr-course on GitHub
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/neural-maze-production-ocr-course.svg)](https://hysenlabs.com/projects/neural-maze-production-ocr-course)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/neural-maze-production-ocr-course.svg)](https://hysenlabs.com/projects/neural-maze-production-ocr-course)

Was this useful?