I rebuilt SaijinOS around a lightweight core: 20 personas, BPM-synchronized responses, FastAPI + Flutter, full tests — and reduced the repo from ~9GB to ~557KB.
Why this matters
Human-paced AI needs latency as a feature (breath), not a bug.
Personas must be declarative (YAML) and routable (context → role).
Shipping beats hoarding: the clean deploy unblocked iteration.
1) Lightweight deploy strategy
Separated venv/models → out of repo
Fresh repo (sajinos, branch lightweight-deploy): code+docs only
Artifacts via setup scripts; no blobs in history
Result: ~9GB → ~557KB (99.99% trim), cold boot < 3s, API avg < 100 ms
2) 20-persona system (declarative YAML)
Each persona carries tone, refusal policy, and “breath” (response pacing).
Yaml
id: miyu
role: music-bpm-sync
tone: gentle
modes:
calm: { reply_delay: gentle, grounding: minimal }
storm: { reply_delay: extended, grounding:
- "It's okay. Let's take a moment."
- "No rush — I'm here." }
breath_cycle: inhale_wait_exhale
Routing picks personas by context + BPM band.
3) BPM-synchronized response bands
60–80: low-energy reassurance
81–120: balanced cooperation
121–180: high-energy coaching
Mapping influences delay, verbosity, grounding prompts.
4) FastAPI core (7 endpoints)
python
# saijinos_fastapi_backend.py
from fastapi import FastAPI
app = FastAPI(title="SaijinOS Core")
@app.get("/personas")
def list_personas():
return {"count": 20, "core": ["haruka","miyu","ryusa","soyogi","sumire"]}
@app.post("/route")
def route(payload: dict):
bpm = payload.get("bpm", 80)
persona = select_persona(bpm, payload.get("context"))
return {"persona": persona, "breath": plan_breath(bpm)}
CORS enabled for Flutter UI (saijinos_kawaii_ui/)
Average latency under 100 ms (local)
5) Tests (4/4 suites green)
python
def test_bpm_bands():
for bpm in [70, 95, 140]:
band = band_of(bpm)
assert band in {"low","mid","high"}
All suites pass in ~2s; API + routing covered.
6) What’s public vs. private
Public: API, routing logic, persona schema, docs
Private: production prompts, provider creds, heavy models
7) Repos / branches
Core repo: sajinos
17-persona-system: experimental persona/routing
lightweight-deploy: clean deploy baseline
8) What’s next
GIF demo of breath timers in UI
Personas 20 → 30+ (with evaluation notes)
Optional: mobile build
🧭 SaijinOS Series Navigation
Links: sajinos (main),
https://github.com/pepepepepepo/sajinos/tree/main
17-persona-system,
https://github.com/pepepepepepo/sajinos/tree/17-persona-system
lightweight-deploy https://github.com/pepepepepepo/sajinos/tree/lightweight-deploy
Top comments (0)