Skip to content

Sync Ollama model-projector (vision) bundles - #2

Merged
ensevengg merged 2 commits into
stabilize-sync-lifecyclefrom
support-artifact-bundles
Sep 15, 2026
Merged

ensevengg merged 2 commits into
stabilize-sync-lifecyclefrom
support-artifact-bundles

Conversation

@ensevengg

Copy link
Copy Markdown
Owner

Summary

Second PR of the stack (contains #1). Adds support for multi-artifact vision models — the gap where Ollama vision models like llava imported into LM Studio without their projector (mmproj) layer and silently lost vision capability.

  • Manifest parsing — recognizes model + projector (application/vnd.ollama.image.projector) layers; rejects, rather than partially syncs, unsupported shapes (multiple model/projector layers, adapter/draft/tensor layers).
  • Import — one lms import per artifact; projector aliases use the LM Studio-recognized mmproj- prefix; both files land in the same digest-keyed user/repo so LM Studio pairs them.
  • Verification — after a bundle import, lms ls --json is polled (with retry) to confirm LM Studio actually indexed the model as vision-capable; status cross-checks the same inventory (only when needed).
  • State schema v2 — per-artifact sync records with per-artifact resume on re-sync; schema-v1 records remain readable. Partial imports persist progress so re-running sdl sync resumes instead of re-importing.
  • CLI — sdl scan shows projector artifacts and their readiness; JSON output includes the artifact list.

Design and compatibility were validated up front against primary sources (Ollama loader/layer-type sources, lms CLI source) and end-to-end on real LM Studio 0.4.23 — see docs/research/multi-artifact-validation.md and the retained registry fixture in tests/fixtures/ollama/.

Known trade-off

Re-pulling a vision model creates a new digest-keyed repo directory in LM Studio; the old bundle directory is orphaned there (prune only manages StudioLink staging aliases). Two follow-up bugs in this area are found and fixed by the audit in the next PR (#3).

Verification

  • Full suite: 156 passed; pyright clean.

Stack / merge order

  1. Harden sync lifecycle and platform discovery #1 stabilize-sync-lifecycle → main
  2. This PR → stabilize-sync-lifecycle
  3. Reliability audit fixes + release 0.3.1 #3 reliability-fixes → support-artifact-bundles

Merge in order; each PR contains the previous one.

@ensevengg
ensevengg merged commit 810620b into stabilize-sync-lifecycle Sep 15, 2026
7 checks passed
ensevengg added a commit that referenced this pull request Oct 22, 2026
Land #2 and #3 on main (vision bundles + reliability fixes, 0.3.1)
ensevengg added a commit that referenced this pull request Nov 16, 2026
PRs #2 and #3 landed on their stacked parent branches instead of main, so
this branch was written without them. Merge them in and apply this
branch's import guarantees to multi-artifact records:

- verify, transactionally replace, recover, copy-reuse and reclaim each
  artifact; record a file identity per artifact
- keep a previous import tracked when a re-pull fails partway; the retry
  adopts files the failed attempt already verified
- keep imports whose Ollama blob was deleted synced only while their
  recorded identity is unchanged (symlinks and edited files are stale)
- sweep every leftover in copy-mode staging, since copy mode removes its
  aliases after each locked import
- apply manifest size checks to projector blobs

Validation: 281 passed on Python 3.12 including 27 sandboxed real-lms
cases; 254 passed, 27 skipped on 3.13 and 3.14; Ruff, formatting,
Pyright and distribution builds pass.

Co-Authored-By: Claude <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