Skip to content

LLMGenerationOptions

Options for controlling a single LLM generation request.

Defined in: src/core/types/providers.ts:715

Options for controlling a single LLM generation request.

Remarks

These options override the provider-level LLMProviderConfig settings for a specific generation call. They are passed to generate and generateFromMessages.

The signal property is particularly important for the eager LLM pipeline, where speculative generations may need to be cancelled.

Example

const controller = new AbortController();

const options: LLMGenerationOptions = {
  temperature: 0.5,
  maxTokens: 100,
  signal: controller.signal,
};

const stream = await llmProvider.generate('Hello!', options);
// Cancel if needed:
controller.abort();

See

Properties

PropertyTypeDescriptionDefined in
extra?Record<string, unknown>Additional provider-specific options. Remarks Allows passing through options that are specific to a particular LLM provider without extending this interface.src/core/types/providers.ts:757
maxTokens?numberOverride the provider’s default max tokens for this generation. See LLMProviderConfig.maxTokenssrc/core/types/providers.ts:728
signal?AbortSignalAbortSignal for cancelling an in-flight generation. Remarks Providers that support cancellation (Anthropic, OpenAI) will stop yielding tokens and throw an AbortError when this signal fires. Used by CompositeVoice for the eager/preflight pipeline to cancel speculative generations when the confirmed text differs. See EagerLLMConfig for the eager pipeline configurationsrc/core/types/providers.ts:748
stopSequences?string[]Override the provider’s default stop sequences for this generation. See LLMProviderConfig.stopSequencessrc/core/types/providers.ts:735
temperature?numberOverride the provider’s default temperature for this generation. See LLMProviderConfig.temperaturesrc/core/types/providers.ts:721

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency