DEV Community

TTapi
TTapi

Posted on Originally published at kuku-momo.github.io

Benchmark any LLM API relay in 30 seconds with one Python file

Every "which relay is fastest" post I read is a snapshot someone took last month. Latency moves. Availability moves. You need your own number, taken now.

One file, standard library only, no pip install, no API key needed for a connectivity check.

What it measures

Two things that actually decide whether your coding agent is usable:

  • Does it respond at all — status code per endpoint.
  • How long it takes — median latency across N rounds, plus fastest and slowest.
python3 bench.py https://your-relay.example/v1 --key $RELAY_KEY --rounds 5
Enter fullscreen mode Exit fullscreen mode

Output:



| endpoint                      | ok  | status | median | fastest | slowest |
|
Enter fullscreen mode Exit fullscreen mode

Top comments (0)