whichllm

命令行工具

Andyyyy64/whichllm

通过真实基准测试找到最适合你硬件的本地LLM。

项目简介

自动检测GPU/CPU/RAM,根据基准测试质量和速度对HuggingFace模型排名。支持硬件模拟、JSON输出和即时聊天。

README 预览

# whichllm\n\n[](https://pypi.org/project/whichllm/)\n[](https://www.python.org/downloads/)\n[](https://opensource.org/licenses/MIT)\n[](https://github.com/Andyyyy64/whichllm/actions/workflows/test.yml)\n[](https://github.com/sponsors/Andyyyy64)\n\n**Find the best local LLM that actually runs on your hardware.**\n\nAuto-detects your GPU/CPU/RAM and ranks the top models from HuggingFace that fit your system.\n\n[日本語版はこちら](docs/README.ja.md)\n\n## Quick start\n\nRun the recommendation command once, with no project setup.\n\n```bash\nuvx whichllm@latest\n```\n\nSimulate a GPU before you buy hardware.\n\n```bash\nuvx whichllm@latest --gpu "RTX 4090"\n```\n\nInstall it when you use it often.\n\n```bash\nuv tool install whichllm\nuv tool upgrade whichllm  # update an existing install\n```\n\nOther install paths.\n\n```bash\nbrew install andyyyy64/whichllm/whichllm\npip install whichllm\n```\n\n## Common workflows\n\nAfter install, run `whichllm` directly. For one-off runs, replace `whichllm`\nwith `uvx whichllm@latest`.\n\n```bash\n# Best models for this machine\nwhichllm\n\n# Pretend you have a specific GPU\nwhichllm --gpu "RTX 4090"\n\n# Compare upgrade candidates\nwhichllm upgrade "RTX 4090" "RTX 5090" "H100"\n\n# Find the GPU needed for a model\nwhichllm plan "llama 3 70b"\n\n# Start a chat with a model\nwhichllm run "qwen 2.5 1.5b gguf"\n\n# Print copy-paste Python\nwhichllm snippet "qwen 7b"\n\n# Return JSON for scripts\nwhichllm --top 1 --json\n```\n\n\n\n## See it\n\n```text\n$ whichllm --gpu "RTX 4090"\n\n#1  Qwen/Qwen3.6-27B     27.8B  Q5_K_M   score 92.8    27 t/s\n#2  Qwen/Qwen3-32B       32.0B  Q4_K_M   score 83.0    31 t/s\n#3  Qwen/Qwen3-30B-A3B   30.0B  Q5_K_M   score 82.7   102 t/s\n```\n\nThe 32B model **fits your card fine** — whichllm still ranks the 27B #1,\nbecause it scores higher on real benchmarks and is a newer generation.\nA size-only "what fits?" tool would hand you the bigger one. That gap is\nthe whole point of whichllm. (Note #3: a MoE model

常见问题 (5)

故障排除
如何修复 whichllm 对特定 Hugging Face repo ID 提示 "No model found matching" 的问题?

将 whichllm 升级到 v0.5.18 或更高版本,该版本新增了对 Hugging Face 仓库 ID 的精确查找功能:

python -m pip install -U "whichllm>=0.5.18"

如果是通过 Homebrew 安装的,请升级 whichllm 的 tap/formula,然后运行:

whichllm plan ilsp/Llama-Krikri-8B-Instruct

如需 JSON 输出:

whichllm plan ilsp/Llama-Krikri-8B-Instruct --json

当你传入精确的 owner/repo ID 时,如果该仓库不在缓存的模型目录中,v0.5.18+ 会直接从 Hugging Face 获取该仓库。它还会遵循 HF_ENDPOINT 环境变量。

