Skip to content

feat(admin): add hotswappable engine package management#679

Open
0xClandestine wants to merge 2 commits intojundot:mainfrom
0xClandestine:feat/new-features
Open

feat(admin): add hotswappable engine package management#679
0xClandestine wants to merge 2 commits intojundot:mainfrom
0xClandestine:feat/new-features

Conversation

@0xClandestine
Copy link
Copy Markdown

@0xClandestine 0xClandestine commented Apr 9, 2026

Summary

Add hotswappable engine package management to the admin panel, allowing users to install and update MLX engine packages (mlx-lm, mlx-vlm, mlx-embeddings, mlx-audio) directly from the UI.

Features

  • Engine Versions Card: Now clickable to open package manager modal
  • Package Manager Modal: Shows available versions from PyPI with real-time installation progress
  • Backend API:
    • GET /api/engine-packages/available - Fetch available versions from PyPI
    • POST /api/engine-packages/install - Install/update a package
    • GET /api/engine-packages/tasks - List install tasks with real-time status
    • DELETE /api/engine-packages/task/{task_id} - Delete completed task

Bug Fixes

  • Fixed version sorting crash ('<' not supported between instances of 'str' and 'int') when sorting versions with mixed formats
  • Fixed stale commit SHAs being displayed after installing new versions via PyPI
    • Removed incorrect fallback to pyproject.toml commits for PyPI-installed packages
    • Fixed direct_url.json parsing to only trust vcs_info for actual VCS installs (git+, hg+, etc.)
  • Added delay + double loadStats() after install to ensure metadata is properly refreshed

Technical Details

  • Installation runs in background using asyncio.to_thread
  • Task polling with 1-second interval for real-time status updates
  • Uses packaging.version.Version for proper semantic version sorting
  • Renamed _load_fallback_commits to _load_engine_commits_json to clarify scope (app bundle only)

Files Changed

  • omlx/admin/routes.py: API endpoints + engine info fixes
  • omlx/admin/static/js/dashboard.js: Frontend UI + install logic
  • omlx/admin/templates/dashboard.html: Package manager modal
  • omlx/admin/templates/dashboard/_status.html: Clickable engine versions card

- Add backend API endpoints:
  - GET /api/engine-packages/available - Fetch available versions from PyPI
  - POST /api/engine-packages/install - Install/update a package
  - GET /api/engine-packages/tasks - List install tasks
  - DELETE /api/engine-packages/task/{task_id} - Delete completed task

- Add frontend UI:
  - Engine versions card now clickable to open package manager modal
  - Modal shows available versions from PyPI
  - Install button with progress indicator and terminal output
  - Warning about model reload after package update

- Backend implementation:
  - Pydantic model EnginePackageInstallRequest
  - EnginePackageInstallTask class for tracking installs
  - Background installation using asyncio.to_thread
  - Task polling with real-time status updates

Supported packages: mlx-lm, mlx-vlm, mlx-embeddings, mlx-audio
- Fix version sorting for mlx-audio dropdown (handles mixed version formats)
- Fix engine info: only trust vcs_info for actual VCS installs (git+, etc)
- Remove pyproject.toml fallback which caused stale commit SHAs to persist
  for PyPI-installed packages
- Add delay + double loadStats() after install to ensure metadata refreshes
@0xClandestine 0xClandestine changed the title fix(admin): engine package version display and sorting bugs feat(admin): add hotswappable engine package management Apr 9, 2026
@0xClandestine
Copy link
Copy Markdown
Author

image image

@jundot jundot force-pushed the main branch 5 times, most recently from 6670575 to 6041883 Compare April 14, 2026 14:17
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