fix: model disposal, roles, incremental builds, docs reorg#94
Conversation
Add disposeModel() that releases ONNX sessions between model loads. loadModel() now auto-disposes when switching models, and the embedding benchmark calls disposeModel() after each iteration to prevent OOM when running large models like bge-large after smaller ones. Impact: 2 functions changed, 7 affected
|
Claude finished @carlos-alm's task —— View job PR Review Complete ✅Conducted comprehensive review of PR #94 following strict 4-phase methodology: Review Results
Root Cause Analysis ✅Problem Being Solved: Real OOM (Out of Memory) issue in embedding benchmark where running large models (bge-large) after smaller ones causes memory exhaustion due to ONNX session accumulation. Why This Approach: The fix implements proper resource management by adding Risk Assessment: Low risk - Clean, focused fix with no side effects. Only adds cleanup functionality. Critical ConcernsNone identified - This is an exemplary fix addressing a real technical problem with proper implementation. Code Quality Highlights
Final Recommendation
Summary: Perfect fix for ONNX memory leaks. Clean implementation, zero concerns, ready to merge. |
Greptile SummaryAdded All changes are straightforward and focused on memory management. The implementation follows best practices: null-checks before disposal, clearing both the extractor and activeModel state, and proper integration into the existing model loading flow. Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 383e899 |
Summary
disposeModel()to embedder that releases ONNX sessions between model loads, preventing OOM in the embedding benchmark when running large models (bge-large) after smaller ones.loadModel()now auto-disposes on model switch.rolescommand classifying nodes as entry/core/utility/adapter/dead/leaf based on graph topology.docs/guides/, roadmap todocs/roadmap/, fix broken links.--jsonto search,--fileglob filter,--excludeto prune, exclude worktrees from vitest.Test plan
npm test)npm run lint)disposeModel()loads, embeds, and disposes without error