Skip to content

Commit ebfed22

Browse files
src/localserv: set fixed seed for deterministic sampling
Explicitly set `sampling.seed` to 42 in `localserv_main.cc`. This ensures that `Inference::reinitialize` uses a fixed seed rather than a random one derived from `time(NULL)`. This prevents non-deterministic behavior in the sampler chain (e.g., `min_p` or internal `llama.cpp` RNG usage) that was causing CI test failures in `localserv_test.py`, even when greedy sampling was enabled. This change aligns `localserv`'s reliability with `assistant_cli`. Co-authored-by: gendeux <109779922+gendeux@users.noreply.github.com>
1 parent 7aea87a commit ebfed22

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/localserv/localserv_main.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ int main(int argc, char** argv) {
260260
// Use deterministic (greedy) sampling for reproducibility
261261
auto& sampling = std::get<rendezllama::inference::Sampling>(opt.infer_via);
262262
sampling.pick_via = rendezllama::inference::Determinism();
263+
sampling.seed = 42;
263264

264265
std::vector<Vocabulary::ChatMessage> messages;
265266
std::vector<char> formatted(llama_n_ctx(ctx));

0 commit comments

Comments
 (0)