Expand description
Model-compatibility discovery for rlx-models.
Answers the same question llama.cpp and HuggingFace answer for their own ecosystems: can this runtime load and run this weights file? — but for rlx-models.
Mirrors two upstream behaviors so reports stay aligned with what users already expect from llama.cpp / HF:
-
GGUF required fields. llama.cpp’s loader (
src/llama-model.cpp:: load_hparams,src/llama-vocab.cpp) treatsgeneral.architecture,<arch>.context_length,<arch>.embedding_length,<arch>.block_count,tokenizer.ggml.model, andtokenizer.ggml.tokensas mandatory. If any are missing the file isn’t runnable, regardless of arch support. The same predicate drives HuggingFace’s “compatible with llama.cpp” badge (huggingface.js/packages/tasks/src/local-apps.ts: isLlamaCppGgufModel = !!model.gguf?.context_length). -
HF safetensors model_type.
transformersresolves the model class fromconfig.json::model_type(primary);architectures[]only disambiguates which head within that class. We follow the same precedence incrate::model_type_runner_name.
Structs§
- Compatibility
Report - Structured report from
check_path. Print directly via [Display] or serialize as JSON viaCompatibilityReport::to_json. - Gguf
Required Fields - llama.cpp’s load-time required GGUF metadata fields. All are read by
load_hparams; missing any throws at load time.
Enums§
- Compat
Source - Where the arch identification came from.
- Compatibility
Status - Top-level compatibility verdict.
Functions§
- check_
hf_ repo - Stub returned when the binary was built without the
compat-netfeature. - check_
path - Compatibility report for a local weights path (file or directory).
- looks_
like_ hf_ repo - Heuristic: does
slook like a HuggingFace repo id (org/name) rather than a local filesystem path? We use the same rule HF Hub clients do: exactly one/, no path separators leading the string, no extension suffix. - run_
check - CLI entry point for
rlx-run check <path-or-repo> [--json].