How vllm-project/vllm-gr works
vLLM-GR serves generative recommendation models: a caller supplies interaction-history prompts and beam-search settings, and receives ranked candidate item IDs with scores. The main path runs through configuration and an offline or online serving entrypoint into an EngineCore-owned beam session; scheduling and device workers perform prefill and iterative beam decoding. Catalog constraints, CUDA/Ascend implementations, and weight/catalog updates are important supporting capabilities. The README documents several runtime features; links not shown by excerpts or indexed references are omitted rather than inferred.
Main entry points: llm.py Python inference · engine_core_patch.py EngineCore integration · client.py Beam session client · worker.py CUDA worker
Components 23
Configuration and serving
- GR configuration
vllm_gr/config/models.py - Config parsing
vllm_gr/config/parser.py - Engine startup
vllm_gr/engine/startup.py - Python inference
vllm_gr/entrypoints/llm.py - HTTP serving
vllm_gr/entrypoints/openai/serving_engine.py - gRPC serving
vllm_gr/entrypoints/grpc/serving.py
Beam engine
- Beam session client
vllm_gr/entrypoints/beam_search/client.py - Beam protocol
vllm_gr/entrypoints/beam_search/protocol.py - Batch contracts
vllm_gr/v1/beam/batch_contracts.py - EngineCore integration
vllm_gr/v1/engine/engine_core_patch.py - Async beam scheduler
vllm_gr/v1/core/sched/beam_async_scheduler.py - Scheduler integration
vllm_gr/v1/core/sched/scheduler_patch.py - Engine wire format
vllm_gr/v1/engine/wire.py
Device execution
- CUDA worker
vllm_gr/v1/worker/cuda/worker.py - Ascend worker
vllm_gr/v1/worker/npu/worker.py - Beam attention
vllm_gr/v1/attention/backends/beam_attn_metadata.py - Beam kernels
vllm_gr/ops/onerec_decode.py
Catalog constraints
- Constraint compiler
vllm_gr/constraints/compiler.py - Constraint loader
vllm_gr/constraints/loader.py - Constraint tables
vllm_gr/constraints/table.py
Runtime operations
- Worker hot updates
vllm_gr/v1/worker/hot_update.py - Update controller
vllm_gr/sidecar/controller.py
Other components
- Application caller
Connections 21
- Application caller → Python inference: runs inference
README.md - Application caller → HTTP serving: requests completion
README.md - Application caller → gRPC serving: uses experimental API
README.md - Config parsing → GR configuration: builds settings
vllm_gr/config/parser.py - Python inference → Config parsing: resolves settings
vllm_gr/entrypoints/llm.py - Python inference → Engine startup: prepares engine
vllm_gr/entrypoints/llm.py - HTTP serving → Beam session client: runs beam search
vllm_gr/entrypoints/openai/serving_engine.py - Python inference → Beam session client: submits session
vllm_gr/entrypoints/llm.py - Beam session client → Beam protocol: uses request types
vllm_gr/entrypoints/beam_search/client.py - Beam protocol → Batch contracts: uses batch contracts
vllm_gr/entrypoints/beam_search/protocol.py - EngineCore integration → Scheduler integration: installs integration
vllm_gr/v1/engine/engine_core_patch.py - Scheduler integration → Async beam scheduler: uses scheduler
vllm_gr/v1/core/sched/scheduler_patch.py - EngineCore integration → Engine wire format: uses wire types
vllm_gr/v1/engine/engine_core_patch.py - EngineCore integration → Batch contracts: checks batch contracts
vllm_gr/v1/engine/engine_core_patch.py - CUDA worker → Beam attention: runs beam attention
- CUDA worker → Beam kernels: executes beam kernels
- Ascend worker → Beam attention: uses NPU attention
- Constraint compiler → Constraint tables: compiles tables
vllm_gr/constraints/compiler.py - Constraint loader → Constraint tables: loads tables
- Update controller → Worker hot updates: updates instances
- Worker hot updates → Constraint loader: reloads trie
vllm_gr/v1/worker/hot_update.py