Skip to content

a specialized architecture that orchestrates multiple LLMs to deliberate, peer-review, and refine code in real-time. Designed for developers who need high-accuracy, production-ready code generation through collaborative AI intelligence.

Notifications You must be signed in to change notification settings

TrentPierce/PolyCode

Repository files navigation

PolyCode IDE

⚠️ ALPHA STATE WARNING: This application is currently in active development (Alpha). Many features typically found in mature IDEs may be incomplete, unstable, or missing. Not all features work as expected. Use with caution.

PolyCode IDE Interface

AI-Powered IDE with Multi-Model Deliberation Architecture

Inspired by PolyCouncil's proven multi-model deliberation system, PolyCode IDE is a locally-run, AI-powered code editor that uses multiple LLMs through LMStudio to generate and edit code collaboratively.

Features

  • Multi-Model Deliberation: Uses PolyCouncil's architecture with parallel model execution, rubric-based scoring, and weighted consensus voting
  • Local LLM Integration: Fully local execution using LMStudio (no external API calls)
  • VS Code-like Interface: Familiar file explorer and editor experience
  • Multi-Language Support: JavaScript, TypeScript, Python, Java, C/C++, and more
  • AI Code Generation: Generate code from natural language prompts
  • AI Code Editing: Edit existing code with natural language instructions
  • Code Analysis: Analyze code quality using multi-model evaluation

πŸ‘¨β€πŸ’» Developers: Check out our comprehensive Developer Guide to start contributing!

Architecture

Core Components

  1. PolyCouncil Orchestrator (src/main/core/orchestrator.js)

    • Coordinates multiple LLMs in parallel
    • Implements rubric-based scoring
    • Performs weighted consensus voting
    • Assigns personas to different models
  2. LMStudio Client (src/main/core/lmstudio-client.js)

    • Handles communication with local LMStudio API
    • OpenAI-compatible interface
    • Model management and connection checking
  3. Code Rubric (src/main/core/rubric.js)

    • Defines evaluation criteria (correctness, quality, best practices, etc.)
    • Calculates weighted scores
    • Evaluates code quality
  4. Frontend (src/renderer/)

    • React-based UI
    • Monaco Editor (VS Code's editor)
    • File explorer
    • AI assistant panel

Prerequisites

  1. Node.js (v18 or higher)
  2. LMStudio - Download from lmstudio.ai
    • Install and start LMStudio
    • Load at least one language model
    • Ensure API server is running on http://localhost:1234

Installation

  1. Clone or navigate to the project directory:
cd PolyCode
  1. Install dependencies:
npm install
  1. Build the React frontend (if using a bundler):
# For development, you may need to set up a build process
# For now, the app loads directly from files

Usage

  1. Start LMStudio:

    • Open LMStudio
    • Load one or more language models
    • Start the local server (usually runs on port 1234)
  2. Start PolyCode IDE:

npm start
  1. Using the IDE:
    • Create or open files using the file explorer
    • Use the AI panel to:
      • Generate Code: Describe what you want to build
      • Edit Code: Provide instructions to modify existing code
      • Analyze Code: Get quality analysis and recommendations

How Multi-Model Deliberation Works

  1. Parallel Generation: Multiple LLMs generate code independently, each with a different persona (architect, engineer, reviewer, optimizer)

  2. Cross-Evaluation: Each model evaluates all other models' outputs using the rubric system

  3. Weighted Voting: Scores are aggregated using weighted averages

  4. Consensus Selection: The best generation is selected based on aggregated scores

This approach ensures higher quality code by leveraging the strengths of multiple models and perspectives.

Project Structure

PolyCode/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/                 # Electron main process
β”‚   β”‚   β”œβ”€β”€ main.js          # Main entry point
β”‚   β”‚   β”œβ”€β”€ preload.js       # Preload script for IPC
β”‚   β”‚   └── core/
β”‚   β”‚       β”œβ”€β”€ orchestrator.js    # PolyCouncil orchestrator
β”‚   β”‚       β”œβ”€β”€ lmstudio-client.js # LMStudio API client
β”‚   β”‚       └── rubric.js          # Code evaluation rubric
β”‚   └── renderer/            # React frontend
β”‚       β”œβ”€β”€ app.jsx          # Main React app
β”‚       β”œβ”€β”€ components/      # React components
β”‚       β”‚   β”œβ”€β”€ Editor.jsx
β”‚       β”‚   β”œβ”€β”€ FileExplorer.jsx
β”‚       β”‚   β”œβ”€β”€ AIPanel.jsx
β”‚       β”‚   └── StatusBar.jsx
β”‚       └── styles/
β”‚           └── main.css
β”œβ”€β”€ package.json
└── README.md

Configuration

Model Configuration

You can configure which models and personas to use by modifying the orchestrator configuration. The system automatically detects available models from LMStudio.

Rubric Customization

Edit src/main/core/rubric.js to customize evaluation criteria and weights.

For Developers

PolyCode IDE is built with Electron, React, and TypeScript. We welcome contributions from developers!

Documentation

  • Developer Guide - Comprehensive guide for developers

    • Quick start for new developers
    • Project structure overview
    • Architecture overview
    • Development environment setup
    • Common development tasks
    • Debugging guide
  • Setup Guide - Setup and installation instructions

    • Prerequisites (Node.js, LMStudio, etc.)
    • Installation steps
    • Configuration steps
    • First-time setup
    • Platform-specific notes
    • Troubleshooting common issues
  • Contributing Guide - Contribution guidelines

    • How to contribute (bug reports, features, PRs)
    • Code review process
    • Commit message conventions
    • Branch naming conventions
    • Coding standards
    • Testing requirements
  • Code Style Guide - Code style and formatting

    • Naming conventions
    • Code formatting rules
    • React/JSX conventions
    • JavaScript/TypeScript conventions
    • Comments and documentation
    • Best practices
  • Testing Guide - Testing instructions

    • How to run tests
    • Writing unit, integration, and E2E tests
    • Test organization
    • Test coverage requirements
    • Debugging tests
  • Deployment Guide - Build and deployment

    • Build commands
    • Platform-specific builds
    • Electron packaging
    • Distribution formats
    • Signing configuration
    • Release process

Additional Documentation

Development

Running in Development Mode

npm run dev

This will start the app with developer tools enabled.

Building for Production

npm run build

Platform-specific builds:

npm run build:win    # Windows
npm run build:mac    # macOS
npm run build:linux  # Linux

Running Tests

npm test                    # Run all tests
npm run test:watch          # Run tests in watch mode
npm run test:coverage       # Run tests with coverage report

Recently Completed Enhancements (v1.1.0)

Phase 1: Security & Performance (Tasks 01-06)

  • βœ… Input validation & sanitization
  • βœ… Code execution sandboxing
  • βœ… Error recovery system
  • βœ… Optimized deliberation parallelization
  • βœ… Response caching system
  • βœ… Bundle size optimization

Phase 1: UX Improvements (Tasks 07-10)

  • βœ… Keyboard shortcuts system (17+ shortcuts, customizable)
  • βœ… Monaco editor enhancements (custom theme, auto-save, multi-cursor)
  • βœ… Save confirmation dialogs (dirty tracking, auto-save indicator)
  • βœ… File explorer improvements (icons, search, context menu, breadcrumbs)

Phase 2: Core Features (Tasks 11-16)

  • βœ… Git integration (status, commit, push, pull, branches, history, diffs)
  • βœ… Terminal integration (multi-tabbed, shell commands, project-aware)
  • βœ… Code snippets system (75+ snippets, Ctrl+Space, custom snippets)
  • βœ… LSP support foundation (diagnostics, hover, go-to-definition, auto-complete)
  • βœ… TypeScript migration setup (strict mode, tsconfig, build support)
  • βœ… Unit testing framework (Jest, 11/11 tests passing)

Phase 3: Code Quality (Tasks 18, 20, 21, 24)

  • βœ… Enhanced rubric evaluation (LLM-based scoring, quality metrics)
  • βœ… Dependency upgrades (18 packages, security fixes)
  • βœ… Logging framework (Winston, structured logs, file rotation)
  • βœ… Developer guide creation (7 new comprehensive docs)

Phase 4: Advanced Features (Tasks 15, 19, 22, 23)

  • βœ… Debugging capabilities (breakpoints, step-through, variables, call stack)
  • βœ… Code deduplication (18% reduction, shared utilities, API layer)
  • βœ… State management system (Zustand store, persistence, 7 state slices)
  • βœ… Inline documentation (83% JSDoc coverage, usage examples)

Future Enhancements

  • Real-time code suggestions
  • Multi-file project context
  • Plugin system
  • Model performance tracking
  • Custom persona definitions

License

MIT

Acknowledgments

Inspired by the PolyCouncil project's multi-model deliberation architecture.

About

a specialized architecture that orchestrates multiple LLMs to deliberate, peer-review, and refine code in real-time. Designed for developers who need high-accuracy, production-ready code generation through collaborative AI intelligence.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published