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-1.0.1.tar.gz (406.7 kB view details)

Uploaded Source

Built Distribution

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

parishad-1.0.1-py3-none-any.whl (235.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for parishad-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0a3a6b056f551474f5753187056c62b9c389989fd1d3cf26a8f21084ce631840
MD5 2583097373e710a6fe40e677d7d0b159
BLAKE2b-256 af8c700ae6ee1df7a4cea5b2beddbbcbf1cffec033f3c0057eed88b6a094c28e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for parishad-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf2dee33212c8d2aa030396d8f494d85f6f515a4bf970c8fe29e83dbf79ec192
MD5 337413104561f1b1b5466faf2691c223
BLAKE2b-256 ce3af6f54767d7f9dd23e3028d03e24ad03798ecbb118abb643c56f7a6da2eca

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