-
Notifications
You must be signed in to change notification settings - Fork 164
epic: SQLite database implementation #1241
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
Comments
Problem
Success Criteria
Related Questions
llama3 local imported /Users/nicolezhu/cortexcpp-nightly/models/imported/llama3.yml llama3 READY
TldrAt the moment, the current models.list design is complicated. I am worried ab out the long term maintainability and edge cases.
My 2cents:
cc @dan-homebrew |
cc @louis-jan to take a look and lets discuss here 🙏 |
This is our final model folder structure from this discussion #1154
So we are aiming to make
|
Gotcha, much of the above makes sense:
|
|
👍 all of the above makes sense, thank you for the clarification
…On Mon, Sep 23, 2024 at 6:30 PM nguyenhoangthuan99 ***@***.***> wrote:
6. Model Metadata and Configuration:
- model.list: This is a header/metadata index containing information
to identify models.
- model.yml: This is a configuration file that includes information
for loading and running models. In the future, it may also be used for
features like recommending inference parameters(ngl, context length) based
on model specifications.
- author_repo_id and branch_name: These are not used for inference
purposes. They are sometimes included in the name and model fields,
but name and model primary purpose is to help the LlamaCpp engine
distinguish between different models.
7.
- We can add the necessary folder structure during the installation
step. I'll collaborate with Hien on implementing this.
- Currently, both the engines and models folders are created
automatically when they're not found at the first run.
- For development purposes, I need to create a models.list file to
prevent crashes when running test cases in the Continuous Integration (CI)
environment.
—
Reply to this email directly, view it on GitHub
<#1241 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQVWFCH7XQ5NOPFMVVNL46LZX7UTZAVCNFSM6AAAAABOMSC6AWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRXHAYTKMZUGQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
@0xSage @nguyenhoangthuan99 @louis-jan: If we are eventually going to move to a simple SQLite database for model management, I would prefer to do it now: SQLite vs. models.list
Versioning & Migration
|
@nguyenhoangthuan99 @vansangpfiev @louis-jan @namchuai Let's start dealing with Model List as a SQLite database, and thinking through clearly what we need for Cortex to function. I also see SQLite database would also allow us to track things like
However, I note in our discussion, the example seems to have a
As part of this discussion exercise, can we do a few mockup entries, to see whether our assumptions work?
|
IMO, I'm happy with using database approach. File-based approach does not play well with migration.
|
I agree with the database approach. @nguyenhoangthuan99 implemented a good interface for model.list, so only need to change the implementation to replace it with database. |
Implement a ModelListUtils class base on this discussion #1154
Overview
The
ModelListUtils
class provides a robust and thread-safe interface for managing a list of machine learning models. It handles operations such as adding, updating, deleting, and retrieving model information, with a focus on maintaining unique identifiers for each model.Key Features
Main Components
ModelEntry Struct
Represents a single model entry with fields:
model_id
: Unique identifier for the modelauthor_repo_id
: Author or repository identifierbranch_name
: Branch name in the repositorypath_to_model_yaml
: Path to the model's YAML filemodel_alias
: Shortened alias for the modelstatus
: Current status of the model (READY or RUNNING)ModelListUtils Class Methods
LoadModelList()
SaveModelList()
GetModelInfo(identifier)
AddModelEntry(new_entry, use_short_alias)
UpdateModelEntry(identifier, updated_entry)
DeleteModelEntry(identifier)
PrintModelInfo(entry)
GenerateShortenedAlias(model_id, entries)
Alias Generation Logic
The
GenerateShortenedAlias
function creates aliases in the following order:model_id_xxx
)llama3.1-7b-gguf:model_id_xxx
)bartowski:llama3.1-7b-gguf/model_id_xxx
)huggingface.co:bartowski/llama3.1-7b-gguf/model_id_xxx
)It returns the shortest unique alias, appending a numeric suffix if necessary to ensure uniqueness.
The text was updated successfully, but these errors were encountered: