chore: remove duplicated root data/ copies of catalog and benchmark cache

data/hf_models.json and data/benchmark_cache.json were byte-identical
copies of the files in llmfit-core/data/ (the ones actually embedded via
include_str!), adding ~11 MB of redundant git-tracked data that could
silently drift. Scrapers now write only the canonical llmfit-core/data/
path; scripts and docs updated to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Alex Jones 2026-07-02 21:44:41 +01:00
parent 5b4a37ef4e
commit cf64a5b415
9 changed files with 16 additions and 191771 deletions

View file

@ -28,7 +28,7 @@ hardware.rs SystemSpecs::detect() reads RAM/CPU via sysinfo crate.
On unified memory (Apple Silicon), VRAM = system RAM.
No async. No unsafe.
models.rs LlmModel struct. ModelDatabase loads from data/hf_models.json
models.rs LlmModel struct. ModelDatabase loads from llmfit-core/data/hf_models.json
embedded via include_str!() at compile time. No runtime file I/O.
fit.rs FitLevel enum (Perfect, Good, Marginal, TooTight).
@ -64,7 +64,7 @@ tui_events.rs Keyboard event handling with crossterm. Two modes: Normal
## Model database
- Source: `data/hf_models.json` (33 models).
- Source: `llmfit-core/data/hf_models.json` (33 models).
- Generated by `scripts/scrape_hf_models.py` (Python, stdlib only, no pip deps).
- Embedded at compile time via `include_str!("../data/hf_models.json")`.
- Schema per entry: name, provider, parameter_count, min_ram_gb, recommended_ram_gb, min_vram_gb, quantization, context_length, use_case.
@ -98,7 +98,7 @@ The scraper has hardcoded fallback entries for gated models that require authent
1. Add the model's HuggingFace repo ID to `TARGET_MODELS` in `scripts/scrape_hf_models.py`.
2. If the model is gated (requires HF auth), add a fallback entry to the `FALLBACK` dict in the same script.
3. Run `python3 scripts/scrape_hf_models.py`.
4. Verify the output in `data/hf_models.json`.
4. Verify the output in `llmfit-core/data/hf_models.json`.
5. Run `cargo build` to verify compilation.
## Adding a new filter

View file

@ -3,12 +3,12 @@
This document describes the Rust changes needed to fully support
`pipeline_tag: automatic-speech-recognition` models (Whisper variants).
The JSON data additions (`data/hf_models.json`) in this branch are ready.
The JSON data additions (`llmfit-core/data/hf_models.json`) in this branch are ready.
The Rust integration changes below are the next step — open for discussion.
## Data changes (this branch)
`data/hf_models.json` — 4 new entries with:
`llmfit-core/data/hf_models.json` — 4 new entries with:
- `pipeline_tag: "automatic-speech-recognition"`
- `capabilities: ["audio"]`
- New fields (custom, don't break existing Rust deserialization via `#[serde(default)]`):

View file

@ -577,7 +577,7 @@ llmfit plan "Qwen/Qwen2.5-Coder-0.5B-Instruct" --context 8192 --json
- **Ascend** -- Detected via `npu-smi`.
- **Backend detection** -- Automatically identifies the acceleration backend (CUDA, Metal, ROCm, SYCL, CPU ARM, CPU x86, Ascend) for speed estimation.
2. **Model database** -- Hundreds models sourced from the HuggingFace API, stored in `data/hf_models.json` and embedded at compile time. Memory requirements are computed from parameter counts across a quantization hierarchy (Q8_0 through Q2_K). VRAM is the primary constraint for GPU inference; system RAM is the fallback for CPU-only execution.
2. **Model database** -- Hundreds models sourced from the HuggingFace API, stored in `llmfit-core/data/hf_models.json` and embedded at compile time. Memory requirements are computed from parameter counts across a quantization hierarchy (Q8_0 through Q2_K). VRAM is the primary constraint for GPU inference; system RAM is the fallback for CPU-only execution.
**MoE support** -- Models with Mixture-of-Experts architectures (Mixtral, DeepSeek-V2/V3) are detected automatically. Only a subset of experts is active per token, so the effective VRAM requirement is much lower than total parameter count suggests. For example, Mixtral 8x7B has 46.7B total parameters but only activates ~12.9B per token, reducing VRAM from 23.9 GB to ~6.6 GB with expert offloading.
@ -656,7 +656,7 @@ python3 scripts/scrape_hf_models.py
cargo build --release
```
The scraper writes `data/hf_models.json`, which is baked into the binary via `include_str!`. The automated update script backs up existing data, validates JSON output, and rebuilds the binary.
The scraper writes `llmfit-core/data/hf_models.json`, which is baked into the binary via `include_str!`. The automated update script backs up existing data, validates JSON output, and rebuilds the binary.
By default, the scraper enriches models with known GGUF download sources from providers like [unsloth](https://huggingface.co/unsloth) and [bartowski](https://huggingface.co/bartowski). Results are cached in `data/gguf_sources_cache.json` (7-day TTL) to avoid repeated API calls. Use `--no-gguf-sources` to skip enrichment for a faster scrape.
@ -675,8 +675,8 @@ src/
tui_app.rs -- TUI application state, filters, navigation
tui_ui.rs -- TUI rendering (ratatui)
tui_events.rs -- TUI keyboard event handling (crossterm)
data/
hf_models.json -- Model database (206 models)
llmfit-core/data/
hf_models.json -- Model database (embedded at compile time)
skills/
llmfit-advisor/ -- OpenClaw skill for hardware-aware model recommendations
scripts/
@ -712,7 +712,7 @@ curl -sL https://opensource.org/license/MIT -o LICENSE
# Or write your own. The Cargo.toml declares license = "MIT".
```
- `data/hf_models.json` is committed. It is embedded at compile time and must be present in the published crate.
- `llmfit-core/data/hf_models.json` is committed. It is embedded at compile time and must be present in the published crate.
To publish updates:

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,6 @@ Usage:
python3 scrape_benchmarks.py --presets "RTX 4090,M4 Max" # Specific presets only
Output:
data/benchmark_cache.json (repo root, for reference)
llmfit-core/data/benchmark_cache.json (compiled into binary)
The cache format is:
@ -168,8 +167,7 @@ def main():
if i < len(presets) - 1:
time.sleep(0.5)
# Write to both locations
output_paths = ["data/benchmark_cache.json", "llmfit-core/data/benchmark_cache.json"]
output_paths = ["llmfit-core/data/benchmark_cache.json"]
for path in output_paths:
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, "w") as f:

View file

@ -2660,7 +2660,7 @@ def main():
# The database is additive: models from previous runs are preserved.
# Freshly scraped models update existing entries; historical models
# that are no longer in the top discovered set are kept as-is.
output_paths = ["data/hf_models.json", "llmfit-core/data/hf_models.json"]
output_paths = ["llmfit-core/data/hf_models.json"]
# Build a map of freshly scraped models (name -> model dict)
fresh_by_name = {m["name"]: m for m in results}
@ -2708,7 +2708,7 @@ def main():
gguf_enriched = enrich_gguf_sources(results, threads=args.threads)
print(f" Found GGUF sources for {gguf_enriched} models")
# Write to both locations: repo root (for reference) and llmfit-core (compiled into binary)
# Write to llmfit-core/data (compiled into the binary via include_str!)
for output_path in output_paths:
os.makedirs(os.path.dirname(output_path), exist_ok=True)
with open(output_path, "w") as f:

View file

@ -10,7 +10,7 @@ set -e # Exit on error
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
DATA_FILE="$PROJECT_ROOT/data/hf_models.json"
DATA_FILE="$PROJECT_ROOT/llmfit-core/data/hf_models.json"
# Colors for output
RED='\033[0;31m'
@ -103,7 +103,7 @@ echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━
echo
echo -e "${BLUE}Next steps:${NC}"
echo " • Run './target/release/llmfit' to test the updated binary"
echo " • Check 'data/hf_models.json' for the updated model list"
echo " • Check 'llmfit-core/data/hf_models.json' for the updated model list"
echo " • Example: ./scripts/update_models.sh --threads 8 --gguf-sources"
if [ ! -z "$BACKUP_FILE" ]; then
echo " • Delete backup file if satisfied: rm $BACKUP_FILE"

View file

@ -239,7 +239,7 @@ def quality_score_new(model: dict) -> float:
def main():
data_path = "data/hf_models.json"
data_path = "llmfit-core/data/hf_models.json"
with open(data_path) as f:
models = json.load(f)