Repository navigation
Description
Problem / Background
The mlxcel list subcommand (src/main.rs, output produced by print_supported_models()) is a hand-written text block that has drifted badly from the actual implemented model coverage, and its closing reference points at a file that does not exist in any released artifact.
Concrete current output
Reproduce with ./target/release/mlxcel list:
Supported Model Architectures (57+):
TRANSFORMER MODELS:
Llama family: Llama 1/2/3/4, Yi, TinyLlama, Vicuna
Qwen family: Qwen 2/2.5/3, Qwen MoE variants
Gemma family: Gemma 1/2/3/3n, RecurrentGemma
Phi family: Phi 1/2/3/3-small, PhiMoE
Mistral family: Mistral, Mixtral, Ministral3, Mistral3
DeepSeek: DeepSeek v1/v2/v3/v3.2, DeepSeek R1
Cohere: Command R/R+ (Cohere, Cohere2)
InternLM: InternLM 2/3
GLM: GLM4, GLM4 MoE
ExaOne: ExaOne 3/4, ExaOne MoE
OLMo: OLMo 1/2/3, OLMoE
Others: StarCoder2, StableLM, Baichuan, MiniCPM 1/3
STATE SPACE / RNN MODELS:
Mamba: Mamba 1/2, Falcon Mamba
RWKV: RWKV v7
RecurrentGemma: Griffin hybrid (RGLRU + attention)
HYBRID MODELS (Attention + SSM/Linear):
Jamba: Mamba + Transformer + MoE
Qwen3 Next: Full Attention + GatedDeltaNet + MoE
Nemotron-H: Mamba2 + Attention + MLP/MoE hybrid
SPECIALIZED MODELS:
Nemotron: Nemotron-4, Nemotron-H, Nemotron-NAS
ERNIE: ERNIE 4.5, ERNIE 4.5 MoE
SmolLM3: Efficient small model
Hunyuan: Hunyuan v1 Dense
MiMo: Multi-token prediction
For the full list, see: docs/model_implementations.md
Problems
(1) Count drift. Header says "57+" but the ModelType enum in src/models/mod.rs defines roughly 90 variants, and README.md already correctly advertises "80+ Model Architectures".
(2) Missing entire categories — no VLM section at all. The output omits vision-language models entirely, yet the registry already enumerates many VLM ModelType variants, including (non-exhaustive):
Llama4VLMGemma3VLM,Gemma4VLM,Gemma3nVLMQwen2VL,Qwen25VL,Qwen3VL,Qwen3VLMoeQwen35VLM,Qwen35MoeVLMLlavaVLM,LlavaBunnyVLMAyaVisionVLMPaliGemmaVLMPixtralVLM,Mistral3VLMYoutuVLMMiniCPMOVLMMoondream3VLMPhi4MMVLM,Phi4SigLipVLM,Phi3VLMMolmo2VLM,MolmoPointVLMNemotronHNanoOmniVLM
(3) Missing text/hybrid families. The list also omits these registered ModelType variants:
Qwen35,Qwen35Moe(Qwen 3.5 hybrid Transformer + GatedDeltaNet)MiniMax(MiniMax-M2 MoE)Step3p5KimiLinearLongcatFlash,LongcatFlashNgramMistral4(Mistral family line stops atMistral3)Glm4MoeLite,GlmMoeDsa(GLM line says only "GLM4, GLM4 MoE")HunyuanMoe(Hunyuan line only mentions V1 Dense)SolarOpen(registered alongside ExaOne family in metadata)
(4) Incorrect labels. The "Llama family" line lists "Yi, TinyLlama, Vicuna" — these are HuggingFace compatibility tags resolved into ModelType::Llama by detection, not separate variants, and listing them next to "Llama 1/2/3/4" creates the wrong impression that they are first-class engines.
(5) Dead documentation link. The final line "For the full list, see: docs/model_implementations.md" references a file that does not exist anywhere in the released artifact. End users running mlxcel list see a broken reference.
Root cause
print_supported_models() is a free-standing hand-written block; there is no mechanism that forces it to update when a new ModelType is added. Meanwhile the project already maintains a single source of truth — the ModelType enum in src/models/mod.rs plus the model metadata table — and Rust's exhaustive match on ModelType would catch any future variant addition at compile time.
Proposed Solution
Drive mlxcel list from the existing ModelType enum and metadata table so the registry becomes the single source of truth, and any future model addition automatically appears in the CLI output.
Acceptance Criteria
This issue is standalone, so the implementation should land as one PR that integrates end-to-end:
- Extend the model metadata table so each
ModelTypecarries a user-facingdisplay_nameand afamilygrouping label. The metadata addition must use compile-time exhaustiveness so that adding a newModelTypevariant without filling in the two fields is a build error. - Rewrite
print_supported_models()to:- Iterate every
ModelTypevariant in declaration order. - Group by
family, render each family with its members in stable order. - Update the header count from
"(57+)"to the actual variant count, computed at compile time. - Remove the final
"For the full list, see: docs/model_implementations.md"line entirely (the new output is exhaustive, no external pointer is needed).
- Iterate every
- Add an exhaustiveness unit test that:
- Iterates every
ModelTypevariant. - Asserts each one has a non-empty
display_nameandfamily. - Asserts the rendered output of
print_supported_models()mentions everydisplay_nameat least once. This catches future drift if a variant is added but the display columns are left blank.
- Iterates every
- No new doc files. Do NOT create
docs/model_implementations.mdto make the old link valid — the agreed design is to drop the reference because the new output is exhaustive. - Verification before close:
cargo build --releaseclean../target/release/mlxcel listreflects the new exhaustive output with the correct count and no dangling URL.- New unit test passes.
- Existing CLI help/consistency tests still pass.
mlxcel-server list— if the server binary exposes the same subcommand, apply the same fix; otherwise note in the PR body that only themlxcelbinary is affected.
Technical Considerations
- The single-source-of-truth approach relies on Rust's exhaustive
matchonModelTypeto force registry completeness at compile time. Threadingdisplay_nameandfamilythrough the metadata table keeps a single point of change for every new model. familyis intentionally a free-form&'static strrather than a closed enum so that new categories (e.g. "Diffusion VLM") can be added without churn; group ordering in the rendered output can be controlled by a smallconst FAMILY_ORDER: &[&str]table inprint_supported_models().- Sort members within each family by
display_name(or byModelTypedeclaration order — implementer's choice) so the output is deterministic across builds. - The exhaustiveness unit test is the safety net that replaces the manual editorial process — without it, a future
ModelTypecould still ship with emptydisplay_name/familystrings.
Activity
docs(changelog): add Unreleased entry for #26 list registry rewrite
fix(cli): rebuild `mlxcel list` from the ModelType registry (#27)
docs: fix comment counting and stale line ref in dead_doc_pointers.rs
docs: fix dead docs/model_tests.md and docs/testing.md pointers (#2022)
fix(cli): rebuild `mlxcel list` from the ModelType registry (lablup#27)