galapagos
DocsHubLeaderboardPlaygroundNews
galapagos

six blocks · any task ·
better solutions emerge.

Platform

  • Hub
  • Leaderboard
  • Playground

Resources

  • Docs
  • API reference
  • Card spec

Community

  • GitHub
  • Contribute

Updates

  • News
  • Releases

© 2026 Galapagos. Licensed under Apache-2.0.

Build your own scaffold.

Hub/Scaffolds/default/Best-of-N

default/best_of_n

Best-of-N

Give the LLM N valid attempts at the same parent before committing to the global best, then repeat.

Test-time searchApache-2.0
Scaffold cardFiles and versions
best_of_n/proposer.py
14 lines · 701 BpythonDownload
"""Best-of-N Proposer component — the strict SEARCH/REPLACE diff operator (no full-rewrite fallback)."""
from __future__ import annotations

from ...components.proposer import DiffProposer


class BestOfNProposer(DiffProposer):
    """One LLM call -> a SEARCH/REPLACE diff applied to the parent (SkyDiscover's solution generator),
    with mandatory no-op detection. Diffs apply by whole-line matching (SkyDiscover ``apply_diff``); a
    response with no matching diff block is a NO_DIFF (retried/discarded), never a full rewrite or a
    substring edit. Each valid call counts as one of the N attempts at the parent (failures are retried
    free; see BestOfNPolicy)."""

    diff_wholeline = True