Skip to content

Attach mmproj sidecar when scanning HF cache so models.ini includes it#101

Open
robnightingale wants to merge 1 commit into
ggml-org:mainfrom
robnightingale:fix/vision-mmproj-models-ini
Open

Attach mmproj sidecar when scanning HF cache so models.ini includes it#101
robnightingale wants to merge 1 commit into
ggml-org:mainfrom
robnightingale:fix/vision-mmproj-models-ini

Conversation

@robnightingale

Copy link
Copy Markdown

Problem

Vision models discovered via the Hugging Face cache scan loaded without their mmproj projector, so they ran without vision support.

The cache scan is the source of the resolvedPaths used to generate models.ini. Two things conspired to drop the projector:

  • buildSideloadedEntry hardcoded mmprojFile: nil.
  • collectGgufFiles filters mmproj*.gguf out of the runnable-model set.

As a result the projector never made it into ResolvedPaths, the if let mmprojPath branch in generateModelsFileContent never fired, and the mmproj = line was omitted from models.ini.

Fix

  • Resolve the lone mmproj*.gguf sidecar sitting alongside the model file and pass it through to ResolvedPaths.mmprojFile.
  • Skip when ambiguous (multiple candidates), matching HFRepoResolver.pickMmproj's behavior.
  • Fold the sidecar's size into the aggregate so the reported size matches Model.fileSize's documented main + shards + mmproj contract.

Scope

One file, Llama/System/HFCache.swift (+29 / −3).

🤖 Generated with Claude Code

…udes it

buildSideloadedEntry hardcoded mmprojFile: nil, and collectGgufFiles
filters mmproj files out of the runnable-model set, so the cache scan —
the source of resolvedPaths used to generate models.ini — never carried
the projector. generateModelsFileContent's `if let mmprojPath` branch
therefore never fired, and vision models loaded without their mmproj.

Resolve the lone mmproj*.gguf sidecar in the model's directory (skip when
ambiguous, matching HFRepoResolver.pickMmproj) and pass it to
ResolvedPaths.mmprojFile. Also fold its size into the aggregate so it
matches Model.fileSize's documented main + shards + mmproj contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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