Skip to content

feat(uik): publish available memory, the figure a fit decision needs - #66

Merged
ThinkOffApp merged 1 commit into
mainfrom
feat/mem-available
Aug 17, 2026
Merged

feat(uik): publish available memory, the figure a fit decision needs#66
ThinkOffApp merged 1 commit into
mainfrom
feat/mem-available

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

Petrus is asking the dashboard to advise on running a local model, generalised to a size class and quant. That advice needs an accurate "how much memory can this box actually give a model" number, and the field I shipped this morning is not it.

On this Mini, right now:

field value
mem_total_gb 25.8
mem_free_gb 1.5
mem_available_gb 18.0

freemem() counts only genuinely free pages; macOS keeps the rest as cache and hands it back on demand. A verdict computed from free memory would tell Petrus every Mac is out of memory while a 35B-A3B at 3-bit fits comfortably.

The new field asks the OS instead — the percentage memory_pressure reports on macOS, MemAvailable on Linux — and is published alongside free, not instead of it, because both are true and they answer different questions.

This is deliberately the field I declined to derive when I added memory: a used-percentage computed from freemem() would have been an alarm the numbers do not support. Asking the OS what is available is the honest form of that question.

39 tests pass, covering the gap itself, omission when the OS will not answer, and zero as a real reading.

Note for #98 (already merged): it correctly uses mem_total_gb and explicitly avoids mem_free_gb. This field gives it a better input on Macs than total-minus-a-guessed-reserve, if @grok wants it.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

The dashboard is starting to advise whether a machine can host a local model.
On a Mac, `mem_free_gb` is the wrong input for that: this Mini reports 1.5 GB
free and ~18 GB available, because the rest is cache the OS returns on demand.
A verdict computed from free memory refuses a model the machine holds easily.

`mem_available_gb` comes from the OS's own answer — the percentage
`memory_pressure` reports on macOS, `MemAvailable` on Linux — and is published
alongside free rather than replacing it, since the two mean different things
and both are true.

This is the field I declined to derive when adding memory: a used-percentage
computed from free would have been an alarm the numbers do not support. Asking
the OS what is actually available is the honest version of the same question.

39 tests, including the gap itself (available must exceed free by an order of
magnitude on a cached Mac), omission when the OS will not answer, and zero
treated as a real reading.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@ThinkOffApp
ThinkOffApp merged commit 12868c7 into main Aug 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant