feat: add llmfit budget subcommand and web Budget Advisor panel#640
feat: add llmfit budget subcommand and web Budget Advisor panel#640Clemente-H wants to merge 2 commits into
llmfit budget subcommand and web Budget Advisor panel#640Conversation
Introduces `llmfit budget <MAX_PRICE>` which, given a USD purchase budget, lists all matching hardware configurations from a built-in catalog and shows which LLM models would run on each one — using the same fit pipeline as `llmfit fit`. - Add `llmfit-core/src/hardware_catalog.rs`: static catalog of ~16 hardware configs (mini PCs, Apple Silicon, NVIDIA/AMD discrete GPUs) with prices, VRAM, RAM, and CPU specs. `configs_within_budget(max_price)` filters by price. - Add `SystemSpecs::synthetic()` constructor to `hardware.rs` for building simulated specs without real hardware detection. - Add `Budget` subcommand in `llmfit-tui/src/main.rs` with `--limit`, `--min-fit`, and `--json` flags. Supports plain, CSV, and JSON output. Closes AlexsJones#541 (hardware-aware model selection, budget variant) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add GET /api/v1/budget?max_price=N endpoint in serve_api.rs - Add fetchBudget() in api.js - Add BudgetPanel.jsx component (form + per-config model tables) - Wire up in App.jsx as an isolated BudgetSection component The panel uses existing CSS classes (simulation-panel, table-wrap, fitClass) so it matches the dashboard's visual style. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AlexsJones
left a comment
There was a problem hiding this comment.
Thanks @Clemente-H — this is a substantial, well-structured contribution: the catalog module has tests, the subcommand reuses the existing fit pipeline instead of reinventing it, and the JSON/CSV output follows the house style.
Before it can move forward there's a scope question that's the maintainer's call, plus a few technical points.
Scope (for @AlexsJones): this bakes a curated hardware price catalog into the compiled binary. Prices go stale fast (the catalog itself says "as of mid-2025" — already a year old, e.g. RTX 3090 at $700), vary by region and currency, and every price refresh becomes a code change and release. If the feature direction is wanted, it may fit better as a data file (bundled or fetched JSON with a "last updated" stamp) so the catalog can be refreshed without a release.
Technical notes in the meantime:
- The
NVIDIA L4 (24 GB) Cloud Instanceentry prices a monthly cloud cost on a purchase-price axis (its own note admits this). It will distort budget comparisons — drop it, or make cloud options a separate concept. --min-fitsilently maps any invalid value tomarginal; rejecting unknown values with an error would match the CLI's behavior elsewhere.- The
2× RTX 3090 (48 GB total)entry is modeled into_specs()as a single GpuInfo with 48 GB (count: 1). If the fit pipeline treats one 48 GB device differently from 2×24 GB tensor-parallel (it does for per-device layer fits), this overstates what that config can run.
Parking this for the maintainer's direction on the catalog approach before further iteration — the implementation itself is in good shape.
🤝 Handled by Alex's Repo Steward — replies reviewed by @AlexsJones.
Learn more or run your own: https://github.com/AlexsJones/repo-steward
Summary
Adds a hardware budget advisor feature that lets users discover which hardware configurations fit within a purchase budget and see which LLM models each configuration can run — using the same fit pipeline as
llmfit fit.llmfit budget <MAX_PRICE>— new CLI subcommand. Filters a built-in hardware catalog by price and shows ranked LLM model lists per configuration, with--limit,--min-fit,--json, and--csvsupport.llmfit-core/src/hardware_catalog.rs— static catalog of ~16 real-world hardware configurations (mini PCs, Apple Silicon, NVIDIA/AMD GPUs, ROCm cards) with prices, VRAM, RAM, and CPU specs.configs_within_budget(max_price)returns matching entries. Designed to be easy to extend.SystemSpecs::synthetic()— new constructor inhardware.rsfor building simulated specs without touching real hardware detection. Used internally byHardwareConfig::to_specs().GET /api/v1/budget?max_price=N&limit=5&min_fit=marginal— new REST endpoint inserve_api.rs.llmfit-web) — form with budget/limit/fit-level controls, renders a per-configuration table of top models using the existing CSS design system.Example
Closes #541 (hardware-aware model selection)
Test plan
cargo test -p llmfit-core—hardware_catalogunit tests pass (budget filter, empty budget, to_specs no panic)llmfit budget 800— shows ≥1 config with ranked model tablellmfit budget 800 --json— valid JSON withbudget_usdandconfigurationsarrayllmfit budget 0— prints "no configurations" message cleanlyllmfit serve→ open browser → click "💰 Budget advisor" → enter budget → results appearcurl "http://127.0.0.1:8787/api/v1/budget?max_price=800&limit=3"— returns JSON🤖 Generated with Claude Code