janhq / cortex.cpp

Local AI API Platform
https://cortex.so
Apache License 2.0
2.06k stars 116 forks source link

planning: `cortex engines update` #1638

Open gabrielle-ong opened 1 day ago

gabrielle-ong commented 1 day ago

Problem

Discussion:

  1. Should we align the cortex.llama-cpp version names with upstream llama.cpp eg 0.1.37-b4033 instead of our date format 0.1.37 to 0.1.37-01.11.24
  2. cortex engines update llama-cpp: we should have a way to update engines when new engines are available, and delete the old version?
  3. Idea: cortex update also updates engines

Success Criteria

Tasklist

namchuai commented 9 hours ago

cortex engines install llama-cpp did not install the latest sub(?) version, it still installed v0.1.37

It's because we are using API to get latest version from Github and the latest version returned is v0.1.37.

curl -s "https://api.github.com/repos/janhq/cortex.llamacpp/releases/latest" | jq -r .tag_name
v0.1.37

So it will update the latest version after we mark a version as a stable release. IMHO, this is good for us. Since pre-release version can have some bug and we don't want to disturb the broad user base. We can promote a pre-release to stable when we feel confident to do so.

This required manual cortex engines install llama-cpp -v v0.1.37-01.11.24. I would have not known there was a newer version without looking at the releases page

You can use the below command to print a list of available versions.

cortex engines install llama-cpp -m

I think we need better wording here. However, I have to add flag -m to have backward compatibility supported (cortex engines install llama-cpp will behave like before - install latest compatible llama-cpp)

===

  1. Should we align the cortex.llama-cpp version names with upstream llama.cpp eg 0.1.37-b4033 instead of our date format 0.1.37 to 0.1.37-01.11.24

I'm ok with this. But @hiento09 will need to help on CI part.

  1. cortex engines update llama-cpp: we should have a way to update engines when new engines are available, and delete the old version?

cortex engines update llama-cpp will update the latest version. I tested it with below steps

Idea: cortex update also updates engines

It's not difficult to implement. However, IMO, it's not a good idea, I think we should do thing explicitly. I would go with the path that telling user we have new version of engine them. If they want they can update it.