How tadayukiokada/open-genie-server works
open-genie-server is a single-process FastAPI bridge from OpenAI-compatible clients to Qualcomm’s Genie C API. The principal path is request validation and slot selection, prompt/tool/grammar preparation, serialized GenieDialog inference, then formatted HTTP or streaming output. Separate branches handle model and adapter controls, profiling/logprobs, prefix-cache warmup, and VLM requests through GenieNode pipelines. The VLM and some operational features are documented, but their full route-level implementation was not excerpted; those links rely on README evidence.
Main entry points: app.py FastAPI routes · engine.py Generation engine · vlm.py VLM slot pipeline · slots.py Text slots
Components 21
HTTP API
- FastAPI routes
src/genie_server/app.py - Server config
src/genie_server/config.py - Startup wiring
src/genie_server/bootstrap.py
Text inference
- Text slots
src/genie_server/slots.py - Generation engine
src/genie_server/engine.py - Chat templates
src/genie_server/templates.py - Tool dialects
src/genie_server/tool_formats.py - Tool parsing
src/genie_server/tools.py - Grammar decoding
src/genie_server/grammar.py - Logprob scoring
src/genie_server/logprobs.py - Prefix KV cache
src/genie_server/prefix_cache.py
Genie runtime
- Genie C bindings
src/genie_server/capi.py - Genie SDK
- Model bundles
VLM inference
- VLM slot pipeline
src/genie_server/vlm.py - Bundle layout
src/genie_server/vlm_layout.py - Genie node API
src/genie_server/genie_node.py - VLM family specs
src/genie_server/vlm_specs/base.py - Qwen3-VL spec
src/genie_server/vlm_specs/qwen3_vl.py
Model controls
- SDK profiling
src/genie_server/capi.py
Other components
- OpenAI clients
Connections 27
- OpenAI clients → FastAPI routes: send requests
README.md - FastAPI routes → Text slots: routes requests
src/genie_server/app.py - FastAPI routes → Generation engine: runs generation
src/genie_server/app.py - FastAPI routes → Grammar decoding: parses constraints
src/genie_server/app.py - FastAPI routes → Logprob scoring: scores prompts
src/genie_server/app.py - FastAPI routes → VLM slot pipeline: routes multimodal
README.md - Server config → Startup wiring: configures startup
src/genie_server/bootstrap.py - Startup wiring → Text slots: loads slots
src/genie_server/bootstrap.py - Startup wiring → VLM slot pipeline: creates VLM slots
src/genie_server/bootstrap.py - Startup wiring → Prefix KV cache: creates cache
src/genie_server/bootstrap.py - Text slots → Model bundles: loads model
README.md - Text slots → Genie C bindings: creates dialogs
src/genie_server/slots.py - FastAPI routes → Chat templates: prepares prompts
src/genie_server/app.py - Chat templates → Tool dialects: formats declarations
src/genie_server/templates.py - Tool dialects → Tool parsing: parses calls
src/genie_server/tool_formats.py - Generation engine → Text slots: queries slot
src/genie_server/engine.py - Generation engine → Genie C bindings: calls query
src/genie_server/engine.py - Generation engine → Grammar decoding: applies grammar
src/genie_server/engine.py - Generation engine → Prefix KV cache: warms cache
src/genie_server/engine.py - Genie C bindings → Genie SDK: invokes C API
README.md - FastAPI routes → SDK profiling: serves profiling
README.md - SDK profiling → Genie SDK: reads SDK metrics
README.md - VLM slot pipeline → Bundle layout: resolves bundle
src/genie_server/vlm.py - VLM slot pipeline → VLM family specs: binds family
src/genie_server/vlm.py - VLM family specs → Qwen3-VL spec: specializes Qwen
src/genie_server/vlm_specs/qwen3_vl.py - VLM slot pipeline → Genie node API: builds pipeline
src/genie_server/vlm.py - Genie node API → Genie SDK: calls node API
README.md