HERMES + OiMy — Full End-to-End Flow

How the iOS app, on-device model, HERMES server, and LLMs work together

📱
On-Device (iPhone 16+)
1 SwiftUI Chat App
Watercolor UI · Vintage design
Chat bubbles · Quick-action chips
Voice mic input · Typing indicator
Download screen (lazy model load)
Always present
2 LiteRT-LM · Gemma 4 E4B
Downloaded once on first launch
Source: cdn.oimyai.com (3.66 GB)
Format: .litertlm (single file)
Backend: Metal GPU (iPhone)
Speed: ~25 tok/s · MTP 2.2× speedup
Context: 8,192 tokens working budget
On-device inference 3.66 GB download
3 Intent Router (Layer 1)
Runs on-device via LiteRT-LM
temp=0 · suppress thinking token
~200 token prompt · 3–5 token output
Returns: { skill_id, confidence }
81 skills · 95% accuracy (tested)
Every message, ~200ms
confidence: high / low ?
4 On-Device Storage
SwiftData / SQLite
· Chat history (rolling 6 turns in context)
· Deep Profile snapshot (compressed, ~300 tok)
· Skillify scripts (zero-token action cache)
· learnings.jsonl (entity extractions)
· Session state + pending tasks
Private · Never leaves device*

Context Assembled Per Message
system: "You are OiMy, family AI…"
profile: compressed deep profile (~300 tok)
skill: active skill instructions (~150 tok)
history: last 6 turns (~1,000 tok)
user: current message (~100 tok)
——————————————————————
Total ≈ 1,750 tok / 8,192 budget
POST /chat
skill_id +
message
response
+ entities
🚀
HERMES Server Cluster (Hetzner · 116.203.107.13)
A HERMES Agent Gateway
92K★ TypeScript engine · Compiled binary
Telegram routing → user profile lookup
Powers all OiMy users from a single cluster
Stateless per-request → scales infinitely
Replaces OpenClaw containers
B Hybrid gBrain Network
PRIVATE: Per-user SQLite (name, family, calendar)
COMMUNITY: Global anonymized patterns (opt-in)
· "78% of parents with 6-year-olds struggle with bedtime"
· "Screen time peaks 4–6 PM weekdays"
Differential privacy + user-controlled opt-in
Opt-in for better guidance Off by default
C Skill Engine API
POST /chat · GET /health · POST /reset
Receives: { message, skill_id, user_id }
Returns: { archetype.message, entities }
Streams via SSE when available
Identical logic to OpenClaw version
github: aahalife/oimy-skill-engine
D LLM Routing Options
Choose one:
Option 1: OpenRouter API
Claude Sonnet, Opus, DeepSeek etc.
Option 2: Self-hosted Ollama
Gemma 4 27B, 31B, Cactus E4B on GPU
Option 3: Direct API
DeepSeek V4 Flash, Qwen 3 8B direct
E Data Storage
Neon PostgreSQL — user profiles, settings
GBrain — knowledge graph, hybrid search
Skill Engine DB — learnings.db, deep profile
Ollama DB — cached model responses

Backups — daily encrypted offsite
Purging — 30-day retention by default
Secure · Encrypted
Message Flow — Step by Step
① USER TYPES
SwiftUI captures message · assembles context (profile + history) · sends to LiteRT-LM
② ON-DEVICE ROUTE
Gemma 4 E4B classifies intent in ~200ms · returns skill_id + confidence · zero server cost
③ DECISION FORK
Action skill + codified? → Skillify script (0 tokens, 200ms). Complex/low-conf → POST to server
④ HERMES: ROUTE TO SKILL
HERMES calls Skill Engine API → gets archetype workflow → executes with community-boosted logic
⑤ SERVER EXECUTION
Archetype runs → calls chosen LLM tier → returns structured response + learnings
⑥ RESPONSE + LEARN
Response returns to app · entities extracted · learnings.jsonl updated · profile synced
✅ VALUE HERMES ADDS
Ops Reduction: 80+ containers → 1 cluster • Cost Savings: 60–80% less compute • Security: Compiled TypeScript > dynamic imports • Consistency: Global truth for archetypes & workflows • Cross-Learning: Opt-in community patterns enhance guidance • New Capabilities: Persistent browser, self-hosted Ollama • Proactive Care: Dream cycle finds silent needs • Privacy: Differential privacy + opt-in only
On-device (iPhone)
HERMES Server
On-device LLM
Cloud LLM (paid)
Local storage
Community patterns
* profile syncs to server every 5 min for cross-device memory
HERMES + OiMy End-to-End · May 2026 · hermes.oimyai.com