Skip to main content

A cost-aware, local-first council of heterogeneous LLMs for reliable reasoning, coding, and factual correctness

Project description

Parishad Gradient Logo

A cost-aware, local-first council of heterogeneous LLMs for reliable reasoning, coding, and factual correctness.

PyPI Version Python Version License Code Style Type Checked


๐Ÿ“– Overview

Parishad (Hindi: Council) orchestrates multiple local language models into a structured reasoning pipeline. Instead of relying on a single massive model, Parishad coordinates specialized, smaller models (2B-34B parameters) into functional roles based on traditional Indian administrative titles.

This approach achieves higher reliability and lower latency on consumer hardware (Mac Silicon, NVIDIA GPUs) by assigning tasks to the most appropriate model slot (Small/Medium/Big) tailored to your compute budget.

โœจ Key Features

  • ๐Ÿ›๏ธ Heterogeneous Model Council: Seamlessly orchestrate varying model sizes (e.g., Phi-3 for syntax, Llama-3 for reasoning, Mixtral for judgment).
  • ๐Ÿ–ฅ๏ธ Beautiful TUI Dashboard: Real-time interactive terminal interface with visual role tracking, progress bars, and emoji indicators.
  • ๐Ÿ‘๏ธ Vision Capabilities: Integrated PerceptionTool allows the council to "see" and analyze images via local VLMs.
  • ๐Ÿ’ฐ Cost-Aware Execution: Define token budgets per query; the council adapts its strategy to stay within limits.
  • ๐Ÿ›ก๏ธ Structured Verification: The Prerak (Checker) role actively challenges hallucinations using deterministic tools and cross-examination.
  • ๐Ÿ”Œ Local-First Backends: Native support for Ollama, Llama.cpp, MLX, and Transformers.

๐Ÿ›๏ธ The Three Sabhas (Council Configurations)

Parishad offers three distinct council sizes to balance speed, cost, and depth:

1. Laghu Sabha (Fast Council)

  • Roles: 5 (Darbari, Majumdar, Sainik, Prerak, Raja)
  • Use Case: Quick queries, simple code generation, factual checks.
  • Models: Optimized for Small/Mid models.

2. Madhya Sabha (Core Council)

  • Roles: 8 (Adds Sar Senapati [Coordinator], Sacheev [Secretary], Dandadhyaksha [Magistrate])
  • Use Case: Balanced reasoning for standard development tasks.
  • Models: Uses Mid/Big models for deeper analysis.

3. Maha Sabha (Extended Council)

  • Roles: 10 (Adds Pantapradhan [Prime Minister], Vidushak [Lateral Thinker])
  • Use Case: Complex system design, creative problem solving, and strategic planning.
  • Models: Full spectrum orchestration (Small + Mid + Big).

๐Ÿ—๏ธ Architecture

Parishad organizes models into a directed graph of roles:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  DARBARI  โ”‚ โ”€โ”€โ–บ  โ”‚ MAJUMDAR  โ”‚ โ”€โ”€โ–บ  โ”‚  SAINIK   โ”‚
โ”‚ (Refiner) โ”‚      โ”‚ (Planner) โ”‚      โ”‚ (Worker)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                            โ”‚
                                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   RAJA    โ”‚ โ—„โ”€โ”€  โ”‚  PRERAK   โ”‚ โ—„โ”€โ”€  โ”‚ SYSTEM &  โ”‚
โ”‚  (Judge)  โ”‚      โ”‚ (Checker) โ”‚      โ”‚   TOOLS   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Darbari: Normalizes vague user queries into structured task specifications.
  • Majumdar: Decomposes complex tasks into stepwise execution plans.
  • Sainik: Executes steps, writing code or generating content using tools.
  • Prerak: Validates output against facts, schema, or safety policies.
  • Raja: Synthesizes the final answer and assigns a confidence score.

๐Ÿ“ฆ Installation

Standard Install

pip install parishad

Optimized Install Options

Choose the backend that matches your hardware:

# Apple Silicon (M1/M2/M3) - Recommended
pip install "parishad[mlx]"

# NVIDIA GPU / Local Parsing
pip install "parishad[local,cuda]"

# With Retrieval (RAG) capabilities
pip install "parishad[retrieval]"

# For Developers (Linting, Testing)
pip install "parishad[dev]"

๐Ÿš€ Quick Start

1. Launch & Setup

Run the main command to initialize the council. This automatically handles permissions, scans for models (Ollama/HF), and launches the TUI.

parishad

Pro Tip: Use /sabha to switch between council sizes (e.g., laghu for speed, maha for deep reasoning) and /scan to find new local models.

2. CLI Direct Execution

Run a specific task without entering the interactive shell.

parishad run --sabha madhyam "Analyze the 'data.csv' file and plot trends"

3. Python API

Integrate Parishad into your own applications.

from parishad import Parishad

# Initialize the council
council = Parishad(config="core")

# Execute a complex query
result = council.run("Design a scalable REST API architecture for a bookstore.")

print(f"Final Answer: {result.final_answer}")
print(f"Confidence: {result.confidence_score}/10")
# Full execution trace available in result.trace

๐ŸŽฎ Interactive Features

Unlock the full power of the council with these TUI capabilities:

โšก Slash Commands

Control the session without leaving the chat interface:

  • /sabha [mode]: Switch council configuration instantly (e.g., /sabha laghu for speed, /sabha maha for power).
  • /scan: Re-scan your system for newly downloaded models.
  • /roles: View currently active roles, their models, and slot assignments.
  • /history: View past queries and load previous traces.
  • /clear: Reset the conversation context.

๐Ÿ“Ž Context Awareness (@ Mentions)

Parishad allows you to "chat with your files". Directly reference local files in your query:

  • @path/to/file.py: Reads the file and adds it to the context.
  • @src/: Scans the directory structure.

Example:

"Analyze @src/main.py and refactor the ErrorHandler class."

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Install dev dependencies: pip install -e ".[dev]"
  3. Ensure code style compliance: black . && ruff check .
  4. Submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License.


Built with โค๏ธ by Om Mohite & Ashish Prajapati. Trusted by developers for local agentic workflows.

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

parishad-0.1.5.tar.gz (372.5 kB view details)

Uploaded Source

Built Distribution

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

parishad-0.1.5-py3-none-any.whl (202.8 kB view details)

Uploaded Python 3

File details

Details for the file parishad-0.1.5.tar.gz.

File metadata

  • Download URL: parishad-0.1.5.tar.gz
  • Upload date:
  • Size: 372.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for parishad-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e6fdc9273f3585a9b414eddf09adc5ee75a78845927be7a81f0e8ec0960a2578
MD5 16c6aeb6160cbfc2298272ab959d33be
BLAKE2b-256 eaa707e65b8d5488feba24e19c405231a085e2c8c7c6fd5597304cf7adaa2184

See more details on using hashes here.

File details

Details for the file parishad-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: parishad-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 202.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for parishad-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 aef1db696897474ebb3aa5a0292bab204aad83c11ddd0ed06fcc5e83d82b5b3f
MD5 b3f56e5c7fff3b595147148fe6b09d61
BLAKE2b-256 88670f062ac61bb8798b8219094d7558ac2f82f4d3bb8dcf38e1d65512d25016

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