Skip to main content

Multi-agent LLM communication system with ensemble orchestration

Project description

LLM Orchestra

A multi-agent LLM communication system for ensemble orchestration and intelligent analysis.

Overview

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.

Mix expensive cloud models with free local models - use Claude for strategic insights while Llama3 handles systematic analysis tasks.

Key Features

  • Multi-Agent Ensembles: Coordinate specialized agents for different aspects of analysis
  • Cost Optimization: Mix expensive and free models based on what each task needs
  • CLI Interface: Simple commands with piping support (cat code.py | llm-orc invoke code-review)
  • Secure Authentication: Encrypted API key storage with easy credential management
  • YAML Configuration: Easy ensemble setup with readable config files
  • Usage Tracking: Token counting, cost estimation, and timing metrics

Installation

Option 1: Homebrew (macOS - Recommended)

# Add the tap
brew tap mrilikecoding/llm-orchestra

# Install LLM Orchestra
brew install llm-orchestra

# Verify installation
llm-orc --version

Option 2: pip (All Platforms)

# Install from PyPI
pip install llm-orchestra

# Verify installation
llm-orc --version

Option 3: Development Installation

# Clone the repository
git clone https://github.com/mrilikecoding/llm-orc.git
cd llm-orc

# Install with development dependencies
uv sync --dev

# Verify installation
uv run llm-orc --version

Updates

# Homebrew users
brew update && brew upgrade llm-orchestra

# pip users
pip install --upgrade llm-orchestra

Quick Start

1. Set Up Authentication

Before using LLM Orchestra, configure authentication for your LLM providers:

# Interactive setup wizard (recommended for first-time users)
llm-orc auth setup

# Or add providers individually
llm-orc auth add anthropic --api-key YOUR_ANTHROPIC_KEY
llm-orc auth add google --api-key YOUR_GOOGLE_KEY

# List configured providers
llm-orc auth list

# Test authentication
llm-orc auth test anthropic

# Remove a provider if needed
llm-orc auth remove anthropic

Security: API keys are encrypted and stored securely in ~/.config/llm-orc/credentials.yaml.

2. Configuration Options

LLM Orchestra supports both global and local configurations:

Global Configuration

Create ~/.config/llm-orc/ensembles/code-review.yaml:

name: code-review
description: Multi-perspective code review ensemble

agents:
  - name: security-reviewer
    role: security-analyst
    model: llama3
    timeout_seconds: 60

  - name: performance-reviewer
    role: performance-analyst  
    model: llama3
    timeout_seconds: 60

coordinator:
  synthesis_prompt: |
    You are a senior engineering lead. Synthesize the security and performance 
    analysis into actionable recommendations.
  output_format: json
  timeout_seconds: 90

Local Project Configuration

For project-specific ensembles, initialize local configuration:

# Initialize local configuration in your project
llm-orc config init

# This creates .llm-orc/ directory with:
# - ensembles/   (project-specific ensembles)
# - models/      (shared model configurations)
# - scripts/     (project-specific scripts)
# - config.yaml  (project configuration)

View Current Configuration

# Show configuration paths and status
llm-orc config show

3. Using LLM Orchestra

Basic Usage

# List available ensembles
llm-orc list-ensembles

# Get help for any command
llm-orc --help
llm-orc invoke --help

Invoke Ensembles

# Analyze code from a file (pipe input)
cat mycode.py | llm-orc invoke code-review

# Provide input directly
llm-orc invoke code-review --input "Review this function: def add(a, b): return a + b"

# JSON output for integration with other tools
llm-orc invoke code-review --input "..." --output-format json

# Use specific configuration directory
llm-orc invoke code-review --config-dir ./custom-config

Configuration Management

# Initialize local project configuration
llm-orc config init --project-name my-project

# Show current configuration status
llm-orc config show

# Migrate from old configuration location (if needed)
llm-orc config migrate

Use Cases

Code Review

Get systematic analysis across security, performance, and maintainability dimensions. Each agent focuses on their specialty while synthesis provides actionable recommendations.

Architecture Review

Analyze system designs from scalability, security, performance, and reliability perspectives. Identify bottlenecks and suggest architectural patterns.

Product Strategy

Evaluate business decisions from market, financial, competitive, and user experience angles. Get comprehensive analysis for complex strategic choices.

Research Analysis

Systematic literature review, methodology evaluation, or multi-dimensional analysis of research questions.

Model Support

  • Claude (Anthropic) - Strategic analysis and synthesis
  • Gemini (Google) - Multi-modal and reasoning tasks
  • Ollama - Local deployment of open-source models (Llama3, etc.)
  • Custom models - Extensible interface for additional providers

Configuration

Ensemble Configuration

Ensemble configurations support:

  • Agent specialization with role-specific prompts
  • Timeout management per agent and coordinator
  • Model selection with local and cloud options
  • Synthesis strategies for combining agent outputs
  • Output formatting (text, JSON) for integration

Configuration Hierarchy

LLM Orchestra follows a configuration hierarchy:

  1. Local project configuration (.llm-orc/ in current directory)
  2. Global user configuration (~/.config/llm-orc/)
  3. Command-line options (highest priority)

XDG Base Directory Support

Configurations follow the XDG Base Directory specification:

  • Global config: ~/.config/llm-orc/ (or $XDG_CONFIG_HOME/llm-orc/)
  • Automatic migration from old ~/.llm-orc/ location

Cost Optimization

  • Local models (free) for systematic analysis tasks
  • Cloud models (paid) reserved for strategic insights
  • Usage tracking shows exactly what each analysis costs
  • Intelligent routing based on task complexity

Development

# Run tests
uv run pytest

# Run linting and formatting
uv run ruff check .
uv run ruff format --check .

# Type checking
uv run mypy src/llm_orc

Research

This project includes comparative analysis of multi-agent vs single-agent approaches. See docs/ensemble_vs_single_agent_analysis.md for detailed findings.

Philosophy

Reduce toil, don't replace creativity. Use AI to handle systematic, repetitive analysis while preserving human creativity and strategic thinking.

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_orchestra-0.4.0.tar.gz (220.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_orchestra-0.4.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file llm_orchestra-0.4.0.tar.gz.

File metadata

  • Download URL: llm_orchestra-0.4.0.tar.gz
  • Upload date:
  • Size: 220.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_orchestra-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4bb632d875aeca22d0f83050e543528551e8c6a7953d4a5c9998e139165dd4fd
MD5 cf21d3878a2b821cb729b65b0ca47224
BLAKE2b-256 0c91af7f045c7745fef8f59d1d592512b89f41c83d99c79313772cdbb794f362

See more details on using hashes here.

File details

Details for the file llm_orchestra-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: llm_orchestra-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_orchestra-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73d23490047e28faa42eb3814298d17f853a43ee4c19cfe43f0f142a3185e181
MD5 410e26c4a52db850a21b2b9c6419b215
BLAKE2b-256 c91508e6e9a69b812383c6e42afdef369eb2ca110572784c16171469e44d264f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page