Gracefully exit when pointed at a model asset instead of a model bundle directory#60
Merged
Merged
Conversation
ff53e30 to
b943cad
Compare
stikves
approved these changes
Jun 22, 2026
…le directory
When llm-runner / llm-benchmark were pointed at a .aimodel or .aimodelc
asset instead of the parent model bundle directory, they failed with a
confusing error. A compiled .aimodelc is itself a directory containing
its own unrelated metadata.json, so ModelBundle parsed it, defaulted it
to metadata_version "0.1", and surfaced the misleading "unsupported
metadata_version '0.1'". A .aimodel path instead produced
"metadata.json not found at .../model.aimodel/metadata.json".
Detect a .aimodel/.aimodelc path extension at the top of
ModelBundle.init(at:), before any filesystem read, and throw a clear
new BundleError.pointedAtModelAsset. The CLIs already catch BundleError
and exit non-zero, so all tools that load through ModelBundle
(llm-runner, llm-benchmark, VLM dispatch) now exit gracefully.
Also align llm-benchmark's --model help text with llm-runner's
("Path to a model bundle directory").
b943cad to
f8ae6fa
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.
When llm-runner / llm-benchmark were pointed at a .aimodel or .aimodelc asset instead of the parent model bundle directory, they failed with a confusing error. A compiled .aimodelc is itself a directory containing its own unrelated metadata.json, so ModelBundle parsed it, defaulted it to metadata_version "0.1", and surfaced the misleading "unsupported metadata_version '0.1'". A .aimodel path instead produced "metadata.json not found at .../model.aimodel/metadata.json".
Detect a .aimodel/.aimodelc path extension at the top of ModelBundle.init(at:), before any filesystem read, and throw a clear new BundleError.pointedAtModelAsset. Already it catches BundleError and exit non-zero, so all tools that load through ModelBundle (llm-runner, llm-benchmark, VLM dispatch) now exit gracefully.
Also align llm-benchmark's --model help text with llm-runner's ("Path to a model bundle directory").