Interface: ChatGenerationOptions
Defined in: src/batteries/llm/chat_common/generation.ts:33
The canonical generation options both on-device batteries accept. Every field optional + defaulted.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
enableThinking? | boolean | Whether to enable the model's "thinking"/reasoning mode, passed EXPLICITLY to the chat template. Default false — many reasoning templates default thinking ON and burn the budget. Already shared by both batteries under this exact name; restated here so the whole generation contract is in one place. | src/batteries/llm/chat_common/generation.ts:54 |
maxTokens? | number | Maximum tokens to GENERATE this turn. The portable spelling of transformers.js maxNewTokens / LiteRT maxOutputTokens. Default 1024. | src/batteries/llm/chat_common/generation.ts:38 |
multimodal? | { audio?: boolean; image?: boolean; } | Enable multimodal input by kind. The portable spelling of transformers.js multimodal:{image,audio} / LiteRT visionModalityEnabled+audioModalityEnabled. | src/batteries/llm/chat_common/generation.ts:59 |
multimodal.audio? | boolean | - | src/batteries/llm/chat_common/generation.ts:59 |
multimodal.image? | boolean | - | src/batteries/llm/chat_common/generation.ts:59 |
sampler? | ChatSampler | Sampler strategy (default 'greedy' — deterministic). See ChatSampler. | src/batteries/llm/chat_common/generation.ts:40 |
seed? | number | RNG seed for reproducible sampling (best-effort; only honoured by batteries that expose it). | src/batteries/llm/chat_common/generation.ts:48 |
temperature? | number | Sampling temperature, used when sampler is 'top-k'/'top-p'. Always pinned. Default 0.7. | src/batteries/llm/chat_common/generation.ts:42 |
topK? | number | Top-K cutoff, used when sampler is 'top-k'. Default 40. | src/batteries/llm/chat_common/generation.ts:44 |
topP? | number | Top-P (nucleus) cutoff, used when sampler is 'top-p'. Default 0.95. | src/batteries/llm/chat_common/generation.ts:46 |