feat: add comprehensive architecture documentation
- Add AGENT-ONBOARDING.md for AI agents - Add ARCHITECTURE.md with full system overview - Add TECH-STACK.md with complete technology inventory - Add DOMAIN-MODEL.md with entities and bounded contexts - Add CODING-CONVENTIONS.md with patterns and practices - Add GLOSSARY.md with terminology reference - Add C4 diagrams (Context and Container levels) - Add 10 ADRs documenting key decisions: - Talos Linux, NATS, MessagePack, Multi-GPU strategy - GitOps with Flux, KServe, Milvus, Dual workflow engines - Envoy Gateway - Add specs directory with JetStream configuration - Add diagrams for GPU allocation and data flows Based on analysis of homelab-k8s2 and llm-workflows repositories and kubectl cluster-info dump data.
This commit is contained in:
123
CONTAINER-DIAGRAM.mmd
Normal file
123
CONTAINER-DIAGRAM.mmd
Normal file
@@ -0,0 +1,123 @@
|
||||
%% 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<br/>(Tunnel)"]
|
||||
envoy["Envoy Gateway<br/>(HTTPRoute)"]
|
||||
end
|
||||
|
||||
subgraph frontends["Frontend Applications"]
|
||||
companions["Companions WebApp<br/>[Go + HTMX]<br/>AI Chat Interface"]
|
||||
voice["Voice WebApp<br/>[Gradio]<br/>Voice Assistant UI"]
|
||||
kubeflow_ui["Kubeflow UI<br/>[React]<br/>Pipeline Management"]
|
||||
end
|
||||
|
||||
subgraph messaging["Message Bus"]
|
||||
nats["NATS<br/>[JetStream]<br/>Event Streaming"]
|
||||
end
|
||||
|
||||
subgraph handlers["NATS Handlers"]
|
||||
chat_handler["Chat Handler<br/>[Python]<br/>RAG + LLM Orchestration"]
|
||||
voice_handler["Voice Assistant<br/>[Python]<br/>STT → LLM → TTS"]
|
||||
pipeline_bridge["Pipeline Bridge<br/>[Python]<br/>Workflow Triggers"]
|
||||
end
|
||||
|
||||
subgraph ai_services["AI Services (KServe)"]
|
||||
whisper["Whisper<br/>[faster-whisper]<br/>Speech-to-Text"]
|
||||
xtts["XTTS<br/>[Coqui]<br/>Text-to-Speech"]
|
||||
vllm["vLLM<br/>[ROCm]<br/>LLM Inference"]
|
||||
embeddings["BGE Embeddings<br/>[sentence-transformers]<br/>Vector Encoding"]
|
||||
reranker["BGE Reranker<br/>[sentence-transformers]<br/>Document Ranking"]
|
||||
end
|
||||
|
||||
subgraph storage["Data Stores"]
|
||||
milvus["Milvus<br/>[Vector DB]<br/>RAG Storage"]
|
||||
valkey["Valkey<br/>[Redis API]<br/>Session Cache"]
|
||||
postgres["CloudNative-PG<br/>[PostgreSQL]<br/>Metadata"]
|
||||
minio["MinIO<br/>[S3 API]<br/>Object Storage"]
|
||||
end
|
||||
|
||||
subgraph workflows["Workflow Engines"]
|
||||
argo["Argo Workflows<br/>[DAG Engine]<br/>Complex Pipelines"]
|
||||
kfp["Kubeflow Pipelines<br/>[ML Platform]<br/>Training + Inference"]
|
||||
argo_events["Argo Events<br/>[Event Source]<br/>NATS → Workflow"]
|
||||
end
|
||||
|
||||
subgraph mlops["MLOps"]
|
||||
mlflow["MLflow<br/>[Tracking Server]<br/>Experiment Tracking"]
|
||||
volcano["Volcano<br/>[Scheduler]<br/>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
|
||||
Reference in New Issue
Block a user