Skip to content

feat: make recall max query tokens configurable via env var#544

Merged
nicoloboschi merged 2 commits intomainfrom
config-max-query-tokens
Mar 11, 2026
Merged

feat: make recall max query tokens configurable via env var#544
nicoloboschi merged 2 commits intomainfrom
config-max-query-tokens

Conversation

@nicoloboschi
Copy link
Collaborator

Summary

Replaces the hardcoded MAX_QUERY_TOKENS = 500 constant in http.py with a configurable env var.

Changes

  • config.py: Add ENV_RECALL_MAX_QUERY_TOKENS, DEFAULT_RECALL_MAX_QUERY_TOKENS = 500, and recall_max_query_tokens field
  • main.py: Pass recall_max_query_tokens through CLI override constructor
  • http.py: Read limit from get_config().recall_max_query_tokens at request time
  • configuration.md: Document the new HINDSIGHT_API_RECALL_MAX_QUERY_TOKENS env var

Behaviour

Default is unchanged (500 tokens). Set HINDSIGHT_API_RECALL_MAX_QUERY_TOKENS to raise or lower the limit.

Add HINDSIGHT_API_RECALL_MAX_QUERY_TOKENS env var (default: 500) to
replace the hardcoded MAX_QUERY_TOKENS constant in http.py.
@nicoloboschi nicoloboschi merged commit 66dedb8 into main Mar 11, 2026
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant