mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #102] [CLOSED] feat: optional RAM and VRAM guard for the server it launches #2454
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2454
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/102
Author: @midhatn
Created: 9/29/2026
Status: ❌ Closed
Base:
main← Head:feat/resource-guard📝 Commits (1)
f19efeafeat: add opt-in RAM and VRAM guard for owned server processes📊 Changes
3 files changed (+368 additions, -0 deletions)
View changed files
➕
docs/RESOURCE_GUARD.md(+44 -0)➕
serve/resource_guard.py(+212 -0)➕
serve/test_resource_guard.py(+112 -0)📄 Description
This adds an optional launcher for machines where Strata fits at startup but another application can later consume the remaining RAM or VRAM. It checks configured floors before launch and while the server loads/runs, and stops only the server it owns when a floor is crossed or required telemetry disappears.
Usage and limitations are in
docs/RESOURCE_GUARD.md. No existing launcher or default changes. The GPU index is passed to both NVML and the server, so monitoring follows the selected physical card. It uses available physical RAM and NVML's actual free VRAM.Windows containment uses a Job Object: a small worker joins the job before spawning the frontend, and the engine inherits membership. POSIX uses a new process group. No process-name scans or termination of other applications. The stop is deliberately a forced teardown, with a nonzero exit status, not a context-saving shutdown; an in-flight request fails. Sampling cannot guarantee prevention of OOM or reserve memory.
Validation on Windows against current main (
c1e9033, v0.1.20):python -m unittest serve.test_resource_guard -v).No full-model pressure test or POSIX runtime validation is claimed. Opening as a draft for feedback on the opt-in wrapper approach and the forced-stop policy before expanding platform coverage. This complements startup fitting and the admission checks discussed in #57; it does not implement conversation caching or expert tiering.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.