Summary
Allow users to configure the maximum output-token budget used when OpenWiki creates model clients.
Motivation
OpenWiki currently relies on each provider client's default output-token limit. Large generated pages or multi-line edits can require a larger output budget, while deployments may also want an explicit lower limit for cost or latency control.
The truncation-detection behavior is tracked separately in #458; this request is only for configuring the model-client limit.
Proposed Solution
Add an optional OPENWIKI_MAX_OUTPUT_TOKENS setting that:
- accepts a positive integer;
- maps to
maxOutputTokens for Google clients and maxTokens for the other supported LangChain chat clients;
- preserves every provider's existing default when unset.
Provider and model limits should continue to apply.
Alternatives Considered
Relying on provider defaults does not let users adapt the budget to their workload. Provider-specific settings would add unnecessary configuration surface for the same cross-provider concept.
Additional Context
Implementation: #459
Related truncation handling: #457 and #458
Summary
Allow users to configure the maximum output-token budget used when OpenWiki creates model clients.
Motivation
OpenWiki currently relies on each provider client's default output-token limit. Large generated pages or multi-line edits can require a larger output budget, while deployments may also want an explicit lower limit for cost or latency control.
The truncation-detection behavior is tracked separately in #458; this request is only for configuring the model-client limit.
Proposed Solution
Add an optional
OPENWIKI_MAX_OUTPUT_TOKENSsetting that:maxOutputTokensfor Google clients andmaxTokensfor the other supported LangChain chat clients;Provider and model limits should continue to apply.
Alternatives Considered
Relying on provider defaults does not let users adapt the budget to their workload. Provider-specific settings would add unnecessary configuration surface for the same cross-provider concept.
Additional Context
Implementation: #459
Related truncation handling: #457 and #458