---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/litert_lm/adapter/functions/isEngineContextOverflowMessage.md
---

# Function: isEngineContextOverflowMessage()

```ts
function isEngineContextOverflowMessage(message: string): boolean;
```

Defined in: [src/batteries/llm/litert\_lm/adapter.ts:249](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/litert_lm/adapter.ts#L249)

Does this raw engine message report an INPUT context-cap overflow — the prompt's token ids exceed the
engine's fixed `maxNumTokens`? The LiteRT-web runtime throws e.g. `Input token ids are too long.
Exceeding the maximum number of tokens allowed: 12596 >= 12288`. Matched so the raw throw can be
translated into the typed [E\_LITERT\_LM\_CONTEXT\_OVERFLOW](../../exceptions/variables/E_LITERT_LM_CONTEXT_OVERFLOW.md) instead of the generic stream error —
this is the ENGINE BACKSTOP that fires when the optional pre-dispatch guard is unarmed or undercounts.
Exported so a host can classify a thrown/caught error the same way.

## Parameters

| Parameter | Type     |
| --------- | -------- |
| `message` | `string` |

## Returns

`boolean`
