MCPcopy
hub / github.com/Andyyyy64/whichllm / effective_usable_ram

Function effective_usable_ram

src/whichllm/hardware/memory.py:32–37  ·  view source on GitHub ↗

Estimate usable RAM, optionally capped by a user/runtime budget.

(total: int, budget: int | None = None)

Source from the content-addressed store, hash-verified

30
31
32def effective_usable_ram(total: int, budget: int | None = None) -> int:
33 """Estimate usable RAM, optionally capped by a user/runtime budget."""
34 usable = estimate_usable_ram(total)
35 if budget is None:
36 return usable
37 return max(0, min(usable, budget))
38
39
40def detect_disk_free_bytes(path: str | None = None) -> int:

Callers 2

check_compatibilityFunction · 0.90

Calls 1

estimate_usable_ramFunction · 0.85

Tested by

no test coverage detected