[GH-ISSUE #5403] [Feature Request] Dynamic Model Unloading & Context-Swapping for Heavy Processes #3224

Open
opened 2026-11-07 14:39:00 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @tailot on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5403

Problem

Running resource-intensive tasks (builds, migrations, scripts) alongside a primary LLM in Strata often saturates the VRAM, causing OOM errors or preventing lightweight helper tasks from running efficiently.

Proposed Solution

Implement native lifecycle endpoints (e.g., POST /v1/models/unload and POST /v1/models/load) to allow automated memory management during heavy operations:

  1. Save Checkpoint: Serialize agent session state.
  2. Unload: Free VRAM by unloading the primary model before execution.
  3. Execute & Monitor: Run the process asynchronously, capturing stdout/stderr and filtering critical logs without bloating the main context.
  4. Reload: Restore the primary model and inject a structured JSON execution summary upon completion.

Benefits

  • VRAM Efficiency: Prevents OOM crashes on consumer hardware during heavy workloads.
  • Clean Context: Keeps raw build logs out of the LLM context window.
  • True Autonomy: Enables end-to-end agentic workflows (code ➔ build ➔ test ➔ fix) without manual intervention.
Originally created by @tailot on GitHub (Nov 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5403 ### Problem Running resource-intensive tasks (builds, migrations, scripts) alongside a primary LLM in Strata often saturates the VRAM, causing OOM errors or preventing lightweight helper tasks from running efficiently. ### Proposed Solution Implement native lifecycle endpoints (e.g., `POST /v1/models/unload` and `POST /v1/models/load`) to allow automated memory management during heavy operations: 1. **Save Checkpoint:** Serialize agent session state. 2. **Unload:** Free VRAM by unloading the primary model before execution. 3. **Execute & Monitor:** Run the process asynchronously, capturing stdout/stderr and filtering critical logs without bloating the main context. 4. **Reload:** Restore the primary model and inject a structured JSON execution summary upon completion. ### Benefits * **VRAM Efficiency:** Prevents OOM crashes on consumer hardware during heavy workloads. * **Clean Context:** Keeps raw build logs out of the LLM context window. * **True Autonomy:** Enables end-to-end agentic workflows (code ➔ build ➔ test ➔ fix) without manual intervention.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 6, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".
  • Add the Strata version (Settings > About, or strata --version).

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6686210381 --> @github-actions[bot] commented on GitHub (Nov 6, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". - [ ] Add the Strata version (Settings > About, or `strata --version`). Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3224
No description provided.