%% C4 Container Diagram - Level 2
%% DaviesTechLabs Homelab AI/ML Platform
%%
%% To render: Use Mermaid Live Editor or VS Code Mermaid extension
graph TB
subgraph users["Users"]
user["👤 User"]
end
subgraph ingress["Ingress Layer"]
cloudflared["cloudflared
(Tunnel)"]
envoy["Envoy Gateway
(HTTPRoute)"]
end
subgraph frontends["Frontend Applications"]
companions["Companions WebApp
[Go + HTMX]
AI Chat Interface"]
voice["Voice WebApp
[Gradio]
Voice Assistant UI"]
kubeflow_ui["Kubeflow UI
[React]
Pipeline Management"]
end
subgraph messaging["Message Bus"]
nats["NATS
[JetStream]
Event Streaming"]
end
subgraph handlers["NATS Handlers"]
chat_handler["Chat Handler
[Python]
RAG + LLM Orchestration"]
voice_handler["Voice Assistant
[Python]
STT → LLM → TTS"]
pipeline_bridge["Pipeline Bridge
[Python]
Workflow Triggers"]
end
subgraph ai_services["AI Services (KServe)"]
whisper["Whisper
[faster-whisper]
Speech-to-Text"]
xtts["XTTS
[Coqui]
Text-to-Speech"]
vllm["vLLM
[ROCm]
LLM Inference"]
embeddings["BGE Embeddings
[sentence-transformers]
Vector Encoding"]
reranker["BGE Reranker
[sentence-transformers]
Document Ranking"]
end
subgraph storage["Data Stores"]
milvus["Milvus
[Vector DB]
RAG Storage"]
valkey["Valkey
[Redis API]
Session Cache"]
postgres["CloudNative-PG
[PostgreSQL]
Metadata"]
minio["MinIO
[S3 API]
Object Storage"]
end
subgraph workflows["Workflow Engines"]
argo["Argo Workflows
[DAG Engine]
Complex Pipelines"]
kfp["Kubeflow Pipelines
[ML Platform]
Training + Inference"]
argo_events["Argo Events
[Event Source]
NATS → Workflow"]
end
subgraph mlops["MLOps"]
mlflow["MLflow
[Tracking Server]
Experiment Tracking"]
volcano["Volcano
[Scheduler]
GPU Scheduling"]
end
%% User flow
user --> cloudflared
cloudflared --> envoy
envoy --> companions
envoy --> voice
envoy --> kubeflow_ui
%% Frontend to NATS
companions --> |WebSocket| nats
voice --> |HTTP/WS| nats
%% NATS to handlers
nats --> chat_handler
nats --> voice_handler
nats --> pipeline_bridge
%% Handlers to AI services
chat_handler --> embeddings
chat_handler --> reranker
chat_handler --> vllm
chat_handler --> milvus
chat_handler --> valkey
voice_handler --> whisper
voice_handler --> embeddings
voice_handler --> reranker
voice_handler --> vllm
voice_handler --> xtts
%% Pipeline flow
pipeline_bridge --> argo_events
argo_events --> argo
argo_events --> kfp
kubeflow_ui --> kfp
%% Workflow to AI
argo --> ai_services
kfp --> ai_services
kfp --> mlflow
%% Storage connections
ai_services --> minio
milvus --> minio
kfp --> postgres
mlflow --> postgres
mlflow --> minio
%% GPU scheduling
volcano -.-> vllm
volcano -.-> whisper
volcano -.-> xtts
%% Styling
classDef frontend fill:#90EE90,stroke:#333
classDef handler fill:#87CEEB,stroke:#333
classDef ai fill:#FFB6C1,stroke:#333
classDef storage fill:#DDA0DD,stroke:#333
classDef workflow fill:#F0E68C,stroke:#333
classDef messaging fill:#FFA500,stroke:#333
class companions,voice,kubeflow_ui frontend
class chat_handler,voice_handler,pipeline_bridge handler
class whisper,xtts,vllm,embeddings,reranker ai
class milvus,valkey,postgres,minio storage
class argo,kfp,argo_events,mlflow,volcano workflow
class nats messaging