---
title: "bench"
sidebar_label: "bench"
description: "Kotlin binding reference: bench."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.modelverse](../index.md)/[Modelverse](index.md)/[bench](bench.md)

# bench

[common]\
fun [bench](bench.md)(model: [GenerativeModel](../GenerativeModel/index.md), options: [BenchOptions](../BenchOptions/index.md) = BenchOptions()): [BenchReport](../BenchReport/index.md)

The serving-path benchmark over a loaded [model](bench.md), the command line's `bench` verb in process: [options](bench.md)' cells times its concurrency widths, one (cell, width) at a time through the serving pipeline over the model, answered as a [BenchReport](../BenchReport/index.md) (the rows typed, the CSV text the verb prints, the run's configuration document). The call blocks for the sweep, minutes for the command line's default cells on a phone; a chat sent to the model meanwhile waits behind it, and a `close()` of the model waits for the sweep to end (the sweep has no cancel). A setup failure (a closed model, an option the library refuses) throws [ModelverseException](../ModelverseException/index.md); a cell the model's window cannot fit is a [BenchRowStatus.SKIPPED](../BenchRowStatus/SKIPPED/index.md) row and a failed row a [BenchRowStatus.ERROR](../BenchRowStatus/ERROR/index.md) row, never an exception. The measurement runs on the device the model loaded on; the configuration document names it.