> For the complete documentation index, see [llms.txt](https://seekspeed.gitbook.io/seekspeed-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seekspeed.gitbook.io/seekspeed-docs/benchmarking/running.md).

# Running a Benchmark

From `/app/benchmarks/new`:

1. Pick an agent profile.
2. Provide prompts — inline textarea, CSV paste, or JSON upload.
3. Set **iterations** (per prompt) and **concurrency** (parallel in-flight requests).
4. Toggle streaming on (default) for real TTFT capture.
5. Optionally enable a concurrency **sweep** — runs the set at `[1, 4, 16, 32]` concurrency to surface tail latency.

Click **Run**. The runner streams results back via the server function, the in-memory workspace updates after each iteration, and Recharts re-renders three live charts:

* Per-iteration TTFT scatter
* Total latency p50 / p95 / p99 bars
* Throughput (tok/s) line

## Runner internals

```ts
// pseudocode of the orchestrator
async function executeRun(run: BenchmarkRun) {
  const pool = new Semaphore(run.concurrency);
  const tasks = run.prompts.flatMap(p =>
    Array.from({ length: run.iterations }, (_, i) => async () => {
      await pool.acquire();
      try {
        const r = await runBenchmarkOnce({
          connectorId: agent.connectorId,
          prompt: renderPrompt(p, agent),
          stream: true,
          maxTokens: agent.tokenBudget,
        });
        await appendRunResult(run.id, r);
      } finally { pool.release(); }
    })
  );
  await Promise.all(tasks.map(t => t()));
  await finalizeStats(run.id);
}
```

`finalizeStats` computes p50 / p95 / p99 of `ttftMs` and `totalMs`, mean tok/s, total cost in USD via `src/lib/pricing.ts`, and the error rate.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://seekspeed.gitbook.io/seekspeed-docs/benchmarking/running.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
