janhq / cortex.cpp

Run and customize Local LLMs.
https://cortex.so
Apache License 2.0
1.91k stars 105 forks source link

Discussion: Cortex.cpp installation & uninstallation #1039

Closed namchuai closed 1 week ago

namchuai commented 2 weeks ago

Motivation Couple of options:

  1. via Package managers (brew, winget, launchpad, etc.)
    • Pros:
    • Easy to update (maybe?) just provide package manager team
    • Easy for acquire user? (like just running brew install cortexcpp or something like that)
    • Cons:
    • Take long time for new version come out
    • Hard (or impossible) to choose a place to install binary/files (not entirely sure. Open for discussion)
  2. self hosted
    • Pros:
    • Not being constrained by Package managers
    • Shorter time to market
    • Easy to have multiple variants (stable, beta, nightly)
    • Let user decide where to store files. More managable?
    • Cons:
    • Have to handle upgrade ourselves
    • User acquisition is more difficult?
  3. Hmm, both?

Related Issues

hiento09 commented 1 week ago

Installer:

0xSage commented 1 week ago

@hiento09 I spot some inconsistencies in your folder/file naming vs #1040

hiento09 commented 1 week ago

@hiento09 I spot some inconsistencies in your folder/file naming vs #1040

I just edited my comment base on this comment https://github.com/janhq/cortex/issues/1040#issuecomment-2327938276 from @dan-homebrew

dan-homebrew commented 1 week ago

@hiento09 I made some changes to your folder/binary layout, based on our earlier discussion #1092

Changes

Installer:

hiento09 commented 1 week ago

@hiento09 I made some changes to your folder/binary layout, based on our earlier discussion #1092

Changes

  • CLI command is cortex, and binary name is cortex (or cortex-beta, cortex-nightly)

  • Our convention is to hyphenate name-version

  • Data folder is pending discussion on visible vs. hidden folder in #1040

Installer:

  • Windows

    • Format: .exe

    • Binary location:

      • Stable: C:\Users\<username>\AppData\Local\cortexcpp\cortex.exe

      • Beta: C:\Users\<username>\AppData\Local\cortexcpp-beta\cortex-beta.exe

      • Nighty: C:\Users\<username>\AppData\Local\cortexcpp-nightly\cortex-nightly.exe

    • Configuration file:

      • Stable: C:\Users\<username>\.cortexrc

      • Beta: C:\Users\<username>\.cortexrc-beta

      • Nighty: C:\Users\<username>\.cortexrc-nightly

    • Data folder (contains engines, models, logs)

      • Stable: C:\Users\<username>\.cortexcpp

      • Beta: C:\Users\<username>\.cortexcpp-beta

      • Nighty: C:\Users\<username>\.cortexcpp-nightly

  • Linux:

    • Format: .deb

    • Binary location:

      • Stable: /usr/bin/cortexcpp

      • Beta: /usr/bin/cortexcpp-beta

      • Nighty: /usr/bin/cortexcpp-nightly

    • Configuration file:

      • Stable: /home/<username>/.cortexrc

      • Beta: /home/<username>/.cortexrc-beta

      • Nighty: /home/<username>/.cortexrc-nightly

    • Data folder (contains engines, models, logs)

      • Stable: /home/<username>/.cortexcpp

      • Beta: /home/<username>/.cortexcpp-beta

      • Nighty: /home/<username>/.cortexcpp-nightly

  • Macos:

    • Format: .pkg

    • Binary location:

      • Stable: /usr/local/bin/cortexcpp

      • Beta: /usr/local/bin/cortexcpp-beta

      • Nighty: /usr/local/bin/cortexcpp-nightly

    • Configuration file:

      • Stable: /Users/<username>/.cortexrc

      • Beta: /Users/<username>/.cortexrc-beta

      • Nighty: /Users/<username>/.cortexrc-nightly

    • Data folder (contains engines, models, logs)

      • Stable: /Users/<username>/.cortexcpp

      • Beta: /Users/<username>/.cortexcpp-beta

      • Nighty: /Users/<username>/.cortexcpp-nightly

Thank you @dan-homebrew

hiento09 commented 1 week ago

Task to do here https://github.com/janhq/cortex.cpp/issues/1030

hiento09 commented 1 week ago

For installer, llamacpp engine will be installed by default

dan-homebrew commented 1 week ago

@hiento09 Can I clarify my understanding of the Installer, as there are a couple of things that are not aligned from our discussion last week:

Last week's discussion: https://link.excalidraw.com/l/kFY0dI05mm/3rpQK5NI8Xb

Installer Contents

Installation Methods

For the 3 operating systems, my understanding was as follows:

curl -fsSL https://get.cortex.so -o get-cortex.sh

From the post above, it seems like we're going directly to .deb and .appImage.

My question: Does the .deb and .appImage wrap the Installer Script? There are definite advantages to having a .deb and .appimage, I just want to know how much more effort it is.

Installation Logic

My understanding is that our Installation logic focuses on two tasks:

Alternatives

I am increasingly thinking that it is a better idea for us to pack a larger installer:

hiento09 commented 1 week ago

My question: Does the .deb and .appImage wrap the Installer Script? There are definite advantages to having a .deb and .appimage, I just want to know how much more effort it is.

This is an example of template structure for .deb file in linux image Yes, it wraps bash scripts and allows us to interact with hooks like pre-install, post-install, pre-uninstall, and post-uninstall. It also has installation and uninstallation functions. If we go with a bash script, then we have to write all of the above functions ourselves.

hiento09 commented 1 week ago

Link the final decision for naming here https://github.com/janhq/cortex.cpp/issues/1092