ollama-benchmark is a local large language model throughput benchmarking tool based on Ollama. Through a simple cross-platform command-line interface, it measures and displays the actual running speed of local LLMs in tokens-per-second.
Purpose This tool is designed to help users quantify the inference performance of local LLMs. It answers a core question: how fast is your local model really? By generating tokens per second, users can compare performance differences across different models and hardware configurations, thereby providing a basis for model selection and hardware upgrades.
Main Capabilities
- Cross-platform support: can run on Windows, Linux, and macOS.
- Automatic memory detection and model pulling: the program detects the system RAM size and, based on memory capacity, automatically checks and implicitly pulls the required models. For example, when RAM is between 4GB and 7GB, it checks gemma:2b; when between 7GB and 15GB, it checks a set of models; when between 15GB and 31GB, it checks larger models; when over 31GB, it checks even larger models.
- Memory-to-model correspondence hints: 7B models can run on machines with 8GB RAM, while 13B models require 16GB RAM.
- Custom benchmarks: supports specifying custom benchmark models through YAML format files, and model names must be enclosed in double quotes. Custom benchmarks preferentially use models already installed in Ollama, and only pull from the registry those that are not installed. The default benchmark continuously updates its configured models.
- Remote result reporting: supports sending system information and benchmark test results to a remote server (Example #1), or choosing not to send them (Example #2).
- Specify the Ollama executable path: when users have built a development version of Ollama themselves, they can explicitly specify the path to run the benchmark (Example #3).
Usage Prerequisites: a working Ollama installation is required. A virtual environment can be created via python3 -m venv or uv (Python 3.13 with uv is recommended). The installation steps vary depending on the Python environment, and the tool has been tested on Python 3.10 and above. General users can install and use it directly, and there are also video-format installation and usage instructions. For developers, Python Poetry can be used for manual installation (advanced), in order to develop new features on Windows PowerShell, Ubuntu Linux, or macOS. Usage examples include: sending/not sending system information and results to a remote server, specifying the Ollama path, and running custom benchmark models (requiring the path to a custom benchmark file).
Applicable Scenarios
- Local LLM performance evaluation: compare the throughput of different models on the same hardware.
- Hardware selection reference: based on the relationship between memory and model size, determine which models a device is suitable for running.
- Model screening: choose practically usable models based on throughput data.
- Development and testing: developers can extend new features based on this tool or integrate it into automated workflows.
Limitations
- Depends on the Ollama environment; Ollama must be installed and running in advance.
- Requires Python 3.10 or above.
- Automatically pulling models consumes network bandwidth and disk space, and speed is affected by the network.
- Custom benchmark models must follow the YAML format, and model names must use double quotes.
- The tool mainly measures throughput (tokens/s), and does not involve generation quality or other metrics.
- More technical details, such as the specific list of supported models, detailed benchmark parameters, and result output format, are not yet provided.