Skip to content

[Feature]: Make model output token limit configurable #474

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions