A benchmark tool for consumer hardware for AI inference using llm models, with version and quantization detection.
Project description
'''# Ollama Benchmark Tool
This tool provides a comprehensive benchmarking suite for Ollama models, allowing you to measure their performance on your specific hardware. It automates the process of setting up Ollama (if not already present), pulling models, running various benchmark tasks, and collecting detailed system information.
Features
- Automated Ollama Management: Automatically checks for Ollama installation, downloads and installs it if missing, and ensures the Ollama server is running.
- Ollama Version Detection: Automatically detects and reports the exact Ollama version used for the benchmark.
- Model Quantization Detection: Captures the specific quantization level of the model (e.g.,
gemma3:1b-q4_0) as this impacts performance and memory footprint. - Model Pulling: Seamlessly pulls specified Ollama models before benchmarking.
- Performance Metrics: Measures key performance indicators such as:
- Tokens per second (TPS): Overall, prompt evaluation, and response generation.
- Time to First Token (TTFT): Latency for the first token generation.
- System Information Collection: Gathers detailed hardware information (CPU, RAM, GPU, OS, device model) to provide context for benchmark results.
- Extensible Benchmark Tasks: Comes with a set of predefined benchmark tasks and is designed to be easily extensible with new tasks.
Installation
You can install the ollamabench package using pip:
pip install .
Usage
To run a benchmark for a specific Ollama model, use the following command:
python -m ollamabench.benchmark_runner <model_name> [--warmup-runs <number_of_runs>]
<model_name>: The Ollama model to benchmark (e.g.,gemma3:1b,llama2).--warmup-runs <number_of_runs>: (Optional) Number of warm-up runs before actual benchmarking. Defaults to 1.
After the benchmark completes, you will be prompted to upload the results to the Ollama Benchmark API. Pressing Enter (or typing 'y'/'yes') will upload the results, while typing 'n'/'no' will skip the upload.
Example
python -m ollamabench.benchmark_runner gemma3:1b --warmup-runs 3
The benchmark results, including system information, Ollama version, model details, and task-specific metrics, will be printed to the console.
Project Structure
src/ollamabench/benchmark_runner.py: The main script to run the benchmark.src/ollamabench/ollama_manager.py: Handles Ollama installation, server management, version detection, and model pulling.src/ollamabench/sys_info.py: Collects detailed system hardware information.src/ollamabench/benchmark_tasks.py: Defines the benchmark tasks.src/ollamabench/result_formatter.py: (If applicable) Formats the benchmark results.src/ollamabench/submission_client.py: (If applicable) Handles submission of results.
Dependencies
The project relies on the following Python libraries:
ollama: Python client for Ollama.psutil: For system and process utilities.requests: For making HTTP requests (e.g., to Ollama API, GitHub API).wmi(Windows only): For Windows Management Instrumentation.pynvml(Windows/Linux, optional): For NVIDIA GPU monitoring.
These dependencies are automatically installed when you install the package using pip.
''
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ollamabench-0.2.0.tar.gz.
File metadata
- Download URL: ollamabench-0.2.0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec294f8ba7a9e8c1402265a66d542fd2d2f8e6a84c89dd6368b4d24c733e0822
|
|
| MD5 |
1b9b34140ebe8674a7f6034afb50c9ca
|
|
| BLAKE2b-256 |
83d5a11b28ecb5611822310fdefece89f75f59b73cbe0b427ff00d508383f2ea
|
File details
Details for the file ollamabench-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ollamabench-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae7db383f7ab6cf48ce821d8194f0f4eb0af86bea6d6bda5a04b991e2f50e07e
|
|
| MD5 |
1d3468ae1be1d63f539dd855c0cfc63e
|
|
| BLAKE2b-256 |
81d002ac24357f9417b2f909914155cfd6a9bedcb3298f7ab1f9cb979b83bcd1
|