Skip to content

Randomize model-to-instance assignment#2

Open
ScuttleBot wants to merge 1 commit intomainfrom
scuttlebot/randomize-model-assignment
Open

Randomize model-to-instance assignment#2
ScuttleBot wants to merge 1 commit intomainfrom
scuttlebot/randomize-model-assignment

Conversation

@ScuttleBot
Copy link

Shuffles the model list before distributing across instances.

Why:
Previously, models were assigned in order (alphabetically if from YAML). This meant anthropic/* models always landed on early instances, z-ai/* on later ones. If there are any systematic differences between instances (boot timing, network, etc.), this could introduce bias.

Changes:

  • distribute_models() now shuffles by default before round-robin assignment
  • Added --no-shuffle flag to restore deterministic behavior if needed

Example:

# Default: randomized
uv run orchestrate_vultr.py --count 5

# Deterministic (alphabetical order preserved)
uv run orchestrate_vultr.py --count 5 --no-shuffle

Shuffles the model list before distributing across instances (round-robin).
This prevents systematic biases like alphabetically-first models always
landing on instance 0.

Use --no-shuffle to restore deterministic (alphabetical) assignment if needed.
all the "A" models alphabetically).

Examples:
9 models, 3 instances → [[m0,m3,m6], [m1,m4,m7], [m2,m5,m8]]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Docstring examples show deterministic round-robin output, but with the new default shuffle=True, the actual distribution will be randomized. Consider noting that these examples assume shuffle=False, e.g.:

Examples (with shuffle=False, showing round-robin logic):

This avoids confusing readers who might expect the documented output from the default behavior.

@kilo-code-bot
Copy link

kilo-code-bot bot commented Mar 10, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Merge with minor improvement

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
orchestrate_vultr.py 241 Docstring examples show deterministic output but default behavior is now shuffled
Other Observations (not in diff)
  • Reproducibility: random.shuffle() uses the global RNG without an explicit seed. For benchmark reproducibility, consider adding an optional --seed argument that calls random.seed(value) before shuffling. This would allow users to reproduce exact model distributions across runs while still defaulting to random behavior. Not a bug, but a useful enhancement for a benchmarking tool.
Files Reviewed (1 file)
  • orchestrate_vultr.py - 1 suggestion

Overall: Clean, well-structured change. The implementation correctly copies the input list before shuffling (avoiding mutation of the caller's list), the --no-shuffle flag provides an opt-out, and the shuffle keyword-only parameter keeps the API clean. Good use of list(models) to avoid side effects.

Fix these issues in Kilo Cloud

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.

2 participants