Created: 2026-03-31 Phase: 5 of 6 Branch: development Status: IN PROGRESS
Single codebase, all platforms. ThoughtForge running on phone (Termux/Android), Raspberry Pi (Pi Zero + Pi 5), desktop (Linux/macOS/Windows), and in Docker. Plus ONNX embedding export for edge devices and knowledge subset tooling for memory-constrained targets.
| File | Status |
|---|---|
TASK_PHASE5_DEPLOYMENT.md |
✅ (this file) |
Dockerfile |
✅ |
docker-compose.yml |
✅ |
.dockerignore |
✅ |
scripts/install_linux.sh |
✅ |
scripts/install_mac.sh |
✅ |
scripts/install_windows.ps1 |
✅ |
scripts/install_termux.sh |
✅ |
scripts/install_pi.sh |
✅ |
src/thoughtforge/inference/onnx_export.py |
✅ |
src/thoughtforge/etl/subset.py |
✅ |
tests/test_phase5_deployment.py |
✅ |
OnnxExporter— exports sentence-transformer embedding model to ONNX formatexport_embedder(model_name, output_dir, quantize=False) -> Path- Uses
optimum.exporters.onnxif available, falls back totorch.onnx - Graceful
ImportErrorwith install hint if neither available
ONNXEmbedder— ONNX-based embedding inference__init__(model_dir)— loads tokenizer + ONNX sessionencode(texts, batch_size=32) -> np.ndarray- Drop-in replacement for sentence-transformers on edge devices
EdgeSubsetBuilder— builds reduced knowledge DB for edge profilesbuild(source_db, output_path, profile_id, max_entities=None) -> SubsetResult- Reads profile JSON to get default entity limit
- Copies top-N entities by popularity_score from source DB
- Copies associated statements, reference chunks, FTS rows
- Returns
SubsetResultwith counts + output path
Dockerfile— multi-stage Python 3.11-slim, profile via--build-arg PROFILE=desktop_cpudocker-compose.yml— named services: thoughtforge-desktop, thoughtforge-pi, thoughtforge-phone.dockerignore— excludes data/, docs/, .git/, *.jsonl, *.gzscripts/install_*.sh|.ps1— one-command platform setup scripts
TestONNXExporterAPI— OnnxExporter/ONNXEmbedder method signatures, graceful import handlingTestEdgeSubsetBuilder— SubsetResult dataclass, profile parsing, method signaturesTestDeploymentFiles— Dockerfile/docker-compose/scripts exist and contain required directivesTestHardwareProfileDeployment— all 6 profiles have validdeploymentsectionTestInstallScriptContent— scripts contain required install commands for each platform
Phase 5 adds zero new Python runtime dependencies — all new modules have
graceful fallbacks for optimum and onnxruntime (edge-only optional deps).
The 238 existing tests continue to pass unmodified.
Testing, Benchmarking, Personality Layer + v1.0 Release.