Profile OpenAI-Compatible Text APIs Using AIPerf
This guide covers profiling OpenAI-compatible Chat Completions and Completions endpoints with vLLM and AIPerf.
Start a vLLM server
Pull and start a vLLM server using Docker:
Verify the server is ready:
Profile Chat Completions API
The Chat Completions API uses the /v1/chat/completions endpoint.
If your server or gateway requires query parameters, include them in a quoted --url, for example --url 'http://localhost:8000?tag=first&tag=second'. AIPerf preserves repeated parameter values and their order when constructing the request URL; endpoint parameters replace all existing values of the same key. An empty list value removes that key from the resulting query. Readiness probes also preserve URL queries and semicolon path parameters when adding the endpoint path, so a base path such as /proxy;tenant=blue becomes /proxy;tenant=blue/v1/models for model discovery.
Profile with synthetic inputs
Run AIPerf against the Chat Completions endpoint using synthetic inputs:
Include explicit empty streaming responses
Some OpenAI-compatible servers, including Kimi K3 deployments, can emit explicit empty content or reasoning strings as part of a Chat Completions stream. Enable their inclusion in the response timeline with:
The flag is off by default because OpenAI-compatible servers can emit
handshake or role metadata before generation. It admits only explicit empty
strings in Chat Completions content or reasoning fields, not missing fields,
null, or metadata. All shared response-timeline metrics change together when
these strings are included. TTFO still waits for non-empty output, and an empty
decoded string does not increment output-token totals.
Sample Output (Successful Run):
Profile with custom input file
Create a JSONL input file:
Run AIPerf against the Chat Completions endpoint using the custom input file:
Profile Completions API
The Completions API uses the /v1/completions endpoint.
Profile with synthetic inputs
Run AIPerf against the Completions endpoint using synthetic inputs:
Sample Output (Successful Run):
Profile with custom input file
Create a JSONL input file:
Run AIPerf against the Completions endpoint using the custom input file: