# goodluck-hojae/kalypso architecture

> Architecture diagram of the GitHub repository goodluck-hojae/kalypso, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/goodluck-hojae/kalypso
- Repository: https://github.com/goodluck-hojae/kalypso

## Overview

Kalypso adds semantic query processing to vLLM: clients submit relational queries, which are processed into semantic operators and executed as memory-aware pipelines that can reuse KV-cache state. The repository also supports ICP retrieval and cascade/proxy filtering, alongside vLLM’s model-serving and pooling APIs. Kalypso’s indexed source references clarify several internal calls; other links are included only where the README documents them. Unsampled integrations and runtime wiring are not inferred.

Main entry points: [`vllm/kalypso/query_processor.py`](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/query_processor.py) (Query Processor), [`vllm/kalypso/execution/pipeline_execution.py`](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/execution/pipeline_execution.py) (Pipeline Execution), [`vllm/kalypso/controller/pipeline.py`](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/controller/pipeline.py) (Pipeline Controller), [`vllm/kalypso/execution/vllm_executor.py`](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/execution/vllm_executor.py) (vLLM Executor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Serving APIs"]
  node_api_server["API Server<br/>[api_server.py]"]
  node_serving["Request Serving<br/>[serving_engine.py]"]
  node_protocol["OpenAI Protocol<br/>[protocol.py]"]
  node_pooling["Pooling APIs<br/>[serving.py]"]
end

subgraph group_query["Query Processing"]
  node_query_processor["Query Processor<br/>[query_processor.py]"]
  node_query["Query Model<br/>[query.py]"]
  node_sem_ops["Semantic Operators<br/>[ops.py]"]
  node_controller["Pipeline Controller<br/>[pipeline.py]"]
end

subgraph group_execution["Pipeline Execution"]
  node_pipeline_execution["Pipeline Execution"]
  node_executor["vLLM Executor<br/>[vllm_executor.py]"]
  node_llm_engine["LLM Engine<br/>[llm_engine.py]"]
  node_model_config["Engine Configuration<br/>[vllm.py]"]
end

subgraph group_state["Cache and Budget"]
  node_budget["Memory Budget<br/>[budget.py]"]
  node_context["Execution Context<br/>[context.py]"]
  node_pin_registry["Pin Registry<br/>[pin_registry.py]"]
  node_cache_manager["KV Cache Manager"]
  node_cache_specs["KV Cache Specs"]
end

subgraph group_integrations["Retrieval Integrations"]
  node_icp_service["ICP Retrieval Service<br/>[vector_service.py]"]
  node_colbert["ColBERT Wrapper<br/>[colbert_wiki.py]"]
  node_cascade["Cascade Proxy"]
end

node_client(("Query Client"))

node_client -.->|"submits requests"| node_api_server
node_api_server -.->|"serves requests"| node_serving
node_serving -->|"parses requests"| node_protocol
node_client -.->|"submits semantic query"| node_query_processor
node_query_processor -->|"uses query"| node_query
node_query_processor -->|"invokes controller"| node_controller
node_controller -->|"builds operators"| node_sem_ops
node_controller -->|"uses budget"| node_budget
node_query_processor -->|"invokes executor"| node_executor
node_executor -.->|"executes pipeline"| node_pipeline_execution
node_pipeline_execution -->|"uses operators"| node_sem_ops
node_pipeline_execution -->|"uses budget"| node_budget
node_pipeline_execution -->|"uses context"| node_context
node_executor -.->|"runs inference"| node_llm_engine
node_llm_engine -->|"configures engine"| node_model_config
node_pipeline_execution -.->|"reuses KV cache"| node_cache_manager
node_cache_manager -->|"uses cache specs"| node_cache_specs
node_query_processor -->|"uses pin registry"| node_pin_registry
node_client -.->|"requests retrieval"| node_icp_service
node_icp_service -.->|"supports ColBERT"| node_colbert
node_client -.->|"configures proxy"| node_cascade

click node_api_server "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/entrypoints/openai/api_server.py"
click node_serving "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/entrypoints/openai/serving_engine.py"
click node_protocol "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/entrypoints/openai/protocol.py"
click node_pooling "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/entrypoints/pooling/embed/serving.py"
click node_query_processor "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/query_processor.py"
click node_query "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/query.py"
click node_sem_ops "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/sem_ops/ops.py"
click node_controller "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/controller/pipeline.py"
click node_pipeline_execution "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/execution/pipeline_execution.py"
click node_executor "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/execution/vllm_executor.py"
click node_llm_engine "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/v1/engine/llm_engine.py"
click node_model_config "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/config/vllm.py"
click node_budget "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/budget.py"
click node_context "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/context/context.py"
click node_pin_registry "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/pin_registry.py"
click node_cache_manager "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/v1/core/kv_cache_manager.py"
click node_cache_specs "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/v1/kv_cache_interface.py"
click node_icp_service "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/icp/vector_service.py"
click node_colbert "https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/icp/colbert_wiki.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api_server,node_serving,node_protocol,node_pooling,node_client toneBlue
class node_query_processor,node_query,node_sem_ops,node_controller toneAmber
class node_pipeline_execution,node_executor,node_llm_engine,node_model_config toneMint
class node_budget,node_context,node_pin_registry,node_cache_manager,node_cache_specs toneRose
class node_icp_service,node_colbert,node_cascade toneIndigo
```

## Components

### Serving APIs

- [API Server](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/entrypoints/openai/api_server.py): `vllm/entrypoints/openai/api_server.py`
- [Request Serving](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/entrypoints/openai/serving_engine.py): `vllm/entrypoints/openai/serving_engine.py`
- [OpenAI Protocol](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/entrypoints/openai/protocol.py): `vllm/entrypoints/openai/protocol.py`
- [Pooling APIs](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/entrypoints/pooling/embed/serving.py): `vllm/entrypoints/pooling/embed/serving.py`

### Query Processing

- [Query Processor](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/query_processor.py): `vllm/kalypso/query_processor.py`
- [Query Model](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/query.py): `vllm/kalypso/query.py`
- [Semantic Operators](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/sem_ops/ops.py): `vllm/kalypso/sem_ops/ops.py`
- [Pipeline Controller](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/controller/pipeline.py): `vllm/kalypso/controller/pipeline.py`

### Pipeline Execution

- [Pipeline Execution](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/execution/pipeline_execution.py): `vllm/kalypso/execution/pipeline_execution.py`
- [vLLM Executor](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/execution/vllm_executor.py): `vllm/kalypso/execution/vllm_executor.py`
- [LLM Engine](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/v1/engine/llm_engine.py): `vllm/v1/engine/llm_engine.py`
- [Engine Configuration](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/config/vllm.py): `vllm/config/vllm.py`

### Cache and Budget

- [Memory Budget](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/budget.py): `vllm/kalypso/budget.py`
- [Execution Context](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/context/context.py): `vllm/kalypso/context/context.py`
- [Pin Registry](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/pin_registry.py): `vllm/kalypso/pin_registry.py`
- [KV Cache Manager](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/v1/core/kv_cache_manager.py): `vllm/v1/core/kv_cache_manager.py`
- [KV Cache Specs](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/v1/kv_cache_interface.py): `vllm/v1/kv_cache_interface.py`

### Retrieval Integrations

- [ICP Retrieval Service](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/icp/vector_service.py): `vllm/kalypso/icp/vector_service.py`
- [ColBERT Wrapper](https://github.com/goodluck-hojae/kalypso/blob/main/vllm/kalypso/icp/colbert_wiki.py): `vllm/kalypso/icp/colbert_wiki.py`
- **Cascade Proxy**

### Other components

- **Query Client**

## Connections

- Query Client → API Server: submits requests
- API Server → Request Serving: serves requests
- Request Serving → OpenAI Protocol: parses requests (evidence: `vllm/entrypoints/openai/serving_engine.py`)
- Query Client → Query Processor: submits semantic query
- Query Processor → Query Model: uses query (evidence: `vllm/kalypso/query_processor.py`)
- Query Processor → Pipeline Controller: invokes controller (evidence: `vllm/kalypso/query_processor.py`)
- Pipeline Controller → Semantic Operators: builds operators (evidence: `vllm/kalypso/controller/pipeline.py`)
- Pipeline Controller → Memory Budget: uses budget (evidence: `vllm/kalypso/controller/pipeline.py`)
- Query Processor → vLLM Executor: invokes executor (evidence: `vllm/kalypso/query_processor.py`)
- vLLM Executor → Pipeline Execution: executes pipeline
- Pipeline Execution → Semantic Operators: uses operators (evidence: `vllm/kalypso/execution/pipeline_execution.py`)
- Pipeline Execution → Memory Budget: uses budget (evidence: `vllm/kalypso/execution/pipeline_execution.py`)
- Pipeline Execution → Execution Context: uses context (evidence: `vllm/kalypso/execution/pipeline_execution.py`)
- vLLM Executor → LLM Engine: runs inference
- LLM Engine → Engine Configuration: configures engine (evidence: `vllm/v1/engine/llm_engine.py`)
- Pipeline Execution → KV Cache Manager: reuses KV cache
- KV Cache Manager → KV Cache Specs: uses cache specs (evidence: `vllm/v1/core/kv_cache_manager.py`)
- Query Processor → Pin Registry: uses pin registry (evidence: `vllm/kalypso/query_processor.py`)
- Query Client → ICP Retrieval Service: requests retrieval
- ICP Retrieval Service → ColBERT Wrapper: supports ColBERT
- Query Client → Cascade Proxy: configures proxy
