Skip to main content

A benchmarking framework for Ollama models

Project description

local-inferbench

A benchmarking framework for Ollama models. Think pytest for local LLM performance.

Run standardized benchmarks across Ollama models. Collect hardware-aware metrics, quality scores, and compare results over time.

Installation

pip install local-inferbench

With GPU monitoring (NVIDIA):

pip install local-inferbench[gpu]

Quick Start

CLI

# Run a benchmark (includes quality scoring by default)
inferbench run --model qwen3:0.6b --profile quick

# Compare multiple models in one run (shows comparison table at the end)
inferbench run --model qwen3:0.6b --model qwen3:1.7b --profile quick

# Compare last 2 runs
inferbench compare --last 2

# Get model recommendations for your hardware
inferbench recommend --suggest-pull

# Re-score a past run with per-prompt breakdown
inferbench score 1

# View run history
inferbench history

# Export results
inferbench export 1 --format json --output results.json

# List available profiles
inferbench profiles

# Show hardware info
inferbench info

Python API

from local_inferbench import Benchmark, BenchmarkConfig

bench = Benchmark(models=["qwen3:0.6b"], config=BenchmarkConfig(profile="quick", warmup_runs=2))
results = bench.run()
results[0].summary()

Compare Multiple Models

from local_inferbench import Benchmark, BenchmarkConfig
from local_inferbench.results import ComparisonResult

bench = Benchmark(
    models=["qwen3:0.6b", "qwen3:1.7b"],
    config=BenchmarkConfig(profile="quick"),
)
results = bench.run()

comparison = ComparisonResult(results=results)
comparison.table()
print(f"Fastest: {comparison.fastest().model_id}")

Model Recommendations

from local_inferbench import recommend_models

# Get recommendations for installed models based on your hardware
recs = recommend_models()
for r in recs:
    print(f"{r.model_name}: {r.tier} ({r.estimated_vram_gb:.1f} GB)")

Features

Performance Metrics

  • Time to First Token (TTFT): mean, median, p95, min, max
  • Throughput: tokens/sec mean, median, p95
  • Prompt eval speed: prompt tokens processed per second
  • Hardware: GPU utilization, VRAM usage, CPU usage, RAM usage (sampled in background)

Quality Scoring

  • Length: Is the response appropriately sized for the category?
  • Coherence: Repetition detection, entropy analysis, structural checks
  • Relevance: Keyword overlap with prompt, echo detection
  • Completeness: Did the model finish naturally or get truncated?
  • Category-specific: Code patterns for code prompts, step-by-step for reasoning, structured output for extraction, etc.

Hardware-Aware Model Recommendations

  • Estimates VRAM requirements from model size and quantization
  • Classifies models as optimal/feasible/too_large for your hardware
  • Suggests well-known models to download that fit your system

Benchmark Profiles

Profile Prompts Purpose
quick 10 Fast sanity check across core categories
standard 50 Thorough benchmark across diverse categories
stress 20 Sustained throughput with long-form generation

Custom profiles are supported via YAML files — pass a file path to --profile.

Results Storage

Results are stored in SQLite at ~/.local-inferbench/results.db. Use inferbench history to browse, inferbench compare to diff runs, and inferbench export to get JSON/CSV.

Requirements

  • Python 3.10+
  • A running Ollama server

License

MIT

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

local_inferbench-0.3.0.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

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

local_inferbench-0.3.0-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file local_inferbench-0.3.0.tar.gz.

File metadata

  • Download URL: local_inferbench-0.3.0.tar.gz
  • Upload date:
  • Size: 49.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for local_inferbench-0.3.0.tar.gz
Algorithm Hash digest
SHA256 64069516a97b0e2a4901af4ff30851abdcd9132904e6c18328b20b4728345f6d
MD5 7e55d90f499604b5c8713f965f520ae1
BLAKE2b-256 3184f4b75c9ea7e705996fb5a721177ca97be314229d85bc5dc929c5cca997b4

See more details on using hashes here.

File details

Details for the file local_inferbench-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for local_inferbench-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 678fa6c0e9f0f342bb4dfd11f61cc8f61696cb448f6eb9489a846f033b9d76f0
MD5 3239bedf03405d54e06eef96f5eff9d5
BLAKE2b-256 11710705b217665a41b64979e6c493c6936a5cfbd148ac09e682d515d33d4f69

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