Skip to content

Benchmark an OpenAI-compatible server

Use this type when the server has no servtuner catalog. You get every client-side metric. Kubernetes resource metrics are available when you declare its workload and Prometheus.

  • An endpoint that ends in the API prefix, usually /v1.
  • The exact model name the server reports.
gateway.yaml
apiVersion: servtuner.dev/v1
kind: RunSpec
name: gateway-baseline
target:
type: openai-compatible
endpoint: https://api.example.com/v1
model: example-model
auth:
secretRef: { name: gateway-key, key: token }
tls: { mode: tls }
engine: { type: loadgen }
workload:
streaming: true
dataset:
type: synthetic
input_tokens: { mean: 256, stddev: 64 }
output_tokens: { mean: 128 }
load:
stages:
- { rate: 2, duration: 120s }
- { rate: 4, duration: 120s }
slos: { ttft_p95: 2s, max_error_rate: 0.01 }

tls verifies the server and presents no client certificate. It suits public HTTPS endpoints.

For a local process, put the key in <dir>/gateway-key/token and pass --secrets-dir <dir>:

Terminal window
servtuner run --spec gateway.yaml --secrets-dir ./secrets

Run a connection check first. In the result, confirm that achieved RPS follows offered RPS and that errors are zero or expected.

Use the SLO guide to extend the ladder until a stage fails.