Skip to content

feat: add llmfit budget subcommand and web Budget Advisor panel#640

Open
Clemente-H wants to merge 2 commits into
AlexsJones:mainfrom
Clemente-H:feat/budget-hardware-catalog
Open

feat: add llmfit budget subcommand and web Budget Advisor panel#640
Clemente-H wants to merge 2 commits into
AlexsJones:mainfrom
Clemente-H:feat/budget-hardware-catalog

Conversation

@Clemente-H

Copy link
Copy Markdown

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 --csv support.
  • 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 in hardware.rs for building simulated specs without touching real hardware detection. Used internally by HardwareConfig::to_specs().
  • GET /api/v1/budget?max_price=N&limit=5&min_fit=marginal — new REST endpoint in serve_api.rs.
  • Budget Advisor panel in the web dashboard (llmfit-web) — form with budget/limit/fit-level controls, renders a per-configuration table of top models using the existing CSS design system.

Example

$ llmfit budget 800
=== Hardware Budget: up to $800 ===
10 configuration(s) found

┌─ Mac mini M4 Pro (24 GB) — $799 │ 24 GB VRAM │ 24 GB RAM │ 14 cores │ Metal
│  Note: Unified memory; 24 GB pool, excellent perf/watt
...
┌─ RTX 3090 (24 GB) PC — $700 │ 24 GB VRAM │ 32 GB RAM │ 12 cores │ CUDA
...

$ llmfit budget 800 --json
$ llmfit budget 1500 --limit 10 --min-fit good

Closes #541 (hardware-aware model selection)

Test plan

  • cargo test -p llmfit-corehardware_catalog unit tests pass (budget filter, empty budget, to_specs no panic)
  • llmfit budget 800 — shows ≥1 config with ranked model table
  • llmfit budget 800 --json — valid JSON with budget_usd and configurations array
  • llmfit budget 0 — prints "no configurations" message cleanly
  • llmfit serve → open browser → click "💰 Budget advisor" → enter budget → results appear
  • curl "http://127.0.0.1:8787/api/v1/budget?max_price=800&limit=3" — returns JSON

🤖 Generated with Claude Code

Clemente-H and others added 2 commits June 17, 2026 11:59
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 AlexsJones left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. The NVIDIA L4 (24 GB) Cloud Instance entry 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.
  2. --min-fit silently maps any invalid value to marginal; rejecting unknown values with an error would match the CLI's behavior elsewhere.
  3. The 2× RTX 3090 (48 GB total) entry is modeled in to_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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature roadmap: top three needed features for llmfit

2 participants