whichllm README

README проекта с github.com/Andyyyy64/whichllm. Одним файлом markdown: README.md.

whichllm

PyPI version Python 3.11+ License: MIT Tests Sponsor

Andyyyy64%2Fwhichllm | Trendshift Hacker News rank via HackerGit
Certified AI slop™, as reviewed by Hacker News.
(Joking. With a lot of help from contributors, we're working hard to un-slop it.)

The smartest model your PC can actually run, including ones you didn't know it could.

whichllm reads your GPU, RAM and memory bandwidth, works out which open models fit and how fast each one will generate, and ranks them by benchmark results. Then it prints the command that runs the top pick the way it was estimated.

日本語版はこちら

Quick start

uvx whichllm@latest

Shopping for a GPU? Simulate one:

uvx whichllm@latest --gpu "RTX 4090"

To keep it around:

uv tool install whichllm
brew install andyyyy64/whichllm/whichllm
pip install whichllm

Example

A desktop with an 8 GB RTX 4060 and 32 GB of DDR4 (output trimmed):

$ whichllm

 #  Model                         Quant   Fit       Speed     Score
 1  Qwen/Qwen3.6-35B-A3B          Q6_K    GPU+RAM   16 tok/s   68.8
 2  unsloth/gemma-4-12b-it-GGUF   IQ4_XS  Full GPU  37 tok/s   68.1
 3  google/gemma-4-26B-A4B-it     Q4_K_M  GPU+RAM   11 tok/s   64.5
 4  Qwen/Qwen3.5-9B               Q5_K_M  Full GPU  36 tok/s   64.2
 5  zai-org/GLM-4.7-Flash         Q5_K_M  GPU+RAM   15 tok/s   62.3

  #1 Qwen3.6-35B-A3B also stands in for older generations of its line:
  Qwen3.5-35B-A3B, Qwen3-30B-A3B, Qwen_Qwen3-30B-A3B-Instruct-2507-GGUF

  Run #1 with llama.cpp:
    llama-server -hf unsloth/Qwen3.6-35B-A3B-GGUF:Q6_K -c 4096 -ngl 99 --n-cpu-moe 35 -fa on

The top pick is a 35B model on an 8 GB card. It is a mixture-of-experts model, so each token only uses about 3B of its parameters. whichllm keeps attention, the shared weights and the KV cache in VRAM and leaves the experts of 35 of its 40 layers in system RAM, which is what llama.cpp's --n-cpu-moe does. The speed estimate counts only what each token reads from each place. A fits-in-VRAM check would have skipped the model, and treating it as a plain partial offload would have rated it far too slow.

On a 24 GB RTX 4090 the same logic picks Qwen3.8-27B, although Qwen3-32B also fits there at Q4_K_M. The 27B is the newer generation of the same model line at about the same size and scores higher on current benchmarks, so the 32B is not listed separately; the note under the table names it.

Speeds are estimates from memory bandwidth, not measurements of your machine. The table marks how confident each estimate is.

Here is one checked on real hardware. On a 16 GB RTX 5080 with DDR5-5600, whichllm estimates 70 tok/s for Qwen3.6-35B-A3B at Q4_K_M, with this command:

llama-server -hf unsloth/Qwen3.6-35B-A3B-GGUF:Q4_K_M -c 4096 -ngl 99 --n-cpu-moe 15 -fa on

It measured 79 tok/s on llama.cpp b11977, from a 22 GB file on a 16 GB card. whichllm bench runs the same comparison on your machine.

How it ranks

Quality comes from Artificial Analysis and LiveBench, put on one scale and averaged. --profile coding, math and vision rank on benchmarks for that task instead, such as SciCode and LiveCodeBench for coding. The Open LLM Leaderboard and Chatbot Arena are frozen, so they only score models nothing current covers, and older generations are demoted. Each match records how it was found (the exact repo, its base model, a same-family interpolation, or the uploader's own claim) and weaker matches count for less. whichllm never recommends pretrain-only base checkpoints.

To check the fit, memory is counted as weights plus a KV cache computed layer by layer from the model's config.json (grouped-query and latent attention, sliding windows, recurrent layers), plus runtime buffers. When a model does not fit in VRAM, a mixture-of-experts model first moves experts to RAM; any other model spills whole layers.

Speed is bound by memory bandwidth: the GPU reads its share of the weights at VRAM speed and the CPU reads the rest at RAM speed. Both sides are calibrated against llama.cpp runs. Every placement is held to 8 tok/s: below that, a model's quality is scaled down, so a stronger model that would answer at 3 tok/s does not outrank one that answers at 25.

The details are in Scoring and How it works.

How we test recommendations

A wrong recommendation is a bug, so the rankings have regression tests: tests/golden/.

If whichllm picks something you would not run on your hardware, open an issue with the output. The 6 GB and RTX 3060 archetypes started as reports like that (#76, #104).

Commands

whichllm                          # best models for this machine
whichllm --gpu "RTX 5060 Ti"      # simulate a GPU (add --vram 16 for a variant)
whichllm --gpu "2x RTX 3090"      # or several
whichllm --profile coding         # general, coding, vision, math, any
whichllm --context-length 64k     # long context changes what fits
whichllm --gpu-only               # only models that fit entirely in VRAM
whichllm --speed usable           # hide anything under 8 tok/s
whichllm --markdown               # pasteable table for issues and chats
whichllm --json                   # rows include placement and the run recipe

whichllm hardware                 # what was detected
whichllm engines                  # which inference engines run here
whichllm plan "qwen3 32b"         # what GPU a model needs
whichllm upgrade "RTX 4090" "RTX 5090"   # compare against candidate GPUs
whichllm run                      # download the top pick and chat with it
whichllm bench                    # measure the top pick on this machine
whichllm report                   # share that measurement in a GitHub issue
whichllm snippet                  # print Python that loads the top pick

Every option is in the CLI reference.

If LM Studio complains that a pick is slightly too large, ask for a more conservative fit:

whichllm --gpu-only --speed usable --vram-headroom 1.5GB

If an integrated GPU or unified memory is detected with the wrong limits, override them with --vram and --ram-bandwidth (see Hardware).

Run and snippet

whichllm run downloads the model and opens a chat. Without a model name it takes the top pick.

run demo

whichllm run
whichllm run "qwen 2.5 1.5b gguf"
whichllm run "phi 3 mini gguf" --cpu-only

With llama.cpp installed (brew install llama.cpp, winget install ggml.llamacpp), a GGUF model runs in its llama-cli with the flags of the printed recipe, so the chat uses the GPU and keeps MoE experts in RAM the way the ranking estimated. A named model is left to llama.cpp's automatic fit.

A GGUF model already installed in LM Studio is opened from that library instead of being downloaded again; whichllm recommend marks those rows Installed. Pass --lm-studio-path (repeatable) for a legacy or custom library:

whichllm run "qwen 2.5 1.5b gguf" --lm-studio-path /mnt/models/lm-studio

Without llama-cli, run creates a throwaway environment with uv and uses llama-cpp-python for GGUF models and transformers for the rest. PyPI only ships llama-cpp-python as source, so the first run compiles it, which took 22 minutes on a Core Ultra 9, and that build runs on the CPU only. See Run and snippet.

Where the data comes from

whichllm reads a prebuilt index: the Hugging Face model list, each family's config.json and the merged benchmark scores, rebuilt daily on GitHub Actions and published only if it passes quality checks. A cold start takes about a second and makes no Hugging Face API calls. --live fetches everything directly instead, and HF_TOKEN is used when set.

Documentation

Development

git clone https://github.com/Andyyyy64/whichllm.git
cd whichllm
uv sync --locked --dev
uv run whichllm
uv run pytest

Ranking changes need a look at the golden snapshot: uv run python scripts/update_golden.py report. See CONTRIBUTING.md.

Support

If whichllm saved you a bad download or a bad hardware purchase, sponsoring helps keep it maintained: hardware reports, benchmark updates, packaging and support for more machines. It stays open source either way.

A star helps other people find it. I'd also like to hear what it picked for your machine, so feel free to drop it in Issues.

Star History

Star History Chart

License

MIT

whichllm (Andyyyy64/whichllm)

Ищем в базе…

Что это такое?Утилита командной строки, которая подбирает лучшую локальную LLM под ваш компьютер: она сама определяет вашу видеокарту, процессор и объём памяти, а затем ранжирует подходящие модели с HuggingFace — по результатам реальных бенчмарков, а не по количеству параметров.
Это утилита для терминала или у неё есть какой-то интерфейс?Чистый CLI: одна команда выводит таблицу с объёмом памяти, примерной скоростью, типом совместимости и датой выхода. TUI нет — скриптами можно управлять через --json | jq, а --markdown выдаёт готовые таблицы GFM, которые можно вставить куда угодно.
Как её запустить?Нужен Python 3.11+, затем один раз выполните команду рекомендации — никакой настройки проекта не требуется: 'uvx whichllm@latest' для разового запуска, а если пользуетесь часто — установите пакет как следует.
Она предлагает только модели, которые целиком помещаются в VRAM?По умолчанию она смела: в рейтинг попадают варианты с частичной выгрузкой в RAM и модели на грани влезания в VRAM, если выглядят рабочими. Хотите модель, спокойно целиком помещающуюся в видеопамять, — используйте --gpu-only или --fit full-gpu, а если и так тесновато, добавьте --vram-headroom.
Она знает только фиксированный список моделей или следит за новыми релизами?Данные живые: модели берутся напрямую из HuggingFace API и кэшируются локально (модели на 6 часов, бенчмарки на 24 часа), а при отсутствии сети или лимите запросов используются отобранные вручную замороженные списки.
Нужна ли видеокарта NVIDIA или она работает ещё и с AMD, Intel, Mac и машинами без видеокарты?NVIDIA не обязательна. Утилита сама распознаёт NVIDIA, AMD, Intel, Apple Silicon и системы без видеокарты; NVIDIA определяется по умолчанию через nvidia-ml-py, а AMD и Apple Silicon подхватываются автоматически.
Как она решает, какая модель первая?Она объединяет реальные бенчмарки — LiveBench, Artificial Analysis, Aider, индекс vision, Chatbot Arena ELO, Open LLM Leaderboard — с весами по надёжности источника и занижает устаревшие результаты внутри каждой линейки моделей, чтобы модель 2024 года не обгоняла актуальную на устаревших цифрах. Каждая оценка помечена как direct/variant/base/interpolated/self-reported и соответственно дисконтируется; выдуманные заявления авторов загрузок активно отсеиваются.
Может ли она скачать и запустить модель, а не просто посоветовать?Да — 'whichllm run' создаёт изолированное окружение uv, скачивает модель и запускает интерактивный чат: GGUF через llama-cpp-python, AWQ/GPTQ и FP16/BF16 через transformers. А 'whichllm snippet' просто выводит готовый к запуску код на Python для любой модели.
Можно проверить, что потянет видеокарта, ещё до её покупки?Да — выполните 'whichllm --gpu RTX 4090', чтобы смоделировать любую карту перед покупкой; конфигурации с несколькими GPU задаются повторением флага, запятыми или записью вида '2x RTX 4090'. Обратный поиск 'whichllm plan llama 3 70b' показывает, какое железо нужно конкретной модели.
Показываемые токены в секунду — это реальные замеры?Нет — это оценки, рассчитанные из пропускной способности памяти видеокарты, квантизации, бэкенда, типа совместимости и соотношения активных и общих параметров в MoE; они показаны как диапазон для планирования с маркерами уверенности (~ или ?) и цветовой кодировкой: красный — меньше 4 tok/s, жёлтый — 4–10, зелёный — 10–30, ярко-зелёный — 30+.
Какие есть похожие проекты?rizzo-flow, SemIf-OpenJev, Soup, llmfit, cardputer-ai, unsloth, Xiaomi-OCR-0, Bonsai-demo
Автор
Andyyyy64
Размер
10.5 MB
Звёзды
6.9K
Возраст
8 мес
Коммиты · 90 дней