Skip to content

examples: let the config file set temperature and max_tokens - #50

Merged
radinhamidi merged 1 commit into
mainfrom
fix/pipeline-llm-flag-defaults
Oct 29, 2026
Merged

radinhamidi merged 1 commit into
mainfrom
fix/pipeline-llm-flag-defaults

Conversation

@radinhamidi

Copy link
Copy Markdown
Member

Description

In the example pipeline (pipeline.py, reformulate_queries.py), --temperature and --max-tokens defaulted to 1.0 and 128. Those defaults were never None, so they always replaced the values from --config, and per-method LLM settings in reformulation_config.yaml never took effect.

The flags now default to None. Precedence is:

  1. --temperature / --max-tokens on the command line
  2. the config file (per-method llm, then global llm)
  3. 1.0 / 128 when neither sets them

Resolved settings

Invocation Before After
--config, genqr (config: 0.8 / 256) 1.0 / 128 0.8 / 256
--config, hyde (config: 0.7 / 512) 1.0 / 128 0.7 / 512
--config, query2doc (global: 1.0 / 128) 1.0 / 128 1.0 / 128
--config + --temperature 0.3, genqr 0.3 / 128 0.3 / 256
no --config 1.0 / 128 1.0 / 128
no --config + --max-tokens 64 1.0 / 64 1.0 / 64

Same results for both pipeline.py and reformulate_queries.py.

Changes

  • utils.py: DEFAULT_TEMPERATURE / DEFAULT_MAX_TOKENS (1.0 / 128)
  • pipeline.py, reformulate_queries.py: flags default to None; fallback applied only when neither the CLI nor the config sets a value
  • README.md: flag descriptions note that they override the config file

Testing

  • pytest: 139 passed
  • Resolved llm_config checked for every row above in both scripts

🤖 Generated with Claude Code

https://claude.ai/code/session_01BeF2TLoADWshUg9C6LuSid

--temperature and --max-tokens defaulted to 1.0 and 128, so they always
replaced the values in the config file. They now default to None: a flag
given on the command line overrides the config, the config's per-method
and global llm settings apply otherwise, and 1.0 / 128 remain the
fallback when neither sets them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeF2TLoADWshUg9C6LuSid
@radinhamidi
radinhamidi merged commit fd6ec26 into main Oct 29, 2026
1 check passed
@radinhamidi
radinhamidi deleted the fix/pipeline-llm-flag-defaults branch October 29, 2026 11:23
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