Skip to content

Feature Request: Make Anthropic max_tokens configurable #5434

@Surendhar-N-D

Description

@Surendhar-N-D

Feature Request: Make Anthropic max_tokens configurable

Summary

Currently, the default max_tokens value for Anthropic in Goose is hardcoded to 8192.
However, Anthropic models now support up to 64k tokens, and there is no environment variable or configuration option to adjust this limit.

Request

Please add support for configuring the max_tokens value via an environment variable or configuration file, so users can take full advantage of the higher token limits supported by the Anthropic API.

Proposed Solution

  • Introduce an environment variable (e.g., ANTHROPIC_MAX_TOKENS) or configuration setting to override the default.

Rationale

  • Enables users to leverage larger contexts for complex workloads.
  • Improves compatibility with the full capabilities of Anthropic’s API.
  • Increases flexibility without breaking existing functionality.

Environment

  • Goose version: 1.12
  • API: Anthropic
  • Current behavior: max_tokens fixed at 8192
  • Expected behavior: Configurable up to 64k

Additional Context

Anthropic documentation reference: https://docs.claude.com/en/docs/about-claude/models/overview

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions