How pranavparuchur1/inference-gateway works
Inference Gateway is an OpenAI-compatible front door for three model workers, with an optional Claude fallback. A client request is authenticated, rate-limited, validated, routed, admitted to a worker tier, and returned as a normal or streamed response; usage and request logs are recorded. The repository also includes measured studies of batching, KV caching, quantization, and load. Runtime wiring is supported by the README and sampled gateway/router excerpts; experiment-script relationships are documented at a capability level rather than inferred from unsampled implementations.
Main entry points: app.py HTTP gateway · auth.py API keys · bench_batching.py Batching benchmark · db.py SQLite records
Components 19
Gateway request path
- HTTP gateway
src/inference_gateway/app.py - Settings
src/inference_gateway/config.py - Token counting
src/inference_gateway/tokens.py - Admin CLI
src/inference_gateway/cli.py
Routing and controls
- API keys
src/inference_gateway/auth.py - Rate limits
src/inference_gateway/ratelimit.py - Tier router
src/inference_gateway/router.py - Admission pool
src/inference_gateway/pool.py
Identity and records
- SQLite records
src/inference_gateway/db.py - JSON request logs
src/inference_gateway/logs.py
Inference providers
- vLLM workers
- Claude fallback
src/inference_gateway/claude.py
Inference studies
- Minigen engine
src/inference_gateway/minigen.py - Batching benchmark
scripts/bench_batching.py - KV cache lab
scripts/kv_cache_lab.py - Quantization lab
scripts/quant_lab.py - Load generator
scripts/loadgen.py - Eval grading
src/inference_gateway/grading.py
Other components
- API client
Connections 18
- API client → HTTP gateway: sends requests
README.md - HTTP gateway → API keys: authenticates
src/inference_gateway/app.py - HTTP gateway → Rate limits: rate limits
README.md - HTTP gateway → Tier router: chooses tier
src/inference_gateway/app.py - HTTP gateway → Admission pool: checks capacity
README.md - HTTP gateway → Token counting: counts tokens
README.md - HTTP gateway → vLLM workers: forwards requests
README.md - HTTP gateway → Claude fallback: uses fallback
README.md - HTTP gateway → SQLite records: records usage
README.md - HTTP gateway → JSON request logs: writes request logs
README.md - Settings → HTTP gateway: configures
README.md - API keys → SQLite records: reads and writes keys
src/inference_gateway/auth.py - Admin CLI → API keys: manages keys
README.md - Batching benchmark → Minigen engine: benchmarks batching
scripts/bench_batching.py - Batching benchmark → Eval grading: uses grading
scripts/bench_batching.py - KV cache lab → vLLM workers: measures caching
README.md - Quantization lab → vLLM workers: measures quantization
README.md - Load generator → HTTP gateway: sends load
README.md