Skip to main content

Tries to pick the best local llm for your computer and environment.

Project description

BestLLM logo

bestllm

Picks the most capable local LLM your machine can comfortably run, with zero guesswork.

Python Versions Status Linted with Ruff

bestllm is a hardware-aware companion inspired by Timothy Crosley's developer tools. It inspects your system, compares it against curated model profiles, and returns the right local model for the job—no spreadsheet required.

Highlights

  • Understands your hardware with lightweight, cross-platform detection.
  • Ships with curated GPU and CPU friendly GGUF profiles and their resource budgets.
  • Provides a friendly CLI plus a composable Python API for deeper integrations.
  • Fails fast with actionable messages when your machine does not meet a model's needs.
  • Designed to be extended: drop in new profiles or swap out detectors without rewriting core logic.

Quick Start

Installation

python -m pip install -e .

Need dev tooling too? Grab the extras:

uv pip install --group dev .

Run the CLI

bestllm
# or
python -m bestllm

Expect output similar to:

Recommended model: llama3-8b-instruct-q4 (8,192 token context window).
Summary: requires >= 16GB RAM, >= 4 CPU cores, 10 GPU VRAM requirement.
Detected GPU VRAM: 12GB — using GPU-friendly profile.

Use from Python

from bestllm import best_local_llm

profile = best_local_llm()
print(profile.name)
print(profile.as_dict())

How It Works

  • bestllm.hardware.HardwareSpecs captures total RAM, CPU cores, and GPU VRAM.
  • bestllm.models defines the catalog of ModelProfile objects (size, context window, and resource requirements).
  • bestllm.selector.recommend_model_for_specs scores the catalog against your hardware and raises a clear error if nothing fits.
  • bestllm.__init__ exposes a minimal API and wires everything into the console script entry point.

Extending the Model Catalog

  1. Open src/bestllm/models.py and add a ModelProfile to DEFAULT_MODEL_PROFILES.
  2. Document resource requirements and noteworthy constraints in the notes field.
  3. Re-run bestllm to confirm the new profile appears when the hardware qualifies.
  4. Add targeted tests under tests/models/ (mirroring the src/bestllm layout) to lock down the new behavior.

Configuration Tips

  • Pair bestllm with your runner scripts to auto-pick the right gguf file before launch.
  • Override hardware detection in constrained environments by instantiating HardwareSpecs manually and passing it to recommend_model_for_specs.
  • Guard long-context models behind feature flags so CI and lightweight machines stick to CPU options.

Roadmap

  • Smarter scoring that accounts for quantization preferences and batching strategies.
  • Built-in adapters for popular launchers (Ollama, llama.cpp, vLLM) via optional extras.
  • Configurable profile sources (TOML/JSON) so catalogs can live outside the codebase.
  • Hardware detection helpers for AMD and Apple GPUs without shelling out to vendor tools.

Contributing

  • Ensure ruff check src and ty src pass before sending a PR.
  • Keep new features isolated in their own modules under src/bestllm/ and surface them through bestllm.__init__.
  • Add or update tests/ alongside feature changes; we mirror the runtime package layout for discovery.
  • Share CLI transcripts or screenshots when behavior changes—context speeds up reviews.

Inspiration & Credits

bestllm follows the pragmatic tooling ethos of Timothy Crosley projects: approachable defaults, thoughtful ergonomics, and extensibility baked in. Thanks for exploring, and feel free to shape the future roadmap with issues or discussions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bestllm-0.0.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bestllm-0.0.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file bestllm-0.0.1.tar.gz.

File metadata

  • Download URL: bestllm-0.0.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for bestllm-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e4ebf435622a645ce1c21e82b1bbb5c37120585b26c8069bc3428c4f1e4e199e
MD5 7ea14918fffc04142eb2f27dccb9639d
BLAKE2b-256 73540d6e70c23c8b5e08bf102c552378ba82cb4d509bd7f5b861f52d658a06af

See more details on using hashes here.

File details

Details for the file bestllm-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: bestllm-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for bestllm-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88bdeb217d8f170336e945793973525819097f20bb736800a5e91658222af0bd
MD5 3413fb379d94de0535733ff3d23fa84f
BLAKE2b-256 333ad81983ccf2496581897460f51436a1cfe4414e5a181ad35d7ec734da7217

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page