Skip to main content

Model ID Format

How hali names and identifies models.


Canonical model ID

Every model in the hali cache has a canonical four-part identifier:

base:size:variant:quant
PartMeaningExamples
baseThe model family / architecturemistral, llama, codellama, phi, gemma
sizeParameter count7b, 8b, 13b, 34b, 70b
variantModel variant / fine-tune typeinstruct, chat, code, base
quantQuantization method and bit widthq4_k_m, q5_k_m, q8_0, f16

Examples

mistral:7b:instruct:q4_k_m
llama:8b:instruct:q5_k_m
codellama:13b:code:q4_k_m
phi:3b:chat:q4_k_m
gemma:7b:instruct:q6_k

How the ID is derived

hali computes the canonical ID automatically from the HuggingFace repo name and GGUF filename. The parsing is heuristic and handles the most common naming conventions.

From a repo name + filename

Repo: TheBloke/Mistral-7B-Instruct-v0.2-GGUF
File: mistral-7b-instruct-v0.2.Q4_K_M.gguf

→ mistral:7b:instruct:q4_k_m

hali extracts:

  • base — from the file prefix (before the first -)
  • size — from the parameter count (7b, 8b, etc.)
  • variant — from known variant words (instruct, chat, code)
  • quant — from the quantization suffix (.Q4_K_M, .Q5_K_M, etc.)

Edge cases

If automatic parsing produces a best-guess that's ambiguous, hali uses a slug-based fallback derived from the file name. The canonical ID is always deterministic — the same repo and file always produce the same ID.


Quantizations recognized

hali recognizes standard GGUF quantization suffixes:

SuffixBitsSize (7B model)Quality
q2_k2-bit~2.8 GBMinimum viable
q3_k_s3-bit small~3.1 GB
q3_k_m3-bit medium~3.3 GB
q3_k_l3-bit large~3.5 GB
q4_04-bit~3.8 GB
q4_k_s4-bit K-small~3.9 GB
q4_k_m4-bit K-medium~4.1 GBRecommended
q5_05-bit~4.4 GB
q5_k_s5-bit K-small~4.6 GB
q5_k_m5-bit K-medium~4.8 GB
q6_k6-bit K~5.4 GBHigh quality
q8_08-bit~7.0 GBNear-lossless
f1616-bit float~14.0 GBReference (no quantization)

All suffixes are normalized to lowercase in the canonical ID (q4_k_m, not Q4_K_M).


Using model IDs with hali commands

hali pull

hali pull mistral:7b:instruct:q4_k_m # Direct — no prompts
hali pull TheBloke/Mistral-7B-Instruct-v0.2-GGUF # Repo — pick quantization
hali pull mistral # Search — pick repo and quantization

hali export

hali export ollama mistral:7b:instruct:q4_k_m
hali export lmstudio mistral:7b:instruct:q4_k_m
hali export all mistral:7b:instruct:q4_k_m

The canonical ID is always base:size:variant:quant — these are used as-is in commands.

hali list

MODEL ID SIZE DOWNLOADED
------------------------------------------ ---------- ----------
mistral:7b:instruct:q4_k_m 4.14 GB 2026-05-23

Infohash identity

In addition to the human-readable model ID, every model has a torrent infohash — the BitTorrent identity used for peer discovery and piece verification.

VersionAlgorithmLengthExample
v1SHA-140 hex charsa3f9c21b4d67e8f01a2b3c4d5e6f7890ab1cd2ef3
v2SHA-25664 hex charsf8c41dc0a13b...

At least one infohash version must be present for registry submission. The canonical hash (used as the primary key in the registry) is v2 if present, otherwise v1.


Why the canonical format?

  • Unambiguous. mistral:7b:instruct:q4_k_m is exactly one model file. No confusion about which repo or which quantization.
  • Deterministic. Two people downloading the same model version produce the same ID. This is the property that makes torrent cross-seeding work.
  • Sortable. base:size:variant:quant groups models logically — all Mistral 7B models together, sorted by quantization.
  • Scriptable. A predictable format means no parsing surprises in CI pipelines and automation.

Storage layout

The model ID maps directly to the cache directory structure:

~/.hali/cache/<base>/<size>-<variant>/<quant>/model.gguf
~/.hali/cache/<base>/<size>-<variant>/<quant>/metadata.json

Example:

~/.hali/cache/mistral/7b-instruct/q4_k_m/model.gguf
~/.hali/cache/mistral/7b-instruct/q4_k_m/metadata.json
metadata.json
{
"model_id": "mistral:7b:instruct:q4_k_m",
"hf_repo": "TheBloke/Mistral-7B-Instruct-v0.2-GGUF",
"hf_revision": "abc123",
"torrent_infohash": "a3f9c21b4d67...",
"files": ["mistral-7b-instruct-v0.2.Q4_K_M.gguf"],
"size": 4368439296,
"download_at": "2026-05-23T10:00:00Z"
}