ai-dynamo/aiperf

AIPerf is a comprehensive benchmarking tool that measures the performance of generative AI models served by your preferred inference solution.

What it does

AIPerf sends test requests to an AI model server (like Ollama, vLLM, or Hugging Face TGI) and measures performance. It reports metrics such as:

  • Time to First Token — how long until the first word of a response arrives
  • Request Latency — total time for a complete response
  • Throughput — tokens or requests handled per second
  • Sequence lengths — how many input and output tokens were processed

Results appear in a terminal dashboard and can be exported as CSV, JSON, and log files.

How you use it

  1. Start a model server — the README's example uses Ollama in Docker running the granite4:350m model.
  2. Install AIPerf — pip install aiperf (Python 3, in a virtual environment).
  3. Run a benchmark — a single command like:
aiperf profile \
  --model "granite4:350m" \
  --streaming \
  --endpoint-type chat \
  --tokenizer ibm-granite/granite-4.0-micro \
  --url http://localhost:11434 \
  --request-count 10

You can adjust concurrency, request rate, and other parameters.

Key features

  • Three UI modes: live dashboard, simple progress bars, or headless (no display)
  • Multiple benchmarking modes: concurrency-based, request-rate-based, trace replay (replaying recorded production traffic), and more
  • Plugin system: extend endpoints, datasets, transports, and metrics
  • Public dataset support: ShareGPT and custom formats
  • Optional integrations: MLflow, OpenTelemetry, Weights & Biases for telemetry and result uploads; a t-digest backend for memory-efficient metric lists
  • Kubernetes support: an operator and Helm chart for running benchmarks on clusters

What it works with

  • OpenAI-compatible APIs: chat completions, completions, embeddings, audio, images
  • NVIDIA NIM: embeddings and rankings
  • Many model servers: Ollama, vLLM, SGLang, TensorRT-LLM, Hugging Face TGI, SageMaker, and others

Architecture

AIPerf runs as 10 separate services communicating over ZMQ (a message-passing library), giving it a scalable multiprocess design.

Known limitations

  • Output length constraints may not be guaranteed unless the server supports ignore_eos or min_tokens flags.
  • Very high concurrency (above ~15,000) can exhaust network ports on some systems.
  • Invalid configuration can cause the tool to hang; you may need to kill the process.
  • Copying text in the dashboard UI can be unreliable; use the c key to copy all logs.

License

Apache 2.0. The Helm chart includes a symlink to the license file so packaged chart archives contain it.

Related

  • Project
  • Project
  • Project
  • Project
  • Project