bench

Benchmark LLM API latency and throughput across streaming endpoints.

114|12|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/OpenDCAI/leonai --skill bench
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bench
Source: https://github.com/OpenDCAI/leonai/tree/main/.claude/skills/bench
Command: npx skills add https://github.com/OpenDCAI/leonai --skill bench

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires aiohttp.

What problem does it solve?

Quick benchmark of third-party API models for latency and throughput to help developers compare production-ready performance across endpoints.

Core Features & Use Cases

  • Two Python scripts (test_models.py and test_anthropic.py) perform streaming-based benchmarks against different model endpoints.
  • Automatically discover available models from /models and filter to the latest mainstream text models (Claude 4.x, GPT-5.x, Gemini-3.x, Qwen 3.x, GLM 4.7+, Kimi k2.5+), excluding outdated or irrelevant variants.
  • Collect and compare metrics such as TTFB, total time, generated token count, and tokens-per-second to enable fast model selection.
  • Supports multiple interface formats (OpenAI-like /v1/chat/completions and Anthropic /v1/messages) for cross-compatibility.

Quick Start

Use a concise instruction to start the benchmark by providing the API key and base URL for the endpoint.

Frequently Asked Questions about bench

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I benchmark LLM API latency and throughput across different providers?

To benchmark LLM API latency and throughput, use streaming-based Python scripts to measure TTFB and tokens-per-second across OpenAI-like /v1/chat/completions and Anthropic /v1/messages endpoints, aggregating timing data for multiple models.

What is TTFB and how is it measured for chat completions streaming endpoints?

TTFB (Time to First Byte) measures the initial latency before a model generates its first token. It is measured by parsing streaming deltas from chat completions endpoints to calculate the exact time elapsed before the first response byte arrives.

Can I compare token generation speed for OpenAI-like and Anthropic APIs using the same script?

Yes, you can compare token generation speed across both interfaces using dedicated scripts. The benchmark applies to OpenAI-like /v1/chat/completions and Anthropic /v1/messages formats to test multiple models and aggregate timing data cross-compatibly.

How to automatically discover and filter mainstream text models for performance comparison?

Automatically discover available models by querying the /models endpoint, then filter to the latest mainstream text models like Claude 4.x, GPT-5.x, and Gemini-3.x, excluding outdated or irrelevant variants for performance comparison.

Does API benchmarking require a streaming-capable endpoint to measure tokens per second?

Yes, API benchmarking requires a streaming-capable endpoint to measure tokens per second accurately. Client-side scripts parse streaming deltas to compute TTFB, total time, and generated token counts for valid performance metrics.

What do I need to provide to start testing model latency with aiohttp?

To start testing model latency with aiohttp, you need to provide a streaming-capable endpoint, an API key, a base URL, and a test prompt. The scripts handle parsing streaming deltas and computing timing data automatically.