Repository navigation
feat(vision): #106 serving foundation — mmproj self-provisions + live FrameDescriber - #1959
Merged
Merged
Conversation
…ng) — self-provisioning, one resolver
The projector resolver only honored a declared local path, while the GGUF
resolves local → HF cache. That asymmetry forced a manual mmproj placement
step whenever a VL model's bytes already lived in the HF cache without a fresh
`models/pull` (e.g. a boot that resolves the GGUF from cache) — a managed-
product violation: pulling the model pulls its projector, so resolving it
should never need a hand-placed path.
`resolve_mmproj_for_model` now resolves in two tiers:
1. the declared local path (expanded, existence-checked) — placement honored first
2. a `*mmproj*.gguf` sibling in the GGUF's resolved snapshot dir — the layout
every `*-GGUF` vision repo ships, so pulling the model into the HF cache is
enough (mirrors resolve_gguf_for_model; #106 self-provisioning)
Single source of truth (compression): both raw-field readers now route through
the one resolver instead of reading `mmproj_local_path` directly —
- llamacpp_adapter generate_with_image (in-process VL serving) — now sees the
self-provisioned sibling AND gets existence-checking, matching llama-server
- ai_provider boot preflight — no longer false-warns "no mmproj" on a model
whose projector resolves from the HF cache; two warn arms collapse to one
(resolver already existence-checks)
resolve_model_artifacts is intentionally unchanged: the registry holds declared
INTENT (the `omni.mmproj_local_path.is_some()` contract), existence + tier-2
resolution belong at point-of-use.
Tests (artifacts.rs, one mod): declared-tier resolution + None-when-absent under
an isolated HOME (deterministic, no #72 on-disk leak); tier-2 resolves the mmproj
beside the GGUF in an HF-cache snapshot with no declared path, and tier-1 still
wins when a declared projector is present. 43 model_registry tests green.
Refs #106
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…d but had no impl media/frame.rs documents "the live implementor is cognition::vision_describe", but that bridge never existed — the only FrameDescriber impls on canary were test stubs. So a persona's MediaFrame description cell had NO production producer: the compute-once "see" path terminated in a promise. Add `VisionDescribeFramer` (cognition/vision_describe.rs) — the ONE production FrameDescriber. It routes a frame's bytes through describe_image (ai/generate on the best available vision model) and returns the prose a non-vision persona reads to see. Because MediaFrame caches per content hash, wrapping this once and pointing every persona's frame at it means the same image is described ONCE and shared — N personas in a call cost one describe per distinct frame, not N (the 4+-persona shared-KV payoff). Fail loud: no vision model resolved → Err, never a fabricated placeholder a persona would read AS having seen the frame. MediaFrame caches the Err per hash, so the gap surfaces deterministically instead of retrying per persona. Layering holds (cognition → media, never the reverse): the trait lives in media/, its sole live impl in cognition/ where ai/generate is reachable. Test: base64 encode + option threading via a pure `build_frame_request` helper (no executor/registry needed). 17 vision_describe tests green. Refs #106 Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
force-pushed
the
fix/mmproj-resolves-like-gguf
branch
from
July 19, 2026 00:00
edca7eb to
02e8e6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two foundational pieces so a VL persona can actually see — both #106, both cargo-validated.
1. mmproj resolves like the GGUF (declared → HF-cache sibling)
resolve_mmproj_for_modelonly honored a declared local path while the GGUF resolves local → HF cache. That asymmetry forced manual projector placement whenever a model's bytes already lived in the HF cache without a freshmodels/pull— a managed-product violation. Now two-tier: (1) declared path, existence-checked; (2) the*mmproj*.ggufsibling in the GGUF's resolved snapshot dir (the layout every*-GGUFrepo ships). Pulling the model pulls its projector; no hand-placement step.One resolver (compression):
llamacpp_adaptergenerate_with_imageand theai_providerboot preflight now route through it instead of reading the raw field — they see the self-provisioned sibling and get existence-checking, matchingllama-server.resolve_model_artifactsstays as declared-intent (theomni.mmproj_local_path.is_some()contract).2. Live
FrameDescriber— the sensory bridge media/ had no impl formedia/frame.rsdocumented "the live implementor iscognition::vision_describe" but that bridge never existed — the only impls on canary were test stubs, so a persona'sMediaFramedescription cell had no production producer. AddVisionDescribeFramer: routes a frame's bytes throughdescribe_image(ai/generateon the best vision model) → prose. Cached per content hash → the same image is described once and shared across N personas (the 4+-persona shared-KV payoff). Fail loud when no vision model resolves — never a fabricated placeholder. Layering holds: trait inmedia/, sole live impl incognition/.Tests
43 model_registry + 17 vision_describe tests green. New: tier-2 HF-cache-sibling resolution (isolated HOME, no #72 leak); base64+options threading via a pure helper.
Refs #106
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo