Skip to content

Unify instance eject with optional weight deletion - #2238

Open
alytaphoenix wants to merge 1 commit into
exo-explore:mainfrom
alytaphoenix:feature/eject-model
Open

Unify instance eject with optional weight deletion#2238
alytaphoenix wants to merge 1 commit into
exo-explore:mainfrom
alytaphoenix:feature/eject-model

Conversation

@alytaphoenix

Copy link
Copy Markdown

Summary

  • Renames the instance card's DELETE button to EJECT and unifies two previously-separate actions into one flow:
    1. Stop the running instance (existing DELETE /instance/{id}, unchanged).
    2. On success, optionally also delete that instance's downloaded weights from disk (existing DELETE /download/{node_id}/{model_id}, unchanged), via a second confirmation — no more navigating to the Downloads page separately.
  • No backend changes; both endpoints already existed and are reused as-is.
  • Weights are deleted only on the nodes this instance ran on (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 a DeleteInstance command 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 still PREPARING/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
  • Verified in a real headless browser (Playwright) with mocked /state, /instance/{id}, and /download/{node}/{model} endpoints (no real model instance was loaded — this sandbox has no mlx installed, 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, and DELETE /download/{nodeId}/{modelId} fires second with the model ID correctly URL-encoded.
  • This is a dashboard-only change (no Python touched), so basedpyright/ruff/pytest are not applicable here.
  • nix fmt / nix flake check were not run (nix unavailable in this sandbox) — substituted prettier-plugin-svelte directly, unconfirmed against the real treefmt config.
  • Note: this repo has no component-level tests for the dashboard (traces/downloads pages ship without them either), so no test file was added for this change, consistent with existing precedent.

🤖 Generated with Claude Code

https://claude.ai/code/session_011rjSfwDBTkmySmfU6NgHKF

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant