parishad 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- parishad/__init__.py +1 -1
- parishad/cli/code.py +15 -2
- parishad/cli/main.py +5 -0
- parishad/config/pipeline.core.yaml +1 -1
- parishad/config/pipeline.extended.yaml +1 -1
- parishad/config/pipeline.fast.yaml +1 -1
- parishad/data/models.json +1 -1
- parishad/orchestrator/config_loader.py +2 -2
- parishad/roles/sainik.py +1 -0
- parishad/utils/installer.py +86 -0
- {parishad-0.1.4.dist-info → parishad-0.1.6.dist-info}/METADATA +1 -1
- {parishad-0.1.4.dist-info → parishad-0.1.6.dist-info}/RECORD +15 -14
- {parishad-0.1.4.dist-info → parishad-0.1.6.dist-info}/WHEEL +0 -0
- {parishad-0.1.4.dist-info → parishad-0.1.6.dist-info}/entry_points.txt +0 -0
- {parishad-0.1.4.dist-info → parishad-0.1.6.dist-info}/licenses/LICENSE +0 -0
parishad/__init__.py
CHANGED
|
@@ -5,7 +5,7 @@ Parishad orchestrates multiple local language models into a structured "council"
|
|
|
5
5
|
that achieves higher reliability than a single model under strict compute budgets.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "0.1.
|
|
8
|
+
__version__ = "0.1.6"
|
|
9
9
|
|
|
10
10
|
from .orchestrator.engine import Parishad, ParishadEngine, PipelineConfig
|
|
11
11
|
from .models.runner import ModelRunner, ModelConfig
|
parishad/cli/code.py
CHANGED
|
@@ -2707,6 +2707,12 @@ class ParishadApp(App):
|
|
|
2707
2707
|
|
|
2708
2708
|
self.log_message(f"[dim]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[/dim]\n")
|
|
2709
2709
|
|
|
2710
|
+
# Check for silent file generation (common source of confusion)
|
|
2711
|
+
for role_output in trace.roles:
|
|
2712
|
+
if role_output.core_output and role_output.core_output.get("target_file"):
|
|
2713
|
+
fpath = role_output.core_output.get("target_file")
|
|
2714
|
+
self.log_message(f"\n[bold blue]📁 File Generated:[/bold blue] {fpath}")
|
|
2715
|
+
|
|
2710
2716
|
# Display the final answer from Raja
|
|
2711
2717
|
if trace.final_answer:
|
|
2712
2718
|
answer = trace.final_answer.final_answer
|
|
@@ -2714,15 +2720,22 @@ class ParishadApp(App):
|
|
|
2714
2720
|
elif trace.error:
|
|
2715
2721
|
self.log_message(f"\n[red]Error: {trace.error}[/red]")
|
|
2716
2722
|
else:
|
|
2717
|
-
|
|
2723
|
+
# Check if we generated a file but no text answer
|
|
2724
|
+
file_gen = any(r.core_output and r.core_output.get("target_file") for r in trace.roles)
|
|
2725
|
+
if not file_gen:
|
|
2726
|
+
self.log_message("\n[yellow]No answer generated[/yellow]")
|
|
2718
2727
|
|
|
2719
2728
|
except Exception as e:
|
|
2720
2729
|
import traceback
|
|
2721
2730
|
tb = traceback.format_exc()
|
|
2722
2731
|
self.log_message(f"\n[red]Error ({type(e).__name__}): {e}[/red]\n[dim]{tb[:500]}...[/dim]")
|
|
2723
2732
|
finally:
|
|
2724
|
-
# Always reset processing flag
|
|
2733
|
+
# Always reset processing flag and re-enable input
|
|
2725
2734
|
self._processing_query = False
|
|
2735
|
+
try:
|
|
2736
|
+
self.query_one("#user-input").focus()
|
|
2737
|
+
except:
|
|
2738
|
+
pass
|
|
2726
2739
|
|
|
2727
2740
|
def handle_command(self, parsed: ParsedInput) -> None:
|
|
2728
2741
|
"""Handle slash commands with ParsedInput."""
|
parishad/cli/main.py
CHANGED
|
@@ -189,6 +189,11 @@ def cli(ctx):
|
|
|
189
189
|
config - View or modify configuration
|
|
190
190
|
sthapana - स्थापना (Setup) - Configure your Parishad Sabha
|
|
191
191
|
"""
|
|
192
|
+
if ctx.invoked_subcommand != "init":
|
|
193
|
+
# Check backend installation (skip for init/config commands if needed, but safer to just check)
|
|
194
|
+
from ..utils.installer import check_and_install_backend
|
|
195
|
+
check_and_install_backend()
|
|
196
|
+
|
|
192
197
|
if ctx.invoked_subcommand is None:
|
|
193
198
|
# First run - ask for permissions
|
|
194
199
|
if is_first_run():
|
parishad/data/models.json
CHANGED
|
@@ -21,7 +21,7 @@ class RoleSpec:
|
|
|
21
21
|
name: str
|
|
22
22
|
class_name: str
|
|
23
23
|
slot: str
|
|
24
|
-
version: str = "0.1.
|
|
24
|
+
version: str = "0.1.6"
|
|
25
25
|
budget_tokens: int = 1000
|
|
26
26
|
dependencies: list[str] = field(default_factory=list)
|
|
27
27
|
max_tokens: Optional[int] = None
|
|
@@ -110,7 +110,7 @@ def load_pipeline_config(name: str, config_dir: Optional[Path] = None) -> list[R
|
|
|
110
110
|
name=role_name.lower(), # Always store as lowercase for consistent lookups
|
|
111
111
|
class_name=role_config.get("class", role_name.capitalize()),
|
|
112
112
|
slot=role_config.get("slot", "mid"),
|
|
113
|
-
version=role_config.get("version", "0.1.
|
|
113
|
+
version=role_config.get("version", "0.1.6"),
|
|
114
114
|
budget_tokens=role_config.get("budget_tokens", 1000),
|
|
115
115
|
dependencies=role_config.get("dependencies", []),
|
|
116
116
|
max_tokens=role_config.get("max_tokens"),
|
parishad/roles/sainik.py
CHANGED
|
@@ -53,6 +53,7 @@ Guidelines:
|
|
|
53
53
|
- If writing code, put the COMPLETE runnable code in "content".
|
|
54
54
|
- If writing text, put the clear explanation in "content".
|
|
55
55
|
- If the user asked to change/create a file, you MUST specify "target_file".
|
|
56
|
+
- IMPORTANT: Do NOT create files unless explicitly asked! For general questions/explanations, keep "target_file": null.
|
|
56
57
|
- "target_file" should be relative to the current directory (e.g., "src/main.py").
|
|
57
58
|
- If "target_file" is a text/markdown/json file (not executable code), put the RAW content in "content". DO NOT write a Python script to create it.
|
|
58
59
|
- If you need to Use a tool, add it to `tool_calls`. Available tools will be listed in the prompt.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
import platform
|
|
5
|
+
import os
|
|
6
|
+
import importlib.util
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
|
|
9
|
+
console = Console()
|
|
10
|
+
|
|
11
|
+
def check_and_install_backend():
|
|
12
|
+
"""
|
|
13
|
+
Check if llama-cpp-python is installed.
|
|
14
|
+
If not, automatically install it using pre-built wheels or optimal settings.
|
|
15
|
+
"""
|
|
16
|
+
if importlib.util.find_spec("llama_cpp") is not None:
|
|
17
|
+
return
|
|
18
|
+
|
|
19
|
+
console.print("\n[bold yellow]⚠️ Core backend (llama-cpp-python) is missing.[/bold yellow]")
|
|
20
|
+
console.print("[dim]Parishad needs this to run local models.[/dim]")
|
|
21
|
+
|
|
22
|
+
system = platform.system()
|
|
23
|
+
|
|
24
|
+
# 1. Windows: The main pain point. Use pre-built wheels.
|
|
25
|
+
if system == "Windows":
|
|
26
|
+
console.print("\n[cyan]🪟 Windows detected. Scanning for NVIDIA GPU...[/cyan]")
|
|
27
|
+
|
|
28
|
+
use_cuda = False
|
|
29
|
+
try:
|
|
30
|
+
# Simple check for nvcc
|
|
31
|
+
subprocess.run(["nvcc", "--version"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
32
|
+
console.print("[green]✓ CUDA Toolkit detected (nvcc found).[/green]")
|
|
33
|
+
use_cuda = True
|
|
34
|
+
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
35
|
+
console.print("[yellow]! CUDA not found. Defaulting to CPU.[/yellow]")
|
|
36
|
+
console.print("[dim](If you have an NVIDIA GPU, install CUDA Toolkit 12.x for 10x speed)[/dim]")
|
|
37
|
+
|
|
38
|
+
console.print(f"\n[bold green]🚀 Auto-installing optimized backend for {'CUDA 12.x' if use_cuda else 'CPU'}...[/bold green]")
|
|
39
|
+
console.print("[dim]This may take a minute...[/dim]\n")
|
|
40
|
+
|
|
41
|
+
cmd = [sys.executable, "-m", "pip", "install", "llama-cpp-python"]
|
|
42
|
+
cmd.extend(["--prefer-binary", "--extra-index-url"])
|
|
43
|
+
|
|
44
|
+
if use_cuda:
|
|
45
|
+
# Use cu124 wheels (compatible with most modern 12.x)
|
|
46
|
+
cmd.append("https://abetlen.github.io/llama-cpp-python/whl/cu124")
|
|
47
|
+
else:
|
|
48
|
+
cmd.append("https://abetlen.github.io/llama-cpp-python/whl/cpu")
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
subprocess.check_call(cmd)
|
|
52
|
+
console.print("\n[bold green]✓ Backend installed successfully![/bold green]")
|
|
53
|
+
except subprocess.CalledProcessError:
|
|
54
|
+
console.print("\n[bold red]❌ Installation failed.[/bold red]")
|
|
55
|
+
console.print("Please copy-paste this command manually:")
|
|
56
|
+
console.print(f" {' '.join(cmd)}")
|
|
57
|
+
sys.exit(1)
|
|
58
|
+
|
|
59
|
+
# 2. Mac: Enable Metal
|
|
60
|
+
elif system == "Darwin":
|
|
61
|
+
console.print("\n[cyan]🍎 Mac detected. Installing with Metal (GPU) support...[/cyan]")
|
|
62
|
+
|
|
63
|
+
env = os.environ.copy()
|
|
64
|
+
env["CMAKE_ARGS"] = "-DGGML_METAL=on"
|
|
65
|
+
|
|
66
|
+
cmd = [sys.executable, "-m", "pip", "install", "llama-cpp-python"]
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
subprocess.check_call(cmd, env=env)
|
|
70
|
+
console.print("\n[bold green]✓ Backend installed successfully![/bold green]")
|
|
71
|
+
except subprocess.CalledProcessError:
|
|
72
|
+
console.print("\n[bold red]❌ Installation failed.[/bold red]")
|
|
73
|
+
sys.exit(1)
|
|
74
|
+
|
|
75
|
+
# 3. Linux: Standard install
|
|
76
|
+
else:
|
|
77
|
+
console.print("\n[cyan]🐧 Linux detected. Installing from PyPI...[/cyan]")
|
|
78
|
+
cmd = [sys.executable, "-m", "pip", "install", "llama-cpp-python"]
|
|
79
|
+
try:
|
|
80
|
+
subprocess.check_call(cmd)
|
|
81
|
+
console.print("\n[bold green]✓ Backend installed successfully![/bold green]")
|
|
82
|
+
except subprocess.CalledProcessError:
|
|
83
|
+
sys.exit(1)
|
|
84
|
+
|
|
85
|
+
# clear some space
|
|
86
|
+
print()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: parishad
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: A cost-aware, local-first council of heterogeneous LLMs for reliable reasoning, coding, and factual correctness
|
|
5
5
|
Project-URL: Homepage, https://github.com/parishad-council/parishad
|
|
6
6
|
Project-URL: Documentation, https://github.com/parishad-council/parishad#readme
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
parishad/__init__.py,sha256=
|
|
1
|
+
parishad/__init__.py,sha256=y1Kid6blaHCTzk4WMfwDHHNnHm5ghqA8qNTz6uO4U48,1199
|
|
2
2
|
parishad/__main__.py,sha256=0qrXs91zon0xM17c5HTrkiSBZwiRfMJV2jOo0qP7MJ8,146
|
|
3
3
|
parishad/checker/__init__.py,sha256=m-Vl5emTwJWumsIbLY7g5pslU9m1uTcJNAxnGJPbkJU,540
|
|
4
4
|
parishad/checker/deterministic.py,sha256=reXH8aew_pBGn85MRMQcHRzi6fWU_JaGniimYUqsly0,20477
|
|
5
5
|
parishad/checker/ensemble.py,sha256=ozJwmQFNY4ojcYB3I0o5-3xUk43tdDqHm-jGVgO6Bhg,17506
|
|
6
6
|
parishad/checker/retrieval.py,sha256=jQ5Zf38Y1rcBrhmAOyNs4sTHFwF98Iqugsw1rGLHPks,16974
|
|
7
7
|
parishad/cli/__init__.py,sha256=iI_jctu7iGt7SZMfdkAQ75eFORLjy4soWC9DMzV8WaI,67
|
|
8
|
-
parishad/cli/code.py,sha256=
|
|
9
|
-
parishad/cli/main.py,sha256=
|
|
8
|
+
parishad/cli/code.py,sha256=YTUKZrecm82cr0WZAqk4bV0slU3zLHqYJwg-Jcaa-Ok,119367
|
|
9
|
+
parishad/cli/main.py,sha256=qTegCLubN38iYivhrvdJFz-akwyWAKEOegq9XioTeuY,38513
|
|
10
10
|
parishad/cli/prarambh.py,sha256=4vvRzJHWC6ECPdL4IKv5laZDy4v3ZYDq4vjqu3Hll30,4296
|
|
11
11
|
parishad/cli/sthapana.py,sha256=Sxk-TA-WCKW2CSPBQPhhEgaON60HKVDUaMorFjc-BNQ,13534
|
|
12
12
|
parishad/config/modes.py,sha256=eh4B5ZUUPN6HqYAj5hLudTqkyxBHKhIsx_Q_BvSduGk,4066
|
|
13
|
-
parishad/config/pipeline.core.yaml,sha256=
|
|
14
|
-
parishad/config/pipeline.extended.yaml,sha256=
|
|
15
|
-
parishad/config/pipeline.fast.yaml,sha256=
|
|
13
|
+
parishad/config/pipeline.core.yaml,sha256=9f1BeR4zlXLeImn5SYtonova1rEW4fbyvhppG_hN41w,2960
|
|
14
|
+
parishad/config/pipeline.extended.yaml,sha256=VVQMZxjqwqJFV1xhYcJzaaiHV8zjGbDuR0FGITvGrXY,4187
|
|
15
|
+
parishad/config/pipeline.fast.yaml,sha256=RGBRSdc6WoQq_89_F-qFQLfhowwCSzJ15xtRdjRqCIQ,2050
|
|
16
16
|
parishad/config/user_config.py,sha256=aKgiILWKDc3_OYaZz-u9a4Pm1PP1EULeX-q6KqMbcho,3165
|
|
17
17
|
parishad/data/catalog.py,sha256=hnhyHlAuETzXf1hlP_snXYhjq2nZG9Ab2OGXeMyYlDY,4623
|
|
18
|
-
parishad/data/models.json,sha256=
|
|
18
|
+
parishad/data/models.json,sha256=AfJ1u4Z-HTVTlWGxvxduZUTcgPc4UJ-pv9srUMS5SFc,19388
|
|
19
19
|
parishad/memory/__init__.py,sha256=AJEa0RNcqjep_3mkYniuhK-ZUj1mshCk0rPTrCQrxhY,2687
|
|
20
20
|
parishad/models/__init__.py,sha256=v0CqeJ69qwkUw4nC63VH6QOx4v8Mce1_akb-1VvzTa4,3682
|
|
21
21
|
parishad/models/costs.py,sha256=2ngHV1HsDkuUsTK8QCJGqXlJUWOlVVgoO72K8oJ0ZrA,11393
|
|
@@ -34,7 +34,7 @@ parishad/models/backends/ollama.py,sha256=nyk7rxDXn6Cw03S6Z9Cm3SxaZp09m-1qf6JE1T
|
|
|
34
34
|
parishad/models/backends/openai_api.py,sha256=9CmBvhQEcPX0R1RtQnHWVcTdH9wMT6Pu1acF2vy8C2o,6041
|
|
35
35
|
parishad/models/backends/transformers_hf.py,sha256=z-nw18yY62BorAawrand59GgD_0dmnYqibQGcP6sadQ,6619
|
|
36
36
|
parishad/orchestrator/__init__.py,sha256=a52VEdW_98XwD3FseRu_9_sKagFs6z5PtXS_o4j2fbs,413
|
|
37
|
-
parishad/orchestrator/config_loader.py,sha256=
|
|
37
|
+
parishad/orchestrator/config_loader.py,sha256=Jymo0MCS_K4-bdrYEA6bd5Q8x7dAsEwCH9vBhmSLuC8,6975
|
|
38
38
|
parishad/orchestrator/engine.py,sha256=WAKcHqG20tRqt-Hg62iR-TOswmgc0Y0OclSuSlZe0lA,45644
|
|
39
39
|
parishad/orchestrator/exceptions.py,sha256=jLNkoKvhuKny2upGv04L7Dj4SAi0umVRC0RAukX5BBM,391
|
|
40
40
|
parishad/roles/__init__.py,sha256=OF8Zb-yNP9nX0gS9gnYkt0QoG_KyHYwtw_OiWplFnxc,1171
|
|
@@ -46,7 +46,7 @@ parishad/roles/pantapradhan.py,sha256=Hko47GQdbb561EHhFpWXrIIHw4bCHz8vu8sUtQmlic
|
|
|
46
46
|
parishad/roles/prerak.py,sha256=cpXPqibt1CT_Sz1q5F_m9mZKZVAGixPsIYtg3Vnwmo8,11879
|
|
47
47
|
parishad/roles/raja.py,sha256=iliR3v4YHnwSPPU1_GZUkNiTKgcoZ9EoiWJng_pfdBU,12096
|
|
48
48
|
parishad/roles/sacheev.py,sha256=terhWEEB_Zhti2Wb3LAK2aOYk8sFE72Q9cy7CfTor6I,6594
|
|
49
|
-
parishad/roles/sainik.py,sha256=
|
|
49
|
+
parishad/roles/sainik.py,sha256=DdQ4GNTvVkEE950i7UaKLbzcX9J6IB-iFCxdxHHRIVo,15523
|
|
50
50
|
parishad/roles/sar_senapati.py,sha256=XT7pPTYoJorusay1_v2Sk5-GgZX2auwRmJegLOvJGWA,5413
|
|
51
51
|
parishad/roles/vidushak.py,sha256=f6lmtZrIbAO97RMG2NQYSm14JbqguBA7ukOT-n6i0cM,2018
|
|
52
52
|
parishad/tools/__init__.py,sha256=Ni_RlR4AnOFIBivbM-sfpRdZI0Tpu9MXkbs3n4Ngx8I,279
|
|
@@ -57,12 +57,13 @@ parishad/tools/retrieval.py,sha256=WGoji7n5pKgww3iBNN68UelSCOePxLIf33hQXu3RGlA,2
|
|
|
57
57
|
parishad/tools/shell.py,sha256=RFESJun8TmaB97yaWl9LpsTrr-flR0EoqTs1wast7Xc,3258
|
|
58
58
|
parishad/utils/__init__.py,sha256=vRipAnXqboRXUMY2RvUuYVemwKxUDxgovjyyazvTYbo,218
|
|
59
59
|
parishad/utils/hardware.py,sha256=UngDKW8g-8ztEnCKiYTRX5AZBhoopts_n7nH_hSk3fU,3475
|
|
60
|
+
parishad/utils/installer.py,sha256=fKLimRQBNk-o4ApDmkaHEK31maLQW-sgjwB7ywFKx2w,3483
|
|
60
61
|
parishad/utils/logging.py,sha256=TT16YB6cOhBPyo9a6dZRww3SjStrZKihdtq9hwqBXJo,2144
|
|
61
62
|
parishad/utils/scanner.py,sha256=8wxaNgH3i_T4AdyBuLr9L4KcQ_AORguA6xvnOIyem8k,5841
|
|
62
63
|
parishad/utils/text.py,sha256=S_3Ox4T3C87XfyXdR2b3JMatpCiOozaqPUbVic7OIFM,1617
|
|
63
64
|
parishad/utils/tracing.py,sha256=x35BmMO9M83dVCy73kYqkOFE4zKMrUFe_RuV8qIWJaM,4304
|
|
64
|
-
parishad-0.1.
|
|
65
|
-
parishad-0.1.
|
|
66
|
-
parishad-0.1.
|
|
67
|
-
parishad-0.1.
|
|
68
|
-
parishad-0.1.
|
|
65
|
+
parishad-0.1.6.dist-info/METADATA,sha256=HeHdZ8GtK8ymv7P4J2JjJsdhoWWIeCvfTsxY3sbhLGY,11081
|
|
66
|
+
parishad-0.1.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
67
|
+
parishad-0.1.6.dist-info/entry_points.txt,sha256=cCF4Bg5sLxlLMJhnOnWNua3XYzAGlL5ri-55y0fWPek,51
|
|
68
|
+
parishad-0.1.6.dist-info/licenses/LICENSE,sha256=Xow-fDHX9pzrvBkPHImvQa-Uc1g6BDbz9IE4jPfB6D0,1073
|
|
69
|
+
parishad-0.1.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|