Understand the request flow and engine architecture
mainThe worker processes requests through a structured pipeline:
Request Flow:
RunPod Request → handler.py → JobInput → Engine Selection → vLLM Generation → Streaming Response
Engine Modes:
- OpenAI-compatible: Uses
OpenAIvLLMEngineto provide a drop-in replacement for OpenAI APIs (e.g.,/openai/v1/chat/completions). Routing is determined by theopenai_routeboolean in theJobInput. - Native vLLM: Uses
vLLMEnginefor standard vLLM inference patterns.
Key Features:
- Streaming: Token-level streaming is supported by default.
- Dynamic Batching: Uses adaptive batch sizes that grow from a minimum to a maximum value using a
growth_factorfor efficiency.