Humanoid-HRI-SmolFusion
Asynchronous fusion architecture for real-time multimodal HRI — the architecture decides latency, not the model.
실시간 멀티모달 HRI를 위한 비동기 퓨전 아키텍처 — 지연을 결정하는 건 모델이 아니라 구조다
Role · System architect — async fusion design, 4-way deployment matrix, ring-buffer memory, conditional RAG.
Key Metrics
Why it matters
Four deployment targets, one codebase: RTX 5080 server (0.7s, 82% QA) vs Jetson llama.cpp (1.8s, 67% QA, offline). Quantified the server↔edge trade-off so deployment is a conscious choice, not a guess.
4가지 배포 타깃, 코드베이스 1개. RTX 5080 서버(0.7s, QA 82%) vs Jetson llama.cpp(1.8s, QA 67%, 오프라인). 서버↔엣지 트레이드오프를 수치화해 배포가 추측이 아닌 의식적 선택이 되도록 했습니다.
Problem
In humanoid HRI, image, speech, and text arrive concurrently on different inference paths. Recurring failures were system-level: data silos between modalities, one slow path blocking the event loop, an architecture that works on an RTX 5080 server but breaks on a Jetson. I ran a 4-way deployment matrix (Server/Edge × GPU/llama.cpp) to quantify trade-offs: server GPU = 0.7s / 82% QA / 4.2GB; Jetson llama.cpp = 1.8s / 67% QA / 1.1GB / offline-capable. Holding one codebase across all four cases required making the architecture invariant and swapping only model + optimization.
이미지·음성·텍스트가 서로 다른 추론 경로에 동시에 도착합니다. 반복되는 실패는 시스템 차원이었습니다. 4-way 배포 매트릭스(서버/엣지 × GPU/llama.cpp)로 트레이드오프를 수치화: 서버 GPU = 0.7s/QA82%/4.2GB, Jetson llama.cpp = 1.8s/QA67%/1.1GB/오프라인. 코드베이스 1개로 4가지 타깃을 커버하기 위해 아키텍처를 불변으로 두고 모델·최적화만 교체했습니다.
What I built
3-tier microservices: API Gateway (FastAPI :8000, routing only) → LLM server (:8080) + VLM server (:8081, SmolVLM) + TTS (on-device)
3-tier 마이크로서비스: API 게이트웨이(FastAPI :8000, 라우팅만) → LLM 서버(:8080) + VLM 서버(:8081, SmolVLM) + TTS(온디바이스)
4-way deployment matrix: Server GPU (0.7s/82%QA/4.2GB) · Server llama.cpp (1.1s/78%/1.5GB) · Jetson→Server (0.8s/82%) · Jetson llama.cpp (1.8s/67%/1.1GB/offline)
4-way 배포 매트릭스: 서버 GPU(0.7s/82%/4.2GB) · 서버 llama.cpp(1.1s/78%/1.5GB) · Jetson→서버(0.8s/82%) · Jetson llama.cpp(1.8s/67%/1.1GB/오프라인)
Async ASGI pipeline: non-blocking multimodal inference — concurrent image/speech/text paths never block each other
비동기 ASGI 파이프라인: 멀티모달 추론 비블로킹 — 이미지/음성/텍스트 경로가 서로 블로킹하지 않음
Conditional hybrid RAG: FAISS (dense) + BM25 (sparse) — embedding cache (−35% latency), top-k=3, summarized injection — 7.2GB → 4.1GB on Jetson
조건부 하이브리드 RAG: FAISS(밀집)+BM25(희소) — 임베딩 캐시(지연 −35%), top-k=3, 요약 주입 — Jetson 7.2GB→4.1GB
Ring-buffer session memory: fixed-length deque per session — deterministic footprint, leak-free under long-running multi-user load
링버퍼 세션 메모리: 세션별 고정 길이 deque — 결정론적 풋프린트, 장시간 다중 사용자 환경에서 leak-free
Cold-start optimization: lazy loading + model caching — 1.7s → 0.8s warm response
콜드스타트 최적화: 레이지 로딩 + 모델 캐싱 — 1.7s → 0.8s 웜 응답
Key Decisions (trade-offs)
Abstraction over code-branching — 4-way matrix validated
Per-environment code forks drift apart. Architecture stays fixed; model + optimization layer swaps per target. Result: server GPU (0.7s, 82% QA, 4.2GB) vs Jetson/llama.cpp (1.8s, 67% QA, 1.1GB, offline). Cold-start drops from 1.7s to 0.8s via lazy loading + caching.
아키텍처 고정, 모델·최적화만 교체. 결과: 서버 GPU(0.7s, QA82%) vs Jetson llama.cpp(1.8s, QA67%, 오프라인). 레이지 로딩+캐싱으로 콜드스타트 1.7s→0.8s.
Ring-buffer memory over TTL expiry
TTL-based context grows unbounded under load. Fixed-length per-session ring buffer caps memory deterministically — leak-free under long-running, multi-user load.
TTL 기반 컨텍스트는 부하 시 무한정 늘고 누수됩니다. 세션별 고정 길이 링버퍼로 메모리를 결정론적으로 상한 — 장시간·다중 사용자 부하에서 leak-free.
Conditional RAG — 7.2 GB → 4.1 GB on Jetson
Unbounded FAISS+BM25 RAG pushed Jetson memory to 7.2GB. Embedding cache (−35% search latency) + top-k=3 + summarized injection brought it to 4.1GB. RAG fires only for knowledge queries — casual turns skip it entirely.
무제한 RAG는 Jetson 메모리를 7.2GB까지 밀어올렸습니다. 임베딩 캐시(검색 지연 −35%) + top-k=3 + 요약 주입으로 4.1GB까지 낮추고, 지식 질의에만 RAG를 발화하도록 조건화했습니다.