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

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

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

# maxContextLength

[common]\
fun [maxContextLength](maxContextLength.md)(source: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), options: [CheckOptions](../CheckOptions/index.md) = CheckOptions()): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)

The largest context the one device [options](maxContextLength.md) names can serve [source](maxContextLength.md) at, from the same law: the admitted window of its verdict (the largest rung of the context ladder up to the model's own window, or up to [CheckOptions.maxSeq](../CheckOptions/maxSeq.md) when given, whose need keeps [FitGrade.GOOD](../FitGrade/GOOD/index.md) or better), 0 when no context fits. [options](maxContextLength.md) must judge exactly one device (one [FitDevice](../FitDevice/index.md), or one `device` spelling); more refuses with IllegalArgumentException.