Skip to main content

LLM benchmarking tools for the LLM CLI

Project description

LLM Benchmarking Plugin

This is a plugin for the llm tool that adds a benchmark command to compare the performance of different language models.

The commands runs a prompt with optional system prompt for several models and compares the performance between models.

Installation

You can install the plugin using pip:

pip install llm-profile

or using llm

llm install llm-profile

Benchmark Usage

To run a benchmark, provide the prompt along with any number of models using the llm alias (from llm models):

$ llm benchmark -m azure/ant-grok-3-mini -m azure/ants-gpt-4.1-mini -m github/gpt-4.1-mini -m github/gpt-4.1-nano -s "Respond in emoji" "Give me a friendly hello message" --markdown

For a single pass (no repeats) you will get a summary table:

Benchmark Total Time Time to First Chunk Length of Response Number of Chunks
azure/ant-grok-3-mini 6.96 6.96 3 3
azure/ants-gpt-4.1-mini 2.53 2.37 53 15
github/gpt-4.1-mini 2.29 2.29 53 15
github/gpt-4.1-nano 2.24 2.24 52 17

To repeat each benchmark and get an average of times, use the --repeat argument:

Benchmark Total Time Time to First Chunk Length of Response Number of Chunks
azure/ant-grok-3-mini 3.71 <-> 8.82 (x̄=6.26) 3.69 <-> 8.81 (x̄=6.25) 2 <-> 2 (x̄=2.00) 2 <-> 2 (x̄=2.00)
azure/ants-gpt-4.1-mini 0.52 <-> 3.31 (x̄=1.91) 0.34 <-> 3.13 (x̄=1.73) 53 <-> 54 (x̄=53.50) 15 <-> 15 (x̄=15.00)
github/gpt-4.1-mini 1.79 <-> 2.33 (x̄=2.06) 1.78 <-> 2.33 (x̄=2.06) 53 <-> 53 (x̄=53.00) 15 <-> 16 (x̄=15.50)
github/gpt-4.1-nano 1.82 <-> 2.06 (x̄=1.94) 1.82 <-> 2.06 (x̄=1.94) 3 <-> 3 (x̄=3.00) 4 <-> 4 (x̄=4.00)

The printout is a range (min <-> max (x̄=mean))

Markdown formatted results

By default, tables are printed with color showing the fastest and slowest metric in a benchmark:

benchmark screenshot

If you want to customize the output, you can use the --markdown flag to get the results in a Markdown-friendly format.

Non-Streaming models

If you want to benchmark models that do not support streaming, you can use the --no-stream flag. This will disable streaming and provide a single response time.

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

llm_profile-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

llm_profile-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file llm_profile-0.1.1.tar.gz.

File metadata

  • Download URL: llm_profile-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_profile-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ecf2a4b2e09ce0387a1cd1656babbbd6693fa1857615684ae023fad125444314
MD5 3e26c977578ab1adbd8f3ace70b9cf60
BLAKE2b-256 18d08a61ed3564e030835d12781d60924aed2cf4ffab6b60c6ab56365696ff44

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_profile-0.1.1.tar.gz:

Publisher: python-publish.yml on tonybaloney/llm-profile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_profile-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: llm_profile-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_profile-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f534ed6b23ff6c5107b4d1271321196b1daadbc60b6f8cca17df67074a8c0c52
MD5 71f71722d1a8059951778015edf977d7
BLAKE2b-256 7d98ca2708bb8298a491ecf123e9f39eee26d905a5309e797be78591f2e237ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_profile-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on tonybaloney/llm-profile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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