Fixes the model-override footgun on llama-swap / multi-model endpoints
(reported by @ampersandru in disc #152). quality-test.sh unconditionally
overrode MODEL with the first id from /v1/models whenever they differed —
fine for single-model composes (the wrong-name → HTTP 404 fix), but on
llama-swap /v1/models returns the first registered model (often the wrong
one), so the whole run got routed at the wrong model. @ampersandru was
manually `sed`-ing out the override line every run as a workaround.
New behaviour:
- MODEL unset → auto-detect from /v1/models (unchanged; keeps the
single-model footgun fix)
- MODEL set → respect it verbatim, never override; warn once if the
endpoint disagrees ("using YOUR value")
- New --model NAME → equivalent to MODEL env, sets the explicit flag
Tracks whether MODEL was explicitly provided (env or --model) before the
default is applied, and gates the auto-detect on that.
Tested via a mock /v1/models endpoint returning a mismatched model:
A. MODEL unset → auto-detects the served id ✓
B. --model 'Qwen3.6-ik' → respects it, warns on mismatch ✓
C. MODEL=… env → same respect behaviour ✓
Co-authored-by: noonghunna <10742901+noonghunna@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>