Closed dan-homebrew closed 1 month ago
@dan-homebrew , are you sure about the command cortex model pull
? Because, in cortexjs, I think we're using cortex pull
. Also, ollama is using ollama pull
.
One thing to note from the API: http://127.0.0.1:1337/v1/models/__MODELID__/pull
. The __MODELID__
has to be put inside body of the request. This is because Drogon does not play nice if __MODELID__
contains slash.
How do we represent Huggingface strings? -> Hmm, I'm not fully understand your question. Please elaborate.
How do we handle Huggingface Repos (i.e. where user has to select quantization)? -> There are some cases:
We already handled both cases above and allowing user to select a quant that they want to use. However, for now, we only support GGUF and single GGUF file repository (multile GGUF for a model is not supported at the moment)
Does Cortex need an API to get Huggingface Repo metadata? -> Yes, mostly git API. I'm not using 3rd party lib at the moment. And I don't think there's a c++ version for the lib.
Does this need to be bubbled to Jan, to support the Huggingface Repo page? -> I can't decide this. Let's discuss this. cc @louis-jan
@namchuai Can I check: can I close this issue, it seems we have implemented this already?
@dan-homebrew , this one still need my last PR to support stop download. The PR is https://github.com/janhq/cortex.cpp/pull/1460 , need some testing before I mark it Ready.
QAing: API for Huggingface repo
1. POST models/pull
starts download
2. POST models/pull
halfway shows downloaded bytes
3. DELETE models/pull
stops the download
curl --location --request DELETE 'http://127.0.0.1:39281/models/pull' \
--header 'Content-Type: application/json' \
--data '{
"taskId": <your_download_task_id>
}'
4. web sockets events emitted when model pull starts /events
5. web sockets events stopped when model pull stops /events
Pending task to add DELETE models/pull
to Swagger & docs @gabrielle-ong
Closing this huge epic, thanks @namchuai! Minor UX issue of stdout sent to CLI (inactive terminal), tracking in #1519
Goal
cortex model pull
should have clear APIs that support different model repo sourcesTasklist
CLI
API
Key Questions
Linked Issues
Jan's Requirements
Cortex should support an API, that can support the following UI: