How neural-maze/production-ocr-course works
This repository is an engineering course and set of deployment snapshots for a Kubernetes-hosted visual document understanding pipeline. Its principal async workflow accepts uploads through a Rust API, queues tasks in Redis, batches them in a Python worker for GLM-OCR processing, and exposes task status/results; the README also documents a separate synchronous/streaming Rust gateway-to-vLLM path. The graph preserves both paths and the documented deployment, security, scaling, and MCP capabilities. Source excerpts are limited, so some documented integrations are shown from the README rather than inferred from unsampled code.
Main entry points: src/main.rs Upload and status API · worker.py Batching worker · src/main.rs Document API · processor.rs Document processor
Components 17
Async OCR pipeline
- Upload and status API
client_rt_producer/src/main.rs - Redis tasks and state
- Batching worker
client_rt_consumer/worker.py
Rust OCR gateway
- Document API
week4_rust_gateway_deployment/gateway/src/main.rs - Gateway configuration
week4_rust_gateway_deployment/gateway/src/config.rs - Request and response models
week4_rust_gateway_deployment/gateway/src/models.rs - Document processor
week4_rust_gateway_deployment/gateway/src/processor.rs - PDF rasterization
week4_rust_gateway_deployment/gateway/src/pdf.rs
OCR inference
- GLM-OCR SDK
- Shared-memory handoff
- vLLM model serving
week3_vllm_deployment/k8s/apps/deployment-vlm.yml
Deployment and access
- AKS or GKE cluster
- KEDA scaling
k8s/aks/apps/keda-scaler.yml - Enterprise API gateway
k8s/aks/networking/apim-policy.xml
Agent integration
- MCP server
week6_apim_mcp_deployment/mcp_server/server.py
Other components
- Document client
- AI coding assistant
Connections 19
- Document client → Upload and status API: uploads document
README.md - Upload and status API → Redis tasks and state: stores task
client_rt_producer/src/main.rs - Batching worker → Redis tasks and state: claims and updates
client_rt_consumer/worker.py - Redis tasks and state → Batching worker: queues task IDs
client_rt_consumer/worker.py - Batching worker → Shared-memory handoff: writes files
client_rt_consumer/worker.py - Batching worker → GLM-OCR SDK: parses batch
client_rt_consumer/worker.py - Upload and status API → Redis tasks and state: reads task result
client_rt_producer/src/main.rs - Document API → Gateway configuration: loads settings
week4_rust_gateway_deployment/gateway/src/main.rs - Document API → Document processor: processes request
week4_rust_gateway_deployment/gateway/src/main.rs - Document API → Request and response models: uses DTOs
week4_rust_gateway_deployment/gateway/src/main.rs - Document processor → PDF rasterization: rasterizes documents
week4_rust_gateway_deployment/gateway/src/processor.rs - Document processor → vLLM model serving: sends inference requests
week4_rust_gateway_deployment/gateway/src/processor.rs - Document client → Document API: submits document
README.md - AKS or GKE cluster → KEDA scaling: scales workloads
README.md - Enterprise API gateway → Upload and status API: secures API access
README.md - AI coding assistant → MCP server: invokes OCR tool
week6_apim_mcp_deployment/mcp_server/server.py - MCP server → Upload and status API: submits and polls
week6_apim_mcp_deployment/mcp_server/server.py - vLLM model serving → AKS or GKE cluster: runs on
README.md - GLM-OCR SDK → vLLM model serving: layout-first pipeline
README.md