fix(experiments): apply generation overrides to subject provider before evaluation#1427
Merged
fix(experiments): apply generation overrides to subject provider before evaluation#1427
Conversation
…re evaluation (#1407) The experiment engine was calling evaluator.evaluate(&self.subject) with the same unmodified provider on every iteration, producing delta=0.0 for all variations. Add GenerationOverrides to zeph-llm and implement with_generation_overrides() on all provider types (Ollama, Claude, OpenAI, Compatible, Mock) and AnyProvider. Apply overrides in chat(), chat_stream(), chat_with_tools(), and chat_typed() paths. Remove local GenerationOverrides from snapshot.rs and re-export from zeph-llm. Engine now creates a cloned+patched provider per variation before evaluation. - Claude temperature field changed from Option<u32> to Option<f64> - Ollama: frequency_penalty/presence_penalty silently dropped (unsupported by ModelOptions; documented with comment and debug log) - Orchestrator/Router variants warn and return self unchanged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
delta=0.0for every variationGenerationOverridesstruct tozeph-llmandwith_generation_overrides()builder to all provider types andAnyProviderevaluator.evaluate()Changes
zeph-llm/src/provider.rs: newGenerationOverridesstruct (temperature, top_p, top_k, frequency_penalty, presence_penalty)zeph-llm/src/{ollama,claude,openai,compatible,mock}.rs:generation_overridesfield +with_generation_overrides()builder; overrides applied inchat(),chat_stream(),chat_with_tools(),chat_typed()pathszeph-llm/src/any.rs:with_generation_overrides()dispatches to all variants; Orchestrator/Router warn and return self unchangedzeph-core/src/experiments/snapshot.rs: removes localGenerationOverrides, re-exports fromzeph_llmzeph-core/src/experiments/engine.rs: line 249 createspatchedprovider with overrides before eachevaluator.evaluate()call; removes stale TODO commenttemperaturefield corrected fromOption<u32>(thousandths) toOption<f64>across all request structsTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— cleancargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins— 4860 passed (+3 new unit tests forwith_generation_overridesstate propagation)