Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Discussion: Cortex.cpp Model and model.yaml #1090

Closed
dan-menlo opened this issue Sep 4, 2024 · 4 comments
Closed

Discussion: Cortex.cpp Model and model.yaml #1090

dan-menlo opened this issue Sep 4, 2024 · 4 comments
Assignees
Labels
P1: important Important feature / fix

Comments

@dan-menlo
Copy link
Contributor

dan-menlo commented Sep 4, 2024

Overview

Docs

@freelerobot
Copy link
Contributor

freelerobot commented Sep 4, 2024

Data Folder Questions

  1. What is the data structure of ~/.cortexcpp/models?
    Where do the following go
  • model yaml
  • model binaries, especially of multiple binaries (model_1_of_5.bin)
  • versions of the same model, e.g. llama3.1, llama3.2
  • presets (if any, can also defer for later discussion)
  1. Is our preference on a more flat folder structure? rather than super nested?

  2. Previously, we had many bugs resulting from expecting folder & file names to be a certain way.
    e.g. we expected unique_model_id (used by backend) to be the same as the model folder name
    Something to be aware of in this iteration 🙏

Model Downloading

  1. What happens when model download fails halfway (e.g. internet disconnected)?
  2. How do we detect models? e.g. if users "import models locally" would it still work
  3. How do we version models?
  • If we update our model.yaml, or remote model binary in the HF branch, will download still work?
  • Or will "redownloading/updating" fail due to "model exists"
  1. Letting users do cortex models update is currently out of scope right?

Model importing

  1. Can users import existing models?
  2. Is it hard copy or symlink

Model YAML

  1. We are auto populating the model.yaml if user downloads a new GGUF file (not from our HF repo)?
  2. What happens when user deletes the YAML accidentally?
  3. What happens when YAML is there but Binary is deleted? (should we spec little unit tests like this)
  4. Is this up to date? https://cortex.so/docs/model-yaml/
  5. If users update YAMLs, when do changes take effect?

@vansangpfiev
Copy link
Contributor

Data Folder Questions

Q 1. What is the data structure of ~/.cortexcpp/models?

~/.cortexcpp/
|___ models
       |__ tinyllama.yaml
       |__ tinyllama
       |     |__ model_01.gguf
       |     |__ model_02.gguf
       |     |__ model.yml
       |__ llama3.1
       |__ llama3.2

After downloading model (from cortexso or other HF repository), cortex generates tinyllama.yaml file which is used for model management.

Q 2. Is our preference on a more flat folder structure? rather than super nested?
Can you give an example of the flat folder structure?
Q 3. Can you elaborate more about the issue? Do we have any ticket to track that issue yet?

Model importing
Q 1. Can users import existing models?

  • We don't support it yet. TBD when we will support it.
    Q 2. Is it hard copy or symlink
  • It will be a symlink

cc: @0xSage

@nguyenhoangthuan99
Copy link
Contributor

nguyenhoangthuan99 commented Sep 5, 2024

Model Yaml

  1. Folder structure:
~/.cortexcpp/
|___ models
       |__ tinyllama.yaml
       |__ tinyllama
       |     |__ model_01.gguf
       |     |__ model_02.gguf
       |     |__ model.yml
       |__ llama3.1
       |__ llama3.2
  1. With model not from cortexso:
  • When model is downloaded, it will parse and save information to <model_id>/model.yml and <model_id>.yaml, this 2 files is the same.
  • When user delete 1 of 2 .yaml file. We can provide a command to recover it like cortex-cpp models recover, to check and resolve yml error.
  1. when YAML is there but binary is deleted, will raise No such file or directory error when load models.
  2. The doc from https://cortex.so/docs/model-yaml/ is up to date.
  3. To apply update user need to stop running models and re run chat to load new configuration

@namchuai
Copy link
Contributor

namchuai commented Sep 5, 2024

Model Downloading

  1. What happens when model download fails halfway (e.g. internet disconnected)?
  • We don't support resume failed/pause download.
  • If model download is failed, its <model_id>.yaml (inside <data_folder>/models) won't be created and won't display in our model list.
  1. How do we detect models? e.g. if users "import models locally" would it still work
  • Scan for <model_id>.yaml file inside <data_folder>/models.
Screenshot 2024-09-05 at 08 52 40
  1. How do we version models?
  • Currently, we using a field version inside yaml file to store the model's version. Please not that we don't have logic to support model update at the moment. For now, Version is just for display purpose.

3.1. If we update our model.yaml, or remote model binary in the HF branch, will download still work? Or will "redownloading/updating" fail due to "model exists"

  • It will display model exists.
  1. Letting users do cortex models update is currently out of scope right?
  • Yes, it is. We haven't work on this.

@janhq janhq locked and limited conversation to collaborators Sep 5, 2024
@dan-menlo dan-menlo converted this issue into discussion #1113 Sep 5, 2024
@github-project-automation github-project-automation bot moved this from Need Investigation to Completed in Jan & Cortex Sep 5, 2024
@dan-menlo dan-menlo moved this from Completed to Discontinued in Jan & Cortex Sep 6, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
P1: important Important feature / fix
Projects
Archived in project
Development

No branches or pull requests

5 participants