How sohamnigh/mini-inference-serving-system works
This is a split-process MNIST inference-serving system: clients submit JSON predictions to a Go HTTP front end, which validates requests, queues and dynamically batches them, then calls a C++ gRPC engine for model inference. The graph also preserves the documented metrics and offline training/export capabilities. Edges follow shown wiring and documented calls; the batcher and engine client implementations are indexed as read but not excerpted, so their connection is supported by the README rather than inspected implementation details.
Main entry points: app.go Server wiring · client.go gRPC client · server.go HTTP API · batcher.go Queue and batcher
Components 12
Go serving front end
- HTTP API
go-server/internal/httpapi/server.go - Queue and batcher
go-server/internal/batcher/batcher.go - gRPC client
go-server/internal/engineclient/client.go - Server wiring
go-server/internal/app/app.go - Metrics
go-server/internal/metrics/metrics.go
C++ inference engine
- gRPC service
cpp-engine/main.cc - Model loader and inference
cpp-engine/model.cc - Inference kernels
cpp-engine/kernels.cc
Offline model training
- MNIST trainer
training/train.py - Weights export
training/weights_io.py
Service contract
- PredictBatch contract
proto/inference.proto
Other components
- Inference client
Connections 15
- Inference client → HTTP API: submits JSON
README.md - HTTP API → Queue and batcher: submits requests
go-server/internal/httpapi/server.go - Queue and batcher → gRPC client: sends batches
README.md - gRPC client → gRPC service: calls gRPC
README.md - gRPC service → Model loader and inference: invokes predict
cpp-engine/main.cc - Model loader and inference → Inference kernels: calls kernels
cpp-engine/model.cc - gRPC service → PredictBatch contract: implements RPC
proto/inference.proto - gRPC client → PredictBatch contract: uses RPC contract
README.md - MNIST trainer → Weights export: exports weights
training/train.py - Server wiring → gRPC client: creates client
go-server/internal/app/app.go - Server wiring → Queue and batcher: creates batcher
go-server/internal/app/app.go - Server wiring → HTTP API: creates API
go-server/internal/app/app.go - Server wiring → Metrics: registers metrics
go-server/internal/app/app.go - Server wiring → Queue and batcher: attaches observer
go-server/internal/app/app.go - Server wiring → HTTP API: attaches recorder
go-server/internal/app/app.go