Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moa #2628

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft

Moa #2628

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4c702a0
Implement MOACoder
gembancud Dec 10, 2024
a0ab8c9
Add fix keeping discussion across discussions
gembancud Dec 13, 2024
fe86266
Fix content orchestration for discussion in MOA
gembancud Dec 13, 2024
b474127
Add drop and clear for moa
gembancud Dec 13, 2024
c792c6f
Restructure for chat interface instead of single user sending
gembancud Dec 13, 2024
9eb5cfc
Modify moa prompt for better collaboration
gembancud Dec 15, 2024
b3ecd6f
Modify moa prompt to build on previous solutions instead of creating …
gembancud Dec 16, 2024
f05e021
Modify moa prompt for cleaner solution building
gembancud Dec 18, 2024
49eb1d2
Fix moa committing issues, and integrate with benchmark harness
gembancud Dec 18, 2024
3db7fa1
Add developer message for openrouter o1 models
gembancud Dec 18, 2024
c08ee12
Merge branch 'Aider-AI:main' into moa
gembancud Dec 19, 2024
085a6d7
Minor moa prompt changes
gembancud Dec 19, 2024
b216a48
Merge branch 'moa' of github.com:gembancud/aider into moa
gembancud Dec 19, 2024
edd6d56
Merge branch 'moa' of github.com:gembancud/aider into moa
gembancud Dec 19, 2024
3736337
Add resiliency for proposal tag observed failure modes
gembancud Dec 20, 2024
5fcd51e
Merge branch 'moa' of github.com:gembancud/aider into moa
gembancud Dec 20, 2024
6a2c289
Change removing architect into /ignore
gembancud Dec 20, 2024
c652e61
Merge remote-tracking branch 'upstream/main' into moa
gembancud Dec 23, 2024
c8fb8ce
Minor prompt edits to try wrangle creeping enhancements
gembancud Dec 24, 2024
9e5fac4
Merge branch 'Aider-AI:main' into moa
gembancud Dec 28, 2024
fb3ee7e
Minor prompt edits to wrangle scope creep in aoi section
gembancud Dec 30, 2024
c526ff9
Merge branch 'moa' of github.com:gembancud/aider into moa
gembancud Dec 30, 2024
c304777
Switch to prompt to use mini diffs for changes
gembancud Dec 31, 2024
7a73ddf
Switch to minmaxing user requirements for prompt
gembancud Jan 2, 2025
9e58311
Merge remote-tracking branch 'upstream/main' into moa
gembancud Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aider/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ def get_parser(default_config_files, git_root):
default=[],
)
group = parser.add_argument_group("Model settings")
group.add_argument(
"--moa",
metavar="MODEL",
nargs="+",
help="Use Mixture of Architects with multiple models",
)
group.add_argument(
"--list-models",
"--models",
Expand Down
2 changes: 2 additions & 0 deletions aider/coders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .editor_editblock_coder import EditorEditBlockCoder
from .editor_whole_coder import EditorWholeFileCoder
from .help_coder import HelpCoder
from .mixture_of_architects_coder import MixtureOfArchitectsCoder
from .udiff_coder import UnifiedDiffCoder
from .wholefile_coder import WholeFileCoder

Expand All @@ -23,4 +24,5 @@
ArchitectCoder,
EditorEditBlockCoder,
EditorWholeFileCoder,
MixtureOfArchitectsCoder,
]
19 changes: 19 additions & 0 deletions aider/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ def create(

kwargs = use_kwargs

# Check for mixture of architects case first
if "architect_models" in kwargs:
for coder in coders.__all__:
if coder.edit_format == "mixture":
res = coder(main_model, io, **kwargs)
res.original_kwargs = dict(kwargs)
return res

# Normal case - find coder matching edit_format
for coder in coders.__all__:
if hasattr(coder, "edit_format") and coder.edit_format == edit_format:
res = coder(main_model, io, **kwargs)
Expand Down Expand Up @@ -210,6 +219,12 @@ def get_announcements(self):
output = f"Weak model: {weak_model.name}"
lines.append(output)

# Mixture of Architects info
if self.edit_format == "mixture" and hasattr(self, "architects"):
for arch in self.architects[1:]: # Skip alpha since it's already shown as main model
output = f"Architect {arch.name.upper()}: {arch.model.name}"
lines.append(output)

# Repo
if self.repo:
rel_repo_dir = self.repo.get_rel_repo_dir()
Expand Down Expand Up @@ -1097,6 +1112,10 @@ def format_chat_chunks(self):
chunks.system = [
dict(role="system", content=main_sys),
]
elif self.main_model.use_developer_message:
chunks.system = [
dict(role="developer", content=main_sys),
]
else:
chunks.system = [
dict(role="user", content=main_sys),
Expand Down
Loading