来源 Issue #163
故障排除
I want to flag a couple of things before trying to help, because I can't verify the specifics in your question: **"Qwen3.8-27B" doesn't match any model I know of.** The actual Qwen3 lineup from Alibaba includes sizes like 0.6B, 1.7B, 4B, 8B, 14B, 32B, plus MoE variants (30B-A3B and 235B-A22B). There's no 3.8 version and no 27B size. You might be thinking of: - **Qwen3-32B** — the closest Qwen model to that size - **Gemma 2 27B** or **Gemma 3 27B** — Google's models, which do come in a 27B size - **Qwen2.5-32B** — an earlier generation option **I'm also not familiar with a tool called "whichllm."** It may be a smaller or newer site/tool I don't have reliable information about, so I can't speak to its specific behavior or settings. That said, here's general advice for when a model is missing from an LLM recommendation tool: - **Check the exact name** — tools often index models by their Hugging Face repo ID (e.g., `Qwen/Qwen3-32B`), so search for that rather than a shorthand name - **Look at the tool's filters** — many filter by license, open weights, context length, release date, or whether benchmark data exists - **Check how current the database is** — recommendation tools often lag weeks or months behind new releases - **Cross-reference directly** — the model's Hugging Face page or the provider's docs are the authoritative source for specs, even if a comparison site hasn't listed it yet If you can tell me which tool you're actually using and which model you meant, I can give you more specific guidance.

将 whichllm 升级到 **v0.5.18 或更高版本**。旧版本排除了 Qwen/Qwen3.8-27B,因为其 Hugging Face image-text-to-text 标签被视为纯视觉模型,将 Qwen 的次要版本合并为单一的 qwen3-27b 家族,并使用了过时的基准/谱系数据,导致 Qwen3.6 排名偏高。

使用以下命令运行修复后的版本:

uvx whichllm@0.5.18

或:

uvx whichllm@latest

在 v0.5.18 中,分组时会保留检查点版本和组织标识,并纳入更新的 Qwen 版本。在维护者的 M2 Max 96 GB 对比测试中,Qwen3.8-27B 从缺席前十名跃升至第二名。在旧版本中,使用 vision 或 any 配置文件/include_vision=True 只能绕过抓取过滤器;排名和分组问题仍需通过升级解决。

来源 Issue #171
故障排除
如何修复 whichllm 在读取 models.json 或 benchmarks.json 时因 UnicodeDecodeError 而崩溃的问题?

将 whichllm 升级到 0.5.17 或更高版本,该版本会将非 UTF-8 缓存文件视为已损坏的缓存并进行刷新,而不是崩溃:

python -m pip install --upgrade whichllm

如果是通过 Homebrew 安装的:

brew update
brew upgrade whichllm

作为旧版本上的临时解决方法,可以从 whichllm 缓存目录中删除已损坏的 models.json 和/或 benchmarks.json 文件,然后再次运行 whichllm,以便重建缓存。

来源 Issue #160
故障排除
在基准测试收集期间对已存档的 Open LLM Leaderboard 进行分页时,如何修复 HTTP 429 速率限制错误?

升级到 whichllm v0.5.20 或更高版本。此版本遵循数值型和 HTTP-date 格式的 Retry-After 响应头,为已归档的 Open LLM Leaderboard 采用特定于来源的有界重试设置,并在重试后后续页面仍被限流时保留已抓取的页面。重新运行收集;部分结果会缓存 24 小时,缓存的运行不会重复显示抓取警告。使用 --refresh 可强制重新获取分数。如果榜单第一页因 429 失败,该来源仍会失败,因为此时尚未保留任何页面。

来源 Issue #180
故障排除
AA 重做其指数后,如何修复过时的 AA Intelligence Index 分数和排名?

升级到 whichllm v0.5.20 或更高版本。v0.5.15 重新校准了 _AA_INDEX_MIN/_AA_INDEX_MAX,并针对重做后的评分体系刷新了 AA 回退快照;v0.5.20 完成了修复,允许有限的实时 AA 分数替换已存储的分数,即使这些分数降低或变为零。未出现在实时响应中的模型将保留其已存储的分数。升级后,请使用 --refresh 运行,以绕过任何现有的基准测试缓存并强制获取全新数据:whichllm --refresh(或适用于您安装方式的等效命令)。

来源 Issue #101