llm-orchestra 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llm_orchestra-0.1.2/.github/workflows/ci.yml +70 -0
- llm_orchestra-0.1.2/.github/workflows/publish.yml +83 -0
- llm_orchestra-0.1.2/.gitignore +58 -0
- llm_orchestra-0.1.2/LICENSE +21 -0
- llm_orchestra-0.1.2/Makefile +35 -0
- llm_orchestra-0.1.2/PKG-INFO +205 -0
- llm_orchestra-0.1.2/README.md +143 -0
- llm_orchestra-0.1.2/docs/agent_orchestration.md +591 -0
- llm_orchestra-0.1.2/docs/design_philosophy.md +121 -0
- llm_orchestra-0.1.2/docs/ensemble_vs_single_agent_analysis.md +286 -0
- llm_orchestra-0.1.2/docs/use_cases.md +183 -0
- llm_orchestra-0.1.2/examples/pr_review_with_gh_cli.py +277 -0
- llm_orchestra-0.1.2/examples/shakespeare_einstein_conversation.py +148 -0
- llm_orchestra-0.1.2/pyproject.toml +88 -0
- llm_orchestra-0.1.2/src/llm_orc/__init__.py +3 -0
- llm_orchestra-0.1.2/src/llm_orc/cli.py +158 -0
- llm_orchestra-0.1.2/src/llm_orc/communication.py +123 -0
- llm_orchestra-0.1.2/src/llm_orc/ensemble_config.py +71 -0
- llm_orchestra-0.1.2/src/llm_orc/ensemble_execution.py +230 -0
- llm_orchestra-0.1.2/src/llm_orc/models.py +216 -0
- llm_orchestra-0.1.2/src/llm_orc/orchestration.py +191 -0
- llm_orchestra-0.1.2/src/llm_orc/roles.py +30 -0
- llm_orchestra-0.1.2/tests/__init__.py +1 -0
- llm_orchestra-0.1.2/tests/test_agent_orchestration.py +272 -0
- llm_orchestra-0.1.2/tests/test_cli.py +109 -0
- llm_orchestra-0.1.2/tests/test_communication_protocol.py +242 -0
- llm_orchestra-0.1.2/tests/test_ensemble_config.py +143 -0
- llm_orchestra-0.1.2/tests/test_ensemble_execution.py +520 -0
- llm_orchestra-0.1.2/tests/test_models.py +119 -0
- llm_orchestra-0.1.2/tests/test_performance.py +249 -0
- llm_orchestra-0.1.2/tests/test_role_system.py +64 -0
- llm_orchestra-0.1.2/uv.lock +2053 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, macos-latest]
|
|
15
|
+
python-version: ["3.11", "3.12"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Install UV (Unix)
|
|
26
|
+
run: |
|
|
27
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
28
|
+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
uv sync --extra dev
|
|
33
|
+
|
|
34
|
+
- name: Run tests
|
|
35
|
+
run: |
|
|
36
|
+
uv run pytest
|
|
37
|
+
|
|
38
|
+
- name: Run linting
|
|
39
|
+
run: |
|
|
40
|
+
uv run ruff check .
|
|
41
|
+
uv run black --check .
|
|
42
|
+
|
|
43
|
+
# TODO: Fix type checking errors and re-enable
|
|
44
|
+
# - name: Run type checking
|
|
45
|
+
# run: |
|
|
46
|
+
# uv run mypy src/llm_orc
|
|
47
|
+
|
|
48
|
+
security:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
|
|
54
|
+
- name: Set up Python
|
|
55
|
+
uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: "3.11"
|
|
58
|
+
|
|
59
|
+
- name: Install UV
|
|
60
|
+
run: |
|
|
61
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
62
|
+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
63
|
+
|
|
64
|
+
- name: Install dependencies
|
|
65
|
+
run: |
|
|
66
|
+
uv sync --extra dev
|
|
67
|
+
|
|
68
|
+
- name: Run security checks
|
|
69
|
+
run: |
|
|
70
|
+
uv run pip-audit --desc
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
get-version:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
outputs:
|
|
12
|
+
current-version: ${{ steps.version.outputs.version }}
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Get current version
|
|
17
|
+
id: version
|
|
18
|
+
run: |
|
|
19
|
+
VERSION=$(grep -E '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
|
|
20
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
21
|
+
|
|
22
|
+
build:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- name: Set up Python
|
|
29
|
+
uses: actions/setup-python@v5
|
|
30
|
+
with:
|
|
31
|
+
python-version: "3.11"
|
|
32
|
+
|
|
33
|
+
- name: Install UV
|
|
34
|
+
run: |
|
|
35
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
36
|
+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
37
|
+
|
|
38
|
+
- name: Build package
|
|
39
|
+
run: |
|
|
40
|
+
uv build
|
|
41
|
+
|
|
42
|
+
- name: Check build artifacts
|
|
43
|
+
run: |
|
|
44
|
+
ls -la dist/
|
|
45
|
+
uv add twine
|
|
46
|
+
uv run python -m twine check dist/*
|
|
47
|
+
|
|
48
|
+
- name: Upload build artifacts
|
|
49
|
+
uses: actions/upload-artifact@v4
|
|
50
|
+
with:
|
|
51
|
+
name: dist
|
|
52
|
+
path: dist/
|
|
53
|
+
|
|
54
|
+
publish-pypi:
|
|
55
|
+
needs: [get-version, build]
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
environment:
|
|
58
|
+
name: pypi
|
|
59
|
+
url: https://pypi.org/project/llm-orchestra/
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- name: Download build artifacts
|
|
63
|
+
uses: actions/download-artifact@v4
|
|
64
|
+
with:
|
|
65
|
+
name: dist
|
|
66
|
+
path: dist/
|
|
67
|
+
|
|
68
|
+
- name: Publish to PyPI
|
|
69
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
70
|
+
continue-on-error: true
|
|
71
|
+
with:
|
|
72
|
+
password: ${{ secrets.PYPI_API_KEY }}
|
|
73
|
+
skip-existing: true
|
|
74
|
+
verbose: true
|
|
75
|
+
|
|
76
|
+
notify:
|
|
77
|
+
needs: [get-version, publish-pypi]
|
|
78
|
+
if: always() && needs.publish-pypi.result == 'success'
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
steps:
|
|
81
|
+
- name: Notify success
|
|
82
|
+
run: |
|
|
83
|
+
echo "🎉 Successfully published llm-orchestra v${{ needs.get-version.outputs.current-version }} to PyPI!"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
share/python-wheels/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.installed.cfg
|
|
22
|
+
*.egg
|
|
23
|
+
MANIFEST
|
|
24
|
+
|
|
25
|
+
# Testing
|
|
26
|
+
.coverage
|
|
27
|
+
.pytest_cache/
|
|
28
|
+
.tox/
|
|
29
|
+
.nox/
|
|
30
|
+
coverage.xml
|
|
31
|
+
*.cover
|
|
32
|
+
*.py,cover
|
|
33
|
+
.hypothesis/
|
|
34
|
+
|
|
35
|
+
# Virtual environments
|
|
36
|
+
.env
|
|
37
|
+
.venv/
|
|
38
|
+
env/
|
|
39
|
+
venv/
|
|
40
|
+
ENV/
|
|
41
|
+
env.bak/
|
|
42
|
+
venv.bak/
|
|
43
|
+
|
|
44
|
+
# IDE
|
|
45
|
+
.vscode/
|
|
46
|
+
.idea/
|
|
47
|
+
*.swp
|
|
48
|
+
*.swo
|
|
49
|
+
*~
|
|
50
|
+
|
|
51
|
+
# OS
|
|
52
|
+
.DS_Store
|
|
53
|
+
.DS_Store?
|
|
54
|
+
._*
|
|
55
|
+
.Spotlight-V100
|
|
56
|
+
.Trashes
|
|
57
|
+
ehthumbs.db
|
|
58
|
+
Thumbs.db
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Nathan Green
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.PHONY: test lint format setup clean install
|
|
2
|
+
|
|
3
|
+
# Development commands
|
|
4
|
+
setup:
|
|
5
|
+
uv sync
|
|
6
|
+
|
|
7
|
+
test:
|
|
8
|
+
uv run pytest
|
|
9
|
+
|
|
10
|
+
lint:
|
|
11
|
+
uv run ruff check src tests
|
|
12
|
+
uv run mypy src tests
|
|
13
|
+
|
|
14
|
+
format:
|
|
15
|
+
uv run black src tests
|
|
16
|
+
uv run ruff check --fix src tests
|
|
17
|
+
|
|
18
|
+
clean:
|
|
19
|
+
rm -rf build/ dist/ *.egg-info/ .venv/
|
|
20
|
+
find . -type d -name __pycache__ -exec rm -rf {} +
|
|
21
|
+
find . -type f -name "*.pyc" -delete
|
|
22
|
+
uv clean
|
|
23
|
+
|
|
24
|
+
install:
|
|
25
|
+
uv sync --no-dev
|
|
26
|
+
|
|
27
|
+
# TDD cycle helpers
|
|
28
|
+
red:
|
|
29
|
+
uv run pytest --tb=short -v
|
|
30
|
+
|
|
31
|
+
green:
|
|
32
|
+
uv run pytest --tb=short
|
|
33
|
+
|
|
34
|
+
refactor:
|
|
35
|
+
uv run pytest --tb=short && make lint
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: llm-orchestra
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Multi-agent LLM communication system with ensemble orchestration
|
|
5
|
+
Project-URL: Homepage, https://github.com/mrilikecoding/llm-orc
|
|
6
|
+
Project-URL: Repository, https://github.com/mrilikecoding/llm-orc
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/mrilikecoding/llm-orc/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/mrilikecoding/llm-orc#readme
|
|
9
|
+
Author-email: Nathan Green <contact@nate.green>
|
|
10
|
+
License: MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2025 Nathan Green
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Keywords: agents,ai,ensemble,llm,multi-agent,orchestration
|
|
33
|
+
Classifier: Development Status :: 4 - Beta
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: Intended Audience :: Science/Research
|
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
41
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
42
|
+
Requires-Python: >=3.11
|
|
43
|
+
Requires-Dist: aiohttp
|
|
44
|
+
Requires-Dist: anthropic
|
|
45
|
+
Requires-Dist: click
|
|
46
|
+
Requires-Dist: google-generativeai
|
|
47
|
+
Requires-Dist: ollama
|
|
48
|
+
Requires-Dist: pydantic
|
|
49
|
+
Requires-Dist: pyyaml
|
|
50
|
+
Requires-Dist: websockets
|
|
51
|
+
Provides-Extra: dev
|
|
52
|
+
Requires-Dist: black>=23.7.0; extra == 'dev'
|
|
53
|
+
Requires-Dist: build; extra == 'dev'
|
|
54
|
+
Requires-Dist: mypy>=1.5.0; extra == 'dev'
|
|
55
|
+
Requires-Dist: pip-audit>=2.6.0; extra == 'dev'
|
|
56
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
57
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
58
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
59
|
+
Requires-Dist: ruff>=0.0.287; extra == 'dev'
|
|
60
|
+
Requires-Dist: twine; extra == 'dev'
|
|
61
|
+
Description-Content-Type: text/markdown
|
|
62
|
+
|
|
63
|
+
# LLM Orchestra
|
|
64
|
+
|
|
65
|
+
A multi-agent LLM communication system for ensemble orchestration and intelligent analysis.
|
|
66
|
+
|
|
67
|
+
## Overview
|
|
68
|
+
|
|
69
|
+
LLM Orchestra lets you coordinate multiple AI agents for complex analysis tasks. Run code reviews with security and performance specialists, analyze architecture decisions from multiple angles, or get systematic coverage of any multi-faceted problem.
|
|
70
|
+
|
|
71
|
+
Mix expensive cloud models with free local models - use Claude for strategic insights while Llama3 handles systematic analysis tasks.
|
|
72
|
+
|
|
73
|
+
## Key Features
|
|
74
|
+
|
|
75
|
+
- **Multi-Agent Ensembles**: Coordinate specialized agents for different aspects of analysis
|
|
76
|
+
- **Cost Optimization**: Mix expensive and free models based on what each task needs
|
|
77
|
+
- **CLI Interface**: Simple commands with piping support (`cat code.py | llm-orc invoke code-review`)
|
|
78
|
+
- **YAML Configuration**: Easy ensemble setup with readable config files
|
|
79
|
+
- **Usage Tracking**: Token counting, cost estimation, and timing metrics
|
|
80
|
+
|
|
81
|
+
## Installation
|
|
82
|
+
|
|
83
|
+
### For End Users
|
|
84
|
+
```bash
|
|
85
|
+
pip install llm-orchestra
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### For Development
|
|
89
|
+
```bash
|
|
90
|
+
# Clone the repository
|
|
91
|
+
git clone https://github.com/mrilikecoding/llm-orc.git
|
|
92
|
+
cd llm-orc
|
|
93
|
+
|
|
94
|
+
# Install with development dependencies
|
|
95
|
+
uv sync --dev
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Quick Start
|
|
99
|
+
|
|
100
|
+
### 1. Create an Ensemble Configuration
|
|
101
|
+
|
|
102
|
+
Create `~/.llm-orc/ensembles/code-review.yaml`:
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
name: code-review
|
|
106
|
+
description: Multi-perspective code review ensemble
|
|
107
|
+
|
|
108
|
+
agents:
|
|
109
|
+
- name: security-reviewer
|
|
110
|
+
role: security-analyst
|
|
111
|
+
model: llama3
|
|
112
|
+
timeout_seconds: 60
|
|
113
|
+
|
|
114
|
+
- name: performance-reviewer
|
|
115
|
+
role: performance-analyst
|
|
116
|
+
model: llama3
|
|
117
|
+
timeout_seconds: 60
|
|
118
|
+
|
|
119
|
+
coordinator:
|
|
120
|
+
synthesis_prompt: |
|
|
121
|
+
You are a senior engineering lead. Synthesize the security and performance
|
|
122
|
+
analysis into actionable recommendations.
|
|
123
|
+
output_format: json
|
|
124
|
+
timeout_seconds: 90
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 2. Invoke an Ensemble
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Analyze code from a file
|
|
131
|
+
cat mycode.py | llm-orc invoke code-review
|
|
132
|
+
|
|
133
|
+
# Or provide input directly
|
|
134
|
+
llm-orc invoke code-review --input "Review this function: def add(a, b): return a + b"
|
|
135
|
+
|
|
136
|
+
# JSON output for integration
|
|
137
|
+
llm-orc invoke code-review --input "..." --output-format json
|
|
138
|
+
|
|
139
|
+
# List available ensembles
|
|
140
|
+
llm-orc list-ensembles
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Use Cases
|
|
144
|
+
|
|
145
|
+
### Code Review
|
|
146
|
+
Get systematic analysis across security, performance, and maintainability dimensions. Each agent focuses on their specialty while synthesis provides actionable recommendations.
|
|
147
|
+
|
|
148
|
+
### Architecture Review
|
|
149
|
+
Analyze system designs from scalability, security, performance, and reliability perspectives. Identify bottlenecks and suggest architectural patterns.
|
|
150
|
+
|
|
151
|
+
### Product Strategy
|
|
152
|
+
Evaluate business decisions from market, financial, competitive, and user experience angles. Get comprehensive analysis for complex strategic choices.
|
|
153
|
+
|
|
154
|
+
### Research Analysis
|
|
155
|
+
Systematic literature review, methodology evaluation, or multi-dimensional analysis of research questions.
|
|
156
|
+
|
|
157
|
+
## Model Support
|
|
158
|
+
|
|
159
|
+
- **Claude** (Anthropic) - Strategic analysis and synthesis
|
|
160
|
+
- **Gemini** (Google) - Multi-modal and reasoning tasks
|
|
161
|
+
- **Ollama** - Local deployment of open-source models (Llama3, etc.)
|
|
162
|
+
- **Custom models** - Extensible interface for additional providers
|
|
163
|
+
|
|
164
|
+
## Configuration
|
|
165
|
+
|
|
166
|
+
Ensemble configurations support:
|
|
167
|
+
|
|
168
|
+
- **Agent specialization** with role-specific prompts
|
|
169
|
+
- **Timeout management** per agent and coordinator
|
|
170
|
+
- **Model selection** with local and cloud options
|
|
171
|
+
- **Synthesis strategies** for combining agent outputs
|
|
172
|
+
- **Output formatting** (text, JSON) for integration
|
|
173
|
+
|
|
174
|
+
## Cost Optimization
|
|
175
|
+
|
|
176
|
+
- **Local models** (free) for systematic analysis tasks
|
|
177
|
+
- **Cloud models** (paid) reserved for strategic insights
|
|
178
|
+
- **Usage tracking** shows exactly what each analysis costs
|
|
179
|
+
- **Intelligent routing** based on task complexity
|
|
180
|
+
|
|
181
|
+
## Development
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Run tests
|
|
185
|
+
uv run pytest
|
|
186
|
+
|
|
187
|
+
# Run linting
|
|
188
|
+
uv run ruff check .
|
|
189
|
+
uv run black --check .
|
|
190
|
+
|
|
191
|
+
# Type checking
|
|
192
|
+
uv run mypy src/llm_orc
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Research
|
|
196
|
+
|
|
197
|
+
This project includes comparative analysis of multi-agent vs single-agent approaches. See [docs/ensemble_vs_single_agent_analysis.md](docs/ensemble_vs_single_agent_analysis.md) for detailed findings.
|
|
198
|
+
|
|
199
|
+
## Philosophy
|
|
200
|
+
|
|
201
|
+
**Reduce toil, don't replace creativity.** Use AI to handle systematic, repetitive analysis while preserving human creativity and strategic thinking.
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# LLM Orchestra
|
|
2
|
+
|
|
3
|
+
A multi-agent LLM communication system for ensemble orchestration and intelligent analysis.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
LLM Orchestra lets you coordinate multiple AI agents for complex analysis tasks. Run code reviews with security and performance specialists, analyze architecture decisions from multiple angles, or get systematic coverage of any multi-faceted problem.
|
|
8
|
+
|
|
9
|
+
Mix expensive cloud models with free local models - use Claude for strategic insights while Llama3 handles systematic analysis tasks.
|
|
10
|
+
|
|
11
|
+
## Key Features
|
|
12
|
+
|
|
13
|
+
- **Multi-Agent Ensembles**: Coordinate specialized agents for different aspects of analysis
|
|
14
|
+
- **Cost Optimization**: Mix expensive and free models based on what each task needs
|
|
15
|
+
- **CLI Interface**: Simple commands with piping support (`cat code.py | llm-orc invoke code-review`)
|
|
16
|
+
- **YAML Configuration**: Easy ensemble setup with readable config files
|
|
17
|
+
- **Usage Tracking**: Token counting, cost estimation, and timing metrics
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### For End Users
|
|
22
|
+
```bash
|
|
23
|
+
pip install llm-orchestra
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### For Development
|
|
27
|
+
```bash
|
|
28
|
+
# Clone the repository
|
|
29
|
+
git clone https://github.com/mrilikecoding/llm-orc.git
|
|
30
|
+
cd llm-orc
|
|
31
|
+
|
|
32
|
+
# Install with development dependencies
|
|
33
|
+
uv sync --dev
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
### 1. Create an Ensemble Configuration
|
|
39
|
+
|
|
40
|
+
Create `~/.llm-orc/ensembles/code-review.yaml`:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
name: code-review
|
|
44
|
+
description: Multi-perspective code review ensemble
|
|
45
|
+
|
|
46
|
+
agents:
|
|
47
|
+
- name: security-reviewer
|
|
48
|
+
role: security-analyst
|
|
49
|
+
model: llama3
|
|
50
|
+
timeout_seconds: 60
|
|
51
|
+
|
|
52
|
+
- name: performance-reviewer
|
|
53
|
+
role: performance-analyst
|
|
54
|
+
model: llama3
|
|
55
|
+
timeout_seconds: 60
|
|
56
|
+
|
|
57
|
+
coordinator:
|
|
58
|
+
synthesis_prompt: |
|
|
59
|
+
You are a senior engineering lead. Synthesize the security and performance
|
|
60
|
+
analysis into actionable recommendations.
|
|
61
|
+
output_format: json
|
|
62
|
+
timeout_seconds: 90
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2. Invoke an Ensemble
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Analyze code from a file
|
|
69
|
+
cat mycode.py | llm-orc invoke code-review
|
|
70
|
+
|
|
71
|
+
# Or provide input directly
|
|
72
|
+
llm-orc invoke code-review --input "Review this function: def add(a, b): return a + b"
|
|
73
|
+
|
|
74
|
+
# JSON output for integration
|
|
75
|
+
llm-orc invoke code-review --input "..." --output-format json
|
|
76
|
+
|
|
77
|
+
# List available ensembles
|
|
78
|
+
llm-orc list-ensembles
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Use Cases
|
|
82
|
+
|
|
83
|
+
### Code Review
|
|
84
|
+
Get systematic analysis across security, performance, and maintainability dimensions. Each agent focuses on their specialty while synthesis provides actionable recommendations.
|
|
85
|
+
|
|
86
|
+
### Architecture Review
|
|
87
|
+
Analyze system designs from scalability, security, performance, and reliability perspectives. Identify bottlenecks and suggest architectural patterns.
|
|
88
|
+
|
|
89
|
+
### Product Strategy
|
|
90
|
+
Evaluate business decisions from market, financial, competitive, and user experience angles. Get comprehensive analysis for complex strategic choices.
|
|
91
|
+
|
|
92
|
+
### Research Analysis
|
|
93
|
+
Systematic literature review, methodology evaluation, or multi-dimensional analysis of research questions.
|
|
94
|
+
|
|
95
|
+
## Model Support
|
|
96
|
+
|
|
97
|
+
- **Claude** (Anthropic) - Strategic analysis and synthesis
|
|
98
|
+
- **Gemini** (Google) - Multi-modal and reasoning tasks
|
|
99
|
+
- **Ollama** - Local deployment of open-source models (Llama3, etc.)
|
|
100
|
+
- **Custom models** - Extensible interface for additional providers
|
|
101
|
+
|
|
102
|
+
## Configuration
|
|
103
|
+
|
|
104
|
+
Ensemble configurations support:
|
|
105
|
+
|
|
106
|
+
- **Agent specialization** with role-specific prompts
|
|
107
|
+
- **Timeout management** per agent and coordinator
|
|
108
|
+
- **Model selection** with local and cloud options
|
|
109
|
+
- **Synthesis strategies** for combining agent outputs
|
|
110
|
+
- **Output formatting** (text, JSON) for integration
|
|
111
|
+
|
|
112
|
+
## Cost Optimization
|
|
113
|
+
|
|
114
|
+
- **Local models** (free) for systematic analysis tasks
|
|
115
|
+
- **Cloud models** (paid) reserved for strategic insights
|
|
116
|
+
- **Usage tracking** shows exactly what each analysis costs
|
|
117
|
+
- **Intelligent routing** based on task complexity
|
|
118
|
+
|
|
119
|
+
## Development
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Run tests
|
|
123
|
+
uv run pytest
|
|
124
|
+
|
|
125
|
+
# Run linting
|
|
126
|
+
uv run ruff check .
|
|
127
|
+
uv run black --check .
|
|
128
|
+
|
|
129
|
+
# Type checking
|
|
130
|
+
uv run mypy src/llm_orc
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Research
|
|
134
|
+
|
|
135
|
+
This project includes comparative analysis of multi-agent vs single-agent approaches. See [docs/ensemble_vs_single_agent_analysis.md](docs/ensemble_vs_single_agent_analysis.md) for detailed findings.
|
|
136
|
+
|
|
137
|
+
## Philosophy
|
|
138
|
+
|
|
139
|
+
**Reduce toil, don't replace creativity.** Use AI to handle systematic, repetitive analysis while preserving human creativity and strategic thinking.
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
MIT License - see [LICENSE](LICENSE) for details.
|