Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Jan Hub Revamp #4491

Merged
merged 20 commits into from
Jan 28, 2025
Merged

feat: Jan Hub Revamp #4491

merged 20 commits into from
Jan 28, 2025

Conversation

louis-menlo
Copy link
Contributor

@louis-menlo louis-menlo commented Jan 20, 2025

Describe Your Changes

This PR introduces support for /model/sources in Jan Model Hub, implemented using cortex.cpp.

With this endpoint support, the Jan frontend can now remove pre-populated models and legacy HuggingFace operations. All requests are now routed to the cortex.cpp server. So that:

As a user, I can now access model variants from the Cortexso Hub, along with improved model descriptions.

Demo

New Model Hub Revamp

This is a full flow of this new model hub revamp
CleanShot 2025-01-24 at 01 12 01

New model search outlook

This new model search outlook functions more effectively with fuzzy searching. It supports either recent searched models or Hugging Face repository ID or URL.
CleanShot 2025-01-24 at 01 15 02

Download HuggingFace models

Users can now see the search status and model founds instead of just getting an error message as before.
CleanShot 2025-01-24 at 01 17 33

Download Cortexso hub models

Users can input the repository ID of the cortexso repository to work with multiple branches (model versions).
CleanShot 2025-01-24 at 01 18 48

Cloud models

Instead of listing all remote models as before, which was confusing, we've created a long list that needs to be grouped. We're introducing a new remote model detail page to help organize the information.
CleanShot 2025-01-24 at 01 21 14

New sorting options

Now users can sort models by Most Downloaded or Newest
CleanShot 2025-01-24 at 01 22 16

Quick download action

Users can conveniently select model versions right on the download button, bypassing the need to go to the model detail page.
CleanShot 2025-01-24 at 01 27 29

New Deeplink update

Now, instead of displaying the model dialog, it directs users to the model detail page.
CleanShot 2025-01-24 at 01 34 37

Hub Banner settings

Users can now customize the Model Hub with banner settings
CleanShot 2025-01-24 at 21 27 02

Fixes Issues

Self Checklist

  • Revamped Model Hub UI
  • Added model source details page
  • Download various model quantizations
  • Remote provider listing
  • Initialize model sources

Changes

This pull request includes significant changes to the model management system, the integration of a new dropdown menu component, and some utility function updates. The most important changes are detailed below:

Model Management Enhancements:

  • Added new methods getSources, addSource, and deleteSource to the ModelExtension class for managing model sources (core/src/browser/extensions/model.ts).
  • Introduced ModelSource interface and related types to define the structure of model sources (core/src/types/model/modelSource.ts).
  • Updated ICortexAPI and CortexAPI to include methods for handling model sources (extensions/model-extension/src/cortex.ts). [1] [2]

Dropdown Menu Component:

  • Added a new Dropdown component using @radix-ui/react-dropdown-menu, including styles and functionality (joi/src/core/Dropdown/index.tsx, joi/src/core/Dropdown/styles.scss). [1] [2]
  • Updated package.json to include the new dependency for the dropdown menu (joi/package.json).

Utility Function Updates:

  • Changed utility function toGibibytes to toGigabytes in several files for consistency in memory size conversion (web/containers/Layout/BottomPanel/SystemMonitor/TableActiveModel/index.tsx, web/containers/Layout/BottomPanel/SystemMonitor/index.tsx). [1] [2] [3] [4]

These changes improve the flexibility and functionality of the model management system and enhance the user interface with a new dropdown component.

@github-actions github-actions bot added the type: feature request A new feature label Jan 20, 2025
@louis-menlo louis-menlo marked this pull request as ready for review January 23, 2025 19:04
@louis-menlo louis-menlo requested a review from a team January 23, 2025 19:04
Copy link
Contributor

github-actions bot commented Jan 23, 2025

Barecheck - Code coverage report

Total: 67.62%

Your code coverage diff: -0.21% ▾

Uncovered files and lines
FileLines
core/src/browser/extensions/model.ts15
joi/src/core/Dropdown/index.tsx13, 24, 30
web/containers/Layout/BottomPanel/SystemMonitor/index.tsx55, 94, 102, 108, 115-116, 153, 157
web/containers/Layout/BottomPanel/SystemMonitor/TableActiveModel/index.tsx51-53
web/containers/ModelDropdown/index.tsx126-127, 137, 146, 150, 152, 154-155, 157-158, 160-163, 165, 187-188, 198, 202, 217-218, 225-228, 230, 232, 251, 256, 266, 273, 276-277, 298, 322, 345, 366, 375, 381, 389, 392, 394, 398, 400-405, 408, 411, 468-469, 471, 497, 505, 507, 532, 537-538, 540, 544-546, 548-549, 551, 561-564, 595, 603, 605
web/hooks/useEngineManagement.ts40-41, 43, 64, 77-78, 80, 90, 92, 99, 106-107, 109, 119, 121, 128, 137, 142, 144, 150, 152, 154-157, 161-162, 165-166, 169, 180, 193, 197, 199, 205, 207-209, 211, 215-216, 219-220, 223, 232, 243-244, 246, 254, 257-258, 266, 270, 282, 284-285, 288, 290-291, 293-294, 307, 309-310, 313, 315-317, 319-320, 332, 334-335, 338, 340-342, 344-345, 354, 356-357, 360, 362-364, 366-367, 379, 381-382, 385, 387-389, 391-392, 403, 405-406, 409, 411, 416-417, 419-420, 429-430, 432, 434, 437, 440, 444
web/hooks/useModels.ts48, 62, 64, 68, 89-90
web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx66, 99, 105, 132, 153-154, 156, 179, 188, 190, 218, 241, 243, 274, 300, 308, 312, 316, 321-322, 351
web/screens/Thread/ThreadCenterPanel/FileUploadPreview/index.tsx14-15, 17-19
web/screens/Thread/ThreadCenterPanel/TextMessage/DocMessage.tsx16, 22
web/screens/Thread/ThreadCenterPanel/TextMessage/MarkdownTextMessage.tsx32, 36-37, 41, 49-52, 54, 58, 65-67, 73, 76-78, 80, 85-86, 89, 139, 141-142, 147-148, 207, 222
web/screens/Thread/ThreadCenterPanel/TextMessage/index.tsx31-36, 38, 40, 44, 46, 50
web/utils/converter.ts13, 21-22
web/utils/modelEngine.ts68, 70, 72, 74, 76, 78, 80, 82, 84, 86

@louis-menlo louis-menlo merged commit 83f0908 into dev Jan 28, 2025
11 checks passed
@louis-menlo louis-menlo deleted the feat/jan-hub-revamp branch January 28, 2025 15:23
@github-actions github-actions bot added this to the v0.5.15 milestone Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: New Jan Hub UI roadmap: Jan's Hub is revamped and uses Cortex's /model/sources
2 participants