Skip to content

feat(cli): models catalog names the not-downloaded models this Mac can select - #1957

Merged
jonathan308 merged 2 commits into
devfrom
claude/status-eligible-model-hint
Nov 12, 2026
Merged

jonathan308 merged 2 commits into
devfrom
claude/status-eligible-model-hint

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

darkbloom models catalog now ends with a short note naming the catalog models this Mac has not downloaded and that the start/switch picker would let it select, with each model's download size and the commands to add one. Owners can see which models their Mac qualifies for without comparing each listed tier with their hardware by hand.

The note only prints. It downloads nothing, selects nothing and saves nothing, and it is absent from --json.

What an owner sees under the existing table (release build; example rows):


Not downloaded (this Mac meets their listed requirements)

  Nemotron 3.5 Lightning  [nvidia-nemotron-3.5-lightning]  ~19.1 GB download
  Qwen 3.5 9B  [Qwen3.5-9B]  ~6.1 GB download

  Not checked: free disk space, memory reserved or in use when a model loads, provider version and trust status.
  Download one: darkbloom models download <id>
  Then choose what to serve: darkbloom switch (darkbloom start when the provider is stopped)

At most three models are listed, larger first as in the picker. With more, a fourth row reads … and N more; the darkbloom switch picker lists them all. With no such model, or when hardware detection failed, nothing is printed.

Linked issue

None.

Test plan

All local runs used DARKBLOOM_RELEASE_ENVIRONMENT=prod as CI does and built the DarkbloomCLITests target only (swift build --build-tests with the other test targets removed in a local, uncommitted copy of Package.swift, then swift test --skip-build --filter ...). No model weights, no GPU and no engine runs.

  • Red first, commit 60229ff (the tests plus a stub that names nothing): swift test --skip-build --filter 'ModelsCatalogHintTests|ModelsCommandRunTests' gives 16 tests in 2 suites, 10 failing (the 8 new pure-function tests, the new command test, and the existing table test whose request assertion changed) and 6 passing.
  • Green, commit a5a0c71, same filter: 16 tests in 2 suites pass.
  • Whole DarkbloomCLITests target on a5a0c71: 1451 tests in 195 suites, 11 failing tests, none in the two changed suites. The same 11 fail on the base 0f11fbe (1442 tests in 194 suites) on the same machine, which was busy with other builds: the cluster-pair start and restart tests, one stop-latch test, one helper-connection test and two sandbox child-output tests.
  • The pure function was also run over a saved copy of the public catalog response for seven memory and capability combinations, in a throwaway local test that is not committed, to read the result on real catalog rows.
  • make changelog-check, make changelog-preview, make docs-impact-check BASE=origin/dev, ./scripts/docs-check.sh docs/provider/cli-reference.md, git diff --check.
  • Not run locally: the other test targets, the GPU shards, and the built CLI against a live coordinator (that run would start the GPU capability diagnostic the command already performs for gated catalog rows).

Components touched

  • provider-swift (Swift CLI)
  • native runtime / MLX
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

No message, endpoint, config key or CLI flag changes, and no version bump. Two things worth knowing:

  • The table request of models catalog now carries include_aliases=1. This is an existing catalog parameter that the start/switch picker's request already sends; the response has the same models list plus aliases. The command still makes exactly one request, which a test asserts.
  • The --json request and its output are unchanged. A test asserts that the --json request has no query string and that its output has no note.

Documentation impact

  • Canonical documentation updated
  • No documentation needed — reason:

docs/provider/cli-reference.md, section darkbloom models catalog: an example of the note, the rule that names a model, and what is not checked.

Changelog

  • Added or updated this PR's unique changelog.d/<topic>.md fragment and ran make changelog-check.
  • No user-visible change, or an explicitly authorized release/history change.

Fragment: changelog.d/models-catalog-not-downloaded-note.md.

Notes for reviewers

How a model gets named. ModelsCatalogHint.candidates is a pure function. It reuses the picker's existing pure helpers instead of holding a second copy of their rules:

  1. Text models only.
  2. Start.evaluateEligiblePickerCatalog: runtime capabilities (the catalog's required_provider_capabilities and the embedded exact-ID rules) and public aliases.
  3. Start.pickerCatalogRows: hidden, rollback and superseded builds.
  4. Start.buildPickerEntries: drops a not-downloaded model whose min_ram_gb is above this Mac's memory, and orders larger first.
  5. Then the note's own filter: not downloaded, active not false, a listed min_ram_gb above zero, and Start.pickerSelectionFitsBudget for that model alone.

How this relates to the coordinator's hardware gate. For a model with a listed tier the coordinator compares min_ram_gb with the Mac's total memory, and the note makes the same comparison. For a model without a listed tier the coordinator estimates from the model's size; the note does not copy that estimate and leaves those models out. The note is stricter than the tier in one respect: the model must also fit the provider's load budget on its own, because meeting the tier does not guarantee that the provider will load the weights.

What it cannot check. Free disk space, the configured memory_reserve_gb and memory in use when a model loads, the coordinator's minimum provider version, and trust status. The printed text and the docs name these. On Macs with 16 to 36 GB the load gate can hold back up to about 2 GiB more than the picker's budget does; the picker has the same gap. This is why the header says "meets their listed requirements" and the docs say the note is not a promise that a model will download, load or receive requests.

Placement. The note is on models catalog and not on status: models catalog already fetches the catalog, while status makes no catalog request, and adding one would put a network call on a command owners run often. --json is the way to get output without the note. There is no new flag.

Size. 302 added lines: 78 source, 187 tests, 35 docs, 5 changelog.

Known limits, not addressed here.

  • A row shows the catalog display name; for an aliased build the picker shows the alias name.
  • A partly downloaded model is listed as not downloaded, with its full size.
  • The note uses the CLI's own hardware and capability detection, where switch uses what the running provider reports.
  • The command test's positive assertions need a host with at least 16 GB of memory. On a smaller host it still checks the single request and that no unexpected row is printed.
  • No test covers the command's hardware-detection-failure branch, which is one if let.

Nearby open work. An older open draft (number 1183, base master) rewrites the "Local only" block directly above the new block in ModelsCommand.swift; whichever lands second needs a small manual merge. Line 3 of docs/provider/cli-reference.md (Last updated) is edited by many open PRs and will conflict trivially.

Repository-wide docs check. make docs-check over the whole repository reports three broken links into libs/mlx-swift-lm from files this PR does not touch, because the clone used here has no submodule checkout. The changed file passes on its own.

Before And After

Behavior:

flowchart TD
  subgraph Before
    B1["darkbloom models catalog"] --> B2["one catalog request"]
    B2 --> B3["Supported models table: downloaded mark, size, listed RAM tier, capability lines"]
    B3 --> B4["Local only block, when there is one"]
    B4 --> B5["End of output: the owner compares each tier with the Mac by hand"]
  end
  subgraph After
    A1["darkbloom models catalog"] --> A2["the same one request, now with include_aliases=1"]
    A2 --> A3["Supported models table, unchanged"]
    A3 --> A4["Local only block, unchanged"]
    A4 --> A5{"Hardware detected and at least one model to name?"}
    A5 -- yes --> A6["Not downloaded note: up to three rows, what is not checked, two commands"]
    A5 -- no --> A7["Nothing more is printed"]
  end
Loading

Code flow:

flowchart TD
  R["Models.Catalog.run"] --> F["ModelCatalogClient.fetchCatalogSnapshot, includeAliases only without --json"]
  F --> J{"--json?"}
  J -- yes --> JO["printJSON of the models, as before"]
  J -- no --> T["Table and Local only block, as before"]
  T --> H{"snapshot.hardware present?"}
  H -- no --> E["return"]
  H -- yes --> C["ModelsCatalogHint.candidates, pure"]
  C --> P1["Start.evaluateEligiblePickerCatalog: capabilities and aliases"]
  P1 --> P2["Start.pickerCatalogRows: hidden and superseded builds"]
  P2 --> P3["Start.buildPickerEntries: listed tier against memory, larger first"]
  P3 --> P4["Filter: not downloaded, active, listed tier, pickerSelectionFitsBudget alone"]
  P4 --> L["ModelsCatalogHint.lines, pure"]
  L --> O["print each line"]
Loading

Refactor Pass

An independent read-only review of the diff (it compiled nothing) raised four points, all applied before the final commit:

  • The first version evaluated the catalog without aliases, so it could name a build that a public alias has replaced. The table request now asks for aliases and candidates takes them; aliasedBuilds covers the desired, previous and retired builds.
  • Inactive rows and rows without a tier were filtered out before the picker's row rules ran, which changed the input of the picker's Gemma rule. Only the text filter now runs first; the other two conditions moved to the final filter, with a test for the inactive case.
  • The load gate also holds back the configured reserve. The printed line now says "memory reserved or in use when a model loads" and the docs name memory_reserve_gb.
  • A forEach with print became a for loop like its neighbours.

Final focused validation after these changes: 16 of 16 tests in the two changed suites pass on a5a0c71.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

jonathan308 and others added 2 commits November 9, 2026 22:43
`darkbloom models catalog` lists every catalog model but does not say which
of the models that are not downloaded this Mac could select. These tests
describe a note for that, printed under the table:

- `ModelsCatalogHint.candidates`: the not-downloaded rows the start/switch
  picker would list and let this Mac select (active text model, listed
  `min_ram_gb` at most this Mac's memory, required runtime capabilities
  present, not hidden from the picker or replaced under a public alias,
  within the provider's load budget).
- `ModelsCatalogHint.lines`: at most three rows with id and download size,
  what was not checked, and the commands.
- `models catalog` prints the lines after its table from the one catalog
  request it already makes, which now also asks for the aliases;
  `--json` prints no note and its request is unchanged.

`ModelsCatalogHint` is a stub that returns nothing, so the suite compiles
and the new tests fail on their assertions.

Co-Authored-By: Claude <noreply@anthropic.com>
…n select

`darkbloom models catalog` printed every catalog model with its size and
memory tier but left the owner to work out which of the models that are not
downloaded the Mac could take. Under the table it now prints a short note:
at most three such models with id and download size, what is not checked,
and the commands to download one and to choose what to serve.

`ModelsCatalogHint.candidates` runs the start/switch picker's own rules
(runtime capabilities, public aliases, hidden builds) on the catalog, then
keeps a row when it is not downloaded, active, lists a `min_ram_gb` at most
this Mac's memory (the coordinator's comparison for a listed tier) and fits
the provider's load budget alone. A model with no listed tier is left out
rather than guessed.

The note only prints. Nothing is downloaded, selected or saved, and no
request is added: the table's one catalog request now also asks for the
public aliases (`include_aliases=1`, as the picker does) so a build replaced
under an alias is not named. The `--json` request and output are unchanged,
and the note is left out when hardware detection fails.

Free disk space, the memory reserve and memory in use at load time, the
coordinator's minimum provider version and the provider's trust status are
not checked; the note and the CLI reference say so.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Nov 10, 2026 6:55am UTC
darkbloom-status Ready Ready Preview Nov 10, 2026 6:55am UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 10, 2026 6:55am UTC

Request Review

@jonathan308
jonathan308 marked this pull request as ready for review November 11, 2026 07:35
@jonathan308
jonathan308 merged commit 71be7fd into dev Nov 12, 2026
19 checks passed

This branch was successfully deployed

3 active deployments
Preview – eigen-homepages-darkbloom — a5a0c71d Deployed Nov 10, 2026 by vercel[bot]
Preview – d-inference-landing — a5a0c71d Deployed Nov 10, 2026 by vercel[bot]
Preview – darkbloom-status — a5a0c71d Deployed Nov 10, 2026 by vercel[bot]
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