Conversation
A model node that publishes the same weights in several variants (quantizations, precisions) can declare `weight_variants` next to `hf_repo`. Each variant is downloaded and deleted on its own from the Extensions drawer, and the params_schema select that picks one labels the variants that are missing from disk. - manifest validation mirrored in electron/main/model-sources.ts and api/services/model_sources.py: safe relative paths, no overlap between two variants, download_check outside every variant, no combination with model_sources, and the selecting param must exist and offer every id. - every install downloads the shared files first (all variants excluded), then the requested variant, or the default one; files already complete on disk are skipped, so a second variant only fetches its own weights. - new IPC: model:installedWeightVariants (null when unreadable) and model:deleteWeightVariant, which unloads the model before removal and touches only the files of that variant. - generation refuses a variant that is not installed (GeneratorRegistry.assert_weight_variant_installed) and picking one in a node opens the extension drawer.
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.
A model node that publishes the same weights in several variants (quantizations, precisions) can declare
weight_variantsnext tohf_repo. Each variant is downloaded and deleted on its own from the Extensions drawer, and theparams_schemaselect that picks one labels the variants missing from disk.Manifest
Validation is mirrored in
electron/main/model-sources.tsandapi/services/model_sources.py: safe relative paths, no overlap between two variants,download_checkoutside every variant, no combination withmodel_sources, and the selecting param must exist (node or extensionparams_schema) and offer every variant id.Behaviour
model:installedWeightVariants(returnsnullwhen the install state cannot be read, so the renderer never mistakes it for "none installed") andmodel:deleteWeightVariant, which unloads the model first and removes only that variant's files,.partincluded.download_checkand at least one variant are present.GeneratorRegistry.assert_weight_variant_installed, called at the top of_run_generation, so workflows and the agent are both covered). Picking a missing variant in a node opens the extension drawer.Tests
npm run test:py(115 tests, OK) andnpm run test:node(37 + 142, 0 fail) pass;npx eslint .is clean.tsc -b --noEmitreports the 29 errors already present ondev, none in the files touched here.Not covered: a real Hugging Face download of a variant has not been exercised end to end — the variant files were faked on disk for the UI, deletion and generation-guard runs.