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/__init__.py
23 lines · 868 BpythonDownload
"""Best-of-N scaffold — one module per component.

  population.py        -> BestOfNPopulation
  selection_policy.py  -> BestOfNPolicy
  prompt_builder.py    -> BestOfNPromptBuilder
  proposer.py          -> BestOfNProposer
  evaluator.py         -> BestOfNEvaluator (task-supplied)
  memory.py            -> BestOfNMemory (none)
  scaffold.py          -> BestOfNScaffold (the orchestrator that composes the six)
"""
from .evaluator import BestOfNEvaluator
from .memory import BestOfNMemory
from .population import BestOfNPopulation
from .prompt_builder import BestOfNPromptBuilder
from .proposer import BestOfNProposer
from .scaffold import BestOfNScaffold
from .selection_policy import BestOfNPolicy

__all__ = [
    "BestOfNScaffold",
    "BestOfNPopulation", "BestOfNPolicy", "BestOfNPromptBuilder", "BestOfNProposer",
    "BestOfNEvaluator", "BestOfNMemory",
]