Unify instance eject with optional weight deletion - #2238
Open
alytaphoenix wants to merge 1 commit into
Open
Conversation
Replaces the instance card's DELETE button with EJECT: stopping the
instance now optionally also deletes that instance's downloaded
weights from disk, via a second confirmation, instead of requiring a
separate trip to the Downloads page. Reuses the existing DELETE
/instance/{id} and DELETE /download/{node_id}/{model_id} endpoints
unchanged.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011rjSfwDBTkmySmfU6NgHKF
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.
Summary
DELETE /instance/{id}, unchanged).DELETE /download/{node_id}/{model_id}, unchanged), via a second confirmation — no more navigating to the Downloads page separately.shardAssignments.nodeToRunner). If the same model's weights happen to exist on other nodes from a prior placement, those are untouched — this eject action only clears the weights for the instance being ejected.Known limitation
DELETE /instance/{id}enqueues aDeleteInstancecommand and returns immediately — actual teardown happens asynchronously in the master's reconciliation loop. The weight-deletion confirmation fires right after that 200 response, not after teardown completes. Ejecting an instance that's stillPREPARING/loading and choosing to also delete weights means the delete-from-disk can race the in-flight load on that node. The failure mode is bounded (the file unlink itself succeeds; a mid-load error surfaces as a log/cosmetic error on that node; the model is just re-downloadable) but it's worth knowing about if you eject early in a model's load.Test plan
npx svelte-check— no new errors (same baseline as main: 15 errors / 6 warnings)npm run build— succeeds/state,/instance/{id}, and/download/{node}/{model}endpoints (no real model instance was loaded — this sandbox has nomlxinstalled, so a live inference instance isn't reachable here): confirms the EJECT button renders, the two sequential confirm dialogs fire with the right copy,DELETE /instance/{id}fires first, andDELETE /download/{nodeId}/{modelId}fires second with the model ID correctly URL-encoded.basedpyright/ruff/pytestare not applicable here.nix fmt/nix flake checkwere not run (nix unavailable in this sandbox) — substitutedprettier-plugin-sveltedirectly, unconfirmed against the real treefmt config.🤖 Generated with Claude Code
https://claude.ai/code/session_011rjSfwDBTkmySmfU6NgHKF