Skip to content
1 min read · 65 words

Variable: E_OLLAMA_CONTEXT_OVERFLOW

ts
const E_OLLAMA_CONTEXT_OVERFLOW: CreatedException<
  [number, number, string, string]
>;

Defined in: batteries/llm/ollama/exceptions.ts:48

Thrown when the total token weight of the resolved request exceeds contextWindow. Only raised when tokenEncoding is non-null. Carries { total, contextWindow, tokenEncoding, perBucket } in the message so middleware can target shedding.

Remarks

This is the ADK-side token-budget guard and is independent of Ollama's server-side num_ctx (KV-cache size) runtime option; the adapter does not auto-sync the two.