Skip to main content

localtune

Benchmark local LLMs on your own hardware, and find out which model, quantization and KV cache setting runs best on your machine.

Each run measures:

Metric Meaning
Prefill tok/s How fast the model reads your prompt
Decode tok/s How fast it writes the answer
TTFT ms Time to first token: the wait before the answer starts
Peak VRAM GB GPU memory used at the busiest moment
Avg / peak W GPU power draw
Energy Wh Electricity the GPU used during the run
Cost That energy times an electricity price

Install

localtune needs Python 3.10 or newer and, for benchmarks, an NVIDIA graphics card. It runs on Windows and Linux.

pip install localtune

or, with uv:

uv tool install localtune

Quick start

Check that your computer is ready. localtune offers to install llama.cpp if it's missing:

localtune doctor

See whether a model fits on your GPU and how fast it should write, before downloading it:

localtune predict qwen3:14b

Benchmark any model from Ollama's library, or a .gguf file. A model you don't have yet is downloaded first; Ollama itself doesn't need to be installed:

localtune run qwen3:14b

Find the fastest llama.cpp settings for it on your computer, and get a ready-to-use llama-server command:

localtune tune qwen3:14b

Benchmark every model you have in Ollama, one after another:

localtune sweep

See your saved runs, or save them all to a CSV file:

localtune results
localtune results --csv runs.csv

Run localtune on its own to list every command, and add --help to any command for its options. Runs are saved in ~/.localtune (set LOCALTUNE_HOME to use another folder) and stay on your computer.

Data sources

Electricity cost uses the most local price localtune has: your zip code, then your state or country, then the US average. A price per kWh that you give yourself always replaces these. Each cost records which price it was based on.

Price Source Covers License
US zip codes NREL, U.S. Electric Utility Companies and Rates (2023), scaled by each state's change since 2023 (EIA) Zip codes where one company both sells and delivers power CC BY 4.0
US states EIA-861M monthly sales and revenue by state, last 12 months All 50 states and DC Public domain
Countries Eurostat, electricity prices for household consumers (nrg_pc_204), all taxes included, in euros 41 European countries CC BY 4.0
US average EIA Short-Term Energy Outlook, October 2026 Whole US Public domain

The tables in src/localtune/data/ are built from these sources by scripts/build_price_tables.py.

The KV cache quality check reads the test set of WikiText-2 (Wikipedia articles, Merity et al., 2016, CC BY-SA 3.0), the same text llama.cpp's own quality comparisons use. It isn't included in localtune: it is downloaded the first time it's needed.

License

Apache 2.0

Metadata

Release files for localtune 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localtune 0.2.2
File Size Uploaded Provenance Actions
localtune-0.2.2.tar.gz 258.1 kB Without provenance Details for localtune-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for localtune 0.2.2
File Interpreter ABI Platform Actions
localtune-0.2.2-py3-none-any.whl Python 3 none any Details for localtune-0.2.2-py3-none-any.whl

Total release size: 534.1 kB

Release files / localtune-0.2.2.tar.gz

Download URL localtune-0.2.2.tar.gz
Size 258.1 kB
Tags Source
SHA-256 checksum
How to use checksums
720f19828c2b8a275656de2a3c5714fd7992496d4231e430087aa4f26966f244
BLAKE2b-256 checksum
How to use checksums
ddc88813d43b3c5d1e220069e110af5e78981f59c21047b72a29b58fed216944
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / localtune-0.2.2-py3-none-any.whl

Download URL localtune-0.2.2-py3-none-any.whl
Size 276.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7782e88654c70bd8873c6b5917e2f8d0249c1b14d1beea002526b992ac697bb
BLAKE2b-256 checksum
How to use checksums
f6eabdabd0d66bb35bf8fe8f8c4529e2288bd7cc154e277f7c8501cfaffa9bdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for localtune 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page