How k-ashix/edu-babu works
Edu Babu is a local-first AI study companion. Its main workflow takes a student’s question from the chat composer through app-state coordination and prompt construction, routes generation to on-device, paired-runtime, or cloud compute, then streams the answer into the chat UI. Chat history is stored locally. The README also describes model management, PDF export, math and Mermaid rendering, and encrypted storage. Connections for unsampled Dart subsystems follow documented README relationships; the native bridge is shown only where its excerpt identifies the Dart FFI consumer.
Main entry points: app_state_send_entry_controller.dart App state · router Generation routing · chat_screen.dart Chat UI · edu_babu_composer.dart Chat composer
Components 18
Chat workflow
- Chat composer
lib/features/chat/composer/edu_babu_composer.dart - App state
lib/app/app_state_send_entry_controller.dart - Chat UI
lib/features/chat/presentation/chat_screen.dart
Prompt and generation
- Prompt framework
lib/features/chat/prompting - Generation routing
lib/services/generation/router
Compute backends
- Llama FFI
lib/services/inference/llama_ffi_bridge.dart - llama.cpp bridge
android/app/src/main/cpp/llama_bridge.cpp - Paired runtime
lib/features/runtime - Cloud API
lib/services/generation/transport - GGUF model
Local data
- Drift database
lib/data/local/db/app_database.dart - Chat repository
lib/features/chat/data/drift_chat_repository.dart
Study features
- Offline models
lib/features/offline_models - Rich response rendering
lib/features/chat/presentation/rendering - PDF export
lib/features/export
Other components
- Student
- Paired PC
- Cloud provider
Connections 17
- Student → Chat composer: asks question
README.md - Chat composer → App state: sends query
README.md - App state → Prompt framework: builds prompt
README.md - App state → Generation routing: routes generation
README.md - Generation routing → Llama FFI: selects backend
README.md - Generation routing → Paired runtime: selects backend
README.md - Generation routing → Cloud API: selects backend
README.md - Llama FFI → llama.cpp bridge: calls FFI
android/app/src/main/cpp/llama_bridge.cpp - llama.cpp bridge → GGUF model: loads and infers
android/app/src/main/cpp/llama_bridge.cpp - Paired runtime → Paired PC: offloads inference
README.md - Cloud API → Cloud provider: requests inference
README.md - Generation routing → Chat UI: streams answer
README.md - App state → Chat repository: persists chat
README.md - Chat repository → Drift database: reads and writes
README.md - App state → Offline models: manages models
README.md - Chat UI → Rich response rendering: renders response
README.md - Chat UI → PDF export: exports chat
README.md