Skip to content

feat(vision): #106 serving foundation — mmproj self-provisions + live FrameDescriber - #1959

Merged
joelteply merged 2 commits into
canaryfrom
fix/mmproj-resolves-like-gguf
Jul 19, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fix/mmproj-resolves-like-gguf

Conversation

@joelteply

@joelteply joelteply commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

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_model only 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 fresh models/pull — a managed-product violation. Now two-tier: (1) declared path, existence-checked; (2) the *mmproj*.gguf sibling in the GGUF's resolved snapshot dir (the layout every *-GGUF repo ships). Pulling the model pulls its projector; no hand-placement step.

One resolver (compression): llamacpp_adapter generate_with_image and the ai_provider boot preflight now route through it instead of reading the raw field — they see the self-provisioned sibling and get existence-checking, matching llama-server. resolve_model_artifacts stays as declared-intent (the omni.mmproj_local_path.is_some() contract).

2. Live FrameDescriber — the sensory bridge media/ had no impl for

media/frame.rs documented "the live implementor is cognition::vision_describe" but that bridge never existed — the only impls on canary were test stubs, so a persona's MediaFrame description cell had no production producer. Add VisionDescribeFramer: routes a frame's bytes through describe_image (ai/generate on 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 in media/, sole live impl in cognition/.

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

@joelteply joelteply changed the title fix(vision): mmproj resolves like the GGUF (declared → HF-cache sibling) feat(vision): #106 serving foundation — mmproj self-provisions + live FrameDescriber Jul 18, 2026
@github-actions github-actions Bot added size: L and removed size: M labels Jul 18, 2026
joelteply and others added 2 commits July 18, 2026 19:00
…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
joelteply force-pushed the fix/mmproj-resolves-like-gguf branch from edca7eb to 02e8e6a Compare July 19, 2026 00:00
@joelteply
joelteply merged commit e51914b into canary Jul 19, 2026
4 checks passed
@joelteply
joelteply deleted the fix/mmproj-resolves-like-gguf branch July 19, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant