Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

epic: Cortex Model Repo supports Default Model download #1418

@dan-menlo

Description

@dan-menlo

Goal

  • Cortex's Built-in Libraries have a "Cortex Model repo" format
  • Cortex Model Repos are a critical data structure to support cortex pull <model> and cortex run <model>

High-level Structure

  • Cortex model repos are Git repos
  • Git repo has branches, which hold different "versions" of the model (i.e. quantization, engine etc)
    • cortex run <model>:<branch> pulls a specific version
    • cortex run <model> pulls a default version
  • Git repo's "main branch" holds README and metadata, to allow user to navigate other branches

Decisions

Decision 1: Default Model Download

We need to figure out which model version cortex pull <model> and cortex run model` will pull.

Option 1: main branch

  • We have so far gone with main branch to hold our recommended version
  • We basically merge recommended version, e.g. 3b-gguf into main branch

However, I do not think this is correct long term:

  • Longer-term, I think default model selection will be algorithmic
    • e.g. Hardware detection -> pull most "optimized" model
  • main branch is non-descriptive as a branch name
    • e.g. main could hold 3b-gguf, but user is unaware
    • It is better to be upfront that we default to 3b-gguf
  • I think main branch requires more work to manage longer-term
    • Process of switching main branch will take some time - i.e. merge, git issues etc

It is also incorrect to compare our approach to Ollama. Ollama uses a tag-based system similar to Docker, where latest is a pointer to 3b. It is difficult to replicate this in a "straightforward UX" in Git (i.e. tags are not very visible from main page)

Option 2: main branch has metadata.yaml

  • I would like to instead propose a metadata.yaml approach to defining Default Model downloads
  • This can be superseded in the future with an algorithmic approach to selecting Default Model
  • metadata.yaml is also used to generate the CLI UX for cortex pull or cortex run

How it works

  • Cortex Model Repo's main branch will hold a few files (see below)
  • The v1 of metadata.yaml will be very simple
# File system
metadata.yaml
README.md
# metadata.yaml
version: 1
name: mistral
default: 3b-gguf

In the future, metadata.yaml can be more complicated, and allow for fine-grained control of CLI UX, e.g. sections for 3b, 7b, or by engine.

Furthermore, we can use metadata.yaml as a data structure to hold information about the different Model versions.

  • Can expand to include MMLU scores
  • Can expand to include file sizes
  • This can all be automated in the future through CI/CD on the Git repo

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions