A cost-aware, local-first council of heterogeneous LLMs for reliable reasoning, coding, and factual correctness
Project description
A cost-aware, local-first council of heterogeneous LLMs for reliable reasoning, coding, and factual correctness.
๐ 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
PerceptionToolallows 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 laghufor speed,/sabha mahafor 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:
- Fork the repository.
- Install dev dependencies:
pip install -e ".[dev]" - Ensure code style compliance:
black . && ruff check . - Submit a Pull Request.
๐ License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parishad-0.1.7.tar.gz.
File metadata
- Download URL: parishad-0.1.7.tar.gz
- Upload date:
- Size: 373.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ac49994eaeb823f6bf56904ba95918983503ef327b98df1ff53a8b09966e7c8
|
|
| MD5 |
d4a54a3031013555d85cf3310f6b80f4
|
|
| BLAKE2b-256 |
161a2bdf7e345e8438660edf957ab7fb8f6a3ec47ea1c05fd13f993972999838
|
File details
Details for the file parishad-0.1.7-py3-none-any.whl.
File metadata
- Download URL: parishad-0.1.7-py3-none-any.whl
- Upload date:
- Size: 203.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78c36c01c679486b9d0a9a257b2163300693b84eaae1dd3a84bb2e5a45efcf9f
|
|
| MD5 |
ad797679642e2208d60247f34e93cbf7
|
|
| BLAKE2b-256 |
20a61e9b0b71af1a609cb8af4f6241138aabecd6dd98fbf465eef09c4d450d32
|