Skip to content

Commit b0fb5af

Browse files
authored
Promote generic GGUF projector cohort (#678)
## Summary - promote the generic llama.cpp `adapter`, `mlp`, `resampler`, `ldp`, and `ldpv2` GGUF projector routes to exact graph import - add reusable model-agnostic projector components and a three-model decoder/vision/embedding package with a float32 processor boundary - enforce exact metadata, tensor closure, shapes, target architecture, feature-layer selection, and fail-closed unknown-variant behavior - preserve processor-owned image sentinels, including negative/out-of-vocabulary IDs, and scope MiniCPM `<unk>` replacement between `<image>` boundaries - pin immutable sidecar, paired-text, and processor evidence totaling 12,414,806,816 bytes while keeping runtime support truthfully deferred - update the generated GGUF census/docs and expose `image_token_id` through the public API and CLI without changing Hugging Face revision routing ## Schema authority Pinned llama.cpp commit: `8d9af256337d1a501250f9bbf4c0859a654bddd6`. The implementation matches its legacy CLIP penultimate-layer selection, tanh-approximate GELU, LDP HardSigmoid coefficients, GLM-Edge gated SwiGLU/BOI/EOI topology, and MiniCPM learned-query resampler with generated 2D sinusoidal positions. ## Validation - focused projector/importer/docs/CLI suite: 696 passed - broad serial non-integration suite: 8,649 passed, 64 skipped, 12 deselected, 1 subtest passed - sparse immutable header closure: all five selected sidecars accepted exactly (377-447 tensors each) - repository lintrunner passed - new projector model passed mypy - independent high-confidence review found no remaining issues ## Runtime status All five routes are graph-supported and runtime-deferred. No paired runtime or generation parity is claimed until the processor/runtime ABI is independently proven. --------- Signed-off-by: Justin Chu <[email protected]> Copilot-Session: 7f08e9a7-ccb3-4864-ae69-c3ef8adc53a1
1 parent 0c7ac6c commit b0fb5af

26 files changed

Lines changed: 2800 additions & 261 deletions

‎docs/api/build_from_gguf.md‎

Lines changed: 28 additions & 18 deletions
Large diffs are not rendered by default.

‎src/mobius/__main__.py‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ def _cmd_build_gguf(args: argparse.Namespace) -> None:
748748
pkg = build_from_gguf(
749749
gguf_reference,
750750
mmproj=mmproj_path,
751+
image_token_id=args.image_token_id,
751752
dtype=args.dtype,
752753
keep_quantized=keep_quantized,
753754
execution_provider=args.execution_provider,
@@ -1322,8 +1323,16 @@ def build_parser() -> argparse.ArgumentParser:
13221323
"Path to a companion 'clip' mmproj GGUF (vision/audio encoder). "
13231324
"When set, builds a full multimodal package (decoder + "
13241325
"vision_encoder + embedding) instead of a text-only model. "
1325-
"Currently supports Gemma4 and Muse Glimmer vision; audio is "
1326-
"experimental."
1326+
"Supports registry-evidenced vision projectors; audio is experimental."
1327+
),
1328+
)
1329+
gguf_parser.add_argument(
1330+
"--image-token-id",
1331+
type=int,
1332+
default=None,
1333+
help=(
1334+
"Processor-owned image placeholder ID for --mmproj packages. "
1335+
"Use this for sentinels absent from the text vocabulary (for example -200)."
13271336
),
13281337
)
13291338
gguf_parser.add_argument(

‎src/mobius/components/__init__.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@
5252
"LayerScale",
5353
"Linear",
5454
"LinearMultiModalProjector",
55+
"GGUFMLPProjector",
56+
"GLMEdgeAdapterProjector",
5557
"LoRALinear",
5658
"MLP",
5759
"MLPMultiModalProjector",
60+
"MiniCPMResamplerProjector",
61+
"MobileLDPProjector",
62+
"MobileLDPV2Projector",
5863
"MuseGlimmerVisionModel",
5964
"NVFP4QuantizedLinear",
6065
"Cosmos3EdgeMultiModalProjector",
@@ -209,9 +214,14 @@
209214
Gemma3MultiModalProjector as Gemma3MultiModalProjector,
210215
)
211216
from mobius.components._multimodal import (
217+
GGUFMLPProjector,
218+
GLMEdgeAdapterProjector,
212219
InputMixer,
213220
LinearMultiModalProjector,
221+
MiniCPMResamplerProjector,
214222
MLPMultiModalProjector,
223+
MobileLDPProjector,
224+
MobileLDPV2Projector,
215225
)
216226
from mobius.components._muse_glimmer_vision import MuseGlimmerVisionModel
217227
from mobius.components._paged_mla import (

0 commit comments

Comments
 (0)