Skip to content

feat(api-monitor): add Load button to API page toolbar - #10378

Merged
danielhanchen merged 1 commit into
unslothai:mainfrom
michupeel:feat/api-load-model
Oct 11, 2026
Merged

danielhanchen merged 1 commit into
unslothai:mainfrom
michupeel:feat/api-load-model

Conversation

@michupeel

Copy link
Copy Markdown
Contributor

Summary

Adds a Load action to the API monitor toolbar.

The new action:

  • reuses the existing shared ModelSelector
  • reuses the existing model loading flow
  • respects model-specific saved configuration
  • disables duplicate load attempts while a model is loading
  • visually matches the existing API toolbar controls

Motivation

The API page already exposes Unload, but loading a model currently requires navigating to another part of Studio.

This makes model lifecycle management asymmetric for API-focused workflows.

Implementation

  • Adds Load to the left of Pause
  • Uses the existing ModelSelector
  • Uses the existing useChatModelRuntime().selectModel() path
  • Preserves config precedence used by Chat
  • Adds generic disabled and hideChevron support to ModelSelector
  • Keeps all backend/API behavior unchanged

Testing

  • npm run typecheck — passed
  • npm run build — passed
  • git diff --check — passed
  • Manual runtime test:
    • Load opens the model selector
    • selecting a model triggers inference load
    • Load is disabled while loading
    • loaded-model state updates
    • existing Pause / Unload / Refresh actions remain functional

Scope

  • frontend only
  • no new inference endpoint
  • no duplicate model picker
  • no unrelated refactoring

Screenshot

image

@danielhanchen danielhanchen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the PR @michupeel, and for the clear write-up and screenshot!

We won't be taking the code changes here, since #11223 landed on main in the meantime and adds the same capability to the API page toolbar: a shared ModelSelector picker that loads through useChatModelRuntime().selectModel() (same config precedence, loading guards, and rollback as Chat), plus a Reload shortcut for the previous model. Merging this on top would give the toolbar two load controls.

We still really appreciate the contribution, so I reduced this PR to a single empty commit authored by you and am merging that, which keeps you credited as an Unsloth contributor. Thanks again, and we would love to see more PRs from you!

@danielhanchen
danielhanchen merged commit ac5a1bb into unslothai:main Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants