chitta-bridge 0.7.0__tar.gz

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.
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "chitta-bridge",
3
+ "version": "0.4.3",
4
+ "description": "Multi-agent discussion sessions with OpenCode, Codex, and local GPU models",
5
+ "author": "Antonio Fernandez-Guerra",
6
+ "repository": "https://github.com/genomewalker/chitta-bridge",
7
+ "license": "MIT",
8
+ "keywords": ["chitta", "opencode", "codex", "local-llm", "discussion", "mcp"],
9
+ "mcpServers": {
10
+ "chitta-bridge": {
11
+ "command": "chitta-bridge",
12
+ "description": "Multi-agent discussion sessions — OpenCode, Codex, local GPU models"
13
+ }
14
+ },
15
+ "skills": [
16
+ {
17
+ "name": "opencode",
18
+ "file": "skills/opencode.md",
19
+ "description": "Start continuous discussion with OpenCode"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,50 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v4
26
+
27
+ - name: Install dependencies
28
+ run: uv pip install --system -e ".[dev]"
29
+
30
+ - name: Check import
31
+ run: python -c "from chitta_bridge.server import OpenCodeBridge; print('OK')"
32
+
33
+ lint:
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+
38
+ - name: Set up Python
39
+ uses: actions/setup-python@v5
40
+ with:
41
+ python-version: "3.12"
42
+
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v4
45
+
46
+ - name: Install dependencies
47
+ run: uv pip install --system ruff
48
+
49
+ - name: Lint
50
+ run: ruff check chitta_bridge/
@@ -0,0 +1,34 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Set up Python
15
+ uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v4
21
+
22
+ - name: Install build tools
23
+ run: uv pip install --system build
24
+
25
+ - name: Build package
26
+ run: python -m build
27
+
28
+ - name: Publish to PyPI
29
+ env:
30
+ TWINE_USERNAME: __token__
31
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
32
+ run: |
33
+ uv pip install --system twine
34
+ twine upload dist/*
@@ -0,0 +1,28 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ .Python
6
+ build/
7
+ develop-eggs/
8
+ dist/
9
+ downloads/
10
+ eggs/
11
+ .eggs/
12
+ lib/
13
+ lib64/
14
+ parts/
15
+ sdist/
16
+ var/
17
+ wheels/
18
+ *.egg-info/
19
+ .installed.cfg
20
+ *.egg
21
+ .venv/
22
+ venv/
23
+ ENV/
24
+ .idea/
25
+ .vscode/
26
+ *.swp
27
+ *.swo
28
+ .DS_Store
@@ -0,0 +1,337 @@
1
+ Metadata-Version: 2.4
2
+ Name: chitta-bridge
3
+ Version: 0.7.0
4
+ Summary: MCP server for multi-model AI discussions — cloud, agentic CLIs, local GPU models, soul memory
5
+ Project-URL: Repository, https://github.com/genomewalker/chitta-bridge
6
+ Author: Antonio Fernandez-Guerra
7
+ License-Expression: MIT
8
+ Keywords: agents,chitta,claude,code-review,codex,discussion,gpt,mcp
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: mcp>=1.0.0
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
21
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # Chitta Bridge
25
+
26
+ MCP server for multi-model AI discussions — connect Claude Code to any AI backend: cloud providers, agentic CLIs, and local GPU models.
27
+
28
+ ## Quick Start
29
+
30
+ ```bash
31
+ # 1. Install
32
+ uv pip install git+https://github.com/genomewalker/chitta-bridge.git
33
+
34
+ # 2. Register with Claude Code
35
+ chitta-bridge-install
36
+
37
+ # 3. Use in Claude Code
38
+ # The tools are now available - Claude will use them automatically
39
+ ```
40
+
41
+ ## Features
42
+
43
+ - **Multiple backends**: OpenCode, Codex CLI, and local GPU models (Ollama/vLLM)
44
+ - **Continuous sessions**: Conversation history persists across messages
45
+ - **Session warmup**: background ping captures session ID — subsequent calls skip cold start
46
+ - **Multiple models**: OpenCode (GPT-5.x, Claude, Gemini) + Codex (o3, o4-mini, gpt-4.1)
47
+ - **Agent support**: plan, build, explore, general agents (OpenCode)
48
+ - **Agentic execution**: Full-auto mode with sandboxed file operations (Codex)
49
+ - **Variant control**: Set reasoning effort (minimal to max)
50
+ - **File/image attachment**: Share code files and images for context
51
+ - **Session continuity**: Conversations continue across tool calls
52
+ - **Discussion rooms**: async multi-agent roundtables — any mix of backends respond in parallel, see the full thread, synthesize into one answer
53
+
54
+ ## Installation
55
+
56
+ ### With uv (recommended)
57
+
58
+ ```bash
59
+ uv pip install git+https://github.com/genomewalker/chitta-bridge.git
60
+ ```
61
+
62
+ ### With pip
63
+
64
+ ```bash
65
+ pip install git+https://github.com/genomewalker/chitta-bridge.git
66
+ ```
67
+
68
+ ### From source
69
+
70
+ ```bash
71
+ git clone https://github.com/genomewalker/chitta-bridge.git
72
+ cd chitta-bridge
73
+ pip install -e .
74
+ ```
75
+
76
+ ## Register with Claude Code
77
+
78
+ ```bash
79
+ # Install (registers MCP server)
80
+ chitta-bridge-install
81
+
82
+ # Verify
83
+ claude mcp list
84
+
85
+ # Uninstall
86
+ chitta-bridge-uninstall
87
+ ```
88
+
89
+ ## OpenCode Backend
90
+
91
+ | Tool | Description |
92
+ |------|-------------|
93
+ | `opencode_start` | Start a new session (auto-warms up, captures session ID) |
94
+ | `opencode_discuss` | Send a message |
95
+ | `opencode_plan` | Start planning discussion |
96
+ | `opencode_brainstorm` | Open-ended brainstorming |
97
+ | `opencode_review` | Review code |
98
+ | `opencode_ping` | Check if model is reachable |
99
+ | `opencode_models` | List available models |
100
+ | `opencode_agents` | List available agents |
101
+ | `opencode_model` | Change session model |
102
+ | `opencode_agent` | Change session agent |
103
+ | `opencode_variant` | Change reasoning effort |
104
+ | `opencode_config` | Show current configuration |
105
+ | `opencode_configure` | Set defaults (persisted) |
106
+ | `opencode_history` | Show conversation history |
107
+ | `opencode_sessions` | List all sessions |
108
+ | `opencode_switch` | Switch to another session |
109
+ | `opencode_end` | End current session |
110
+ | `opencode_health` | Server health check |
111
+
112
+ ## Discussion Rooms
113
+
114
+ Async multi-agent roundtable — any mix of backends (OpenCode, Codex, local GPU models, Claude) post in parallel each round, each seeing the full thread before responding.
115
+
116
+ ```python
117
+ # Create a room with 3 participants (including a local GPU model)
118
+ room_create(
119
+ room_id="my-room",
120
+ topic="What's the best way to design a cache invalidation strategy?",
121
+ participants='[
122
+ {"name":"Codex-GPT54","backend":"codex","session_id":"existing-codex-session"},
123
+ {"name":"Gemini","backend":"opencode","session_id":"existing-gemini-session"},
124
+ {"name":"Llama","backend":"local","model":"llama3.3:70b","base_url":"http://gpunode01:11434/v1"}
125
+ ]'
126
+ )
127
+
128
+ # Run 2 rounds (all participants respond in parallel each round)
129
+ room_run(room_id="my-room", rounds=2)
130
+
131
+ # Add a participant mid-discussion
132
+ room_add_participant(room_id="my-room", participant='{"name":"Claude","backend":"claude"}')
133
+
134
+ # Read the full transcript
135
+ room_read(room_id="my-room")
136
+ ```
137
+
138
+ | Tool | Description |
139
+ |------|-------------|
140
+ | `room_create` | Create a discussion room with named participants |
141
+ | `room_add_participant` | Add a participant to an existing room |
142
+ | `room_run` | Run N rounds — all participants respond in parallel |
143
+ | `room_read` | Read the full transcript |
144
+ | `room_synthesize` | Distill the transcript — consensus, disagreements, best answer, open questions |
145
+
146
+ ### Synthesis
147
+
148
+ After running a room, distill the full discussion into a single answer. Any backend can act as synthesizer — Claude (default), local GPU model, OpenCode, or Codex.
149
+
150
+ ```python
151
+ room_synthesize(room_id="my-room")
152
+
153
+ # Use a local model as synthesizer
154
+ room_synthesize(
155
+ room_id="my-room",
156
+ synthesizer='{"name":"Qwen3","backend":"local","model":"qwen3:30b-a3b","base_url":"http://gpunode01:11434/v1"}'
157
+ )
158
+ ```
159
+
160
+ ## Local Models (GPU Nodes)
161
+
162
+ Chat with local LLMs (Ollama / vLLM) running on GPU nodes — via Slurm auto-discovery or direct hostname.
163
+
164
+ ```bash
165
+ # 1. Start Ollama on a Slurm GPU node (writes URL to /tmp/ollama-server-<model>.url)
166
+ slurm-serve-ollama.sh llama3.3:70b
167
+
168
+ # 2. Discover available nodes and models
169
+ local_discover()
170
+
171
+ # 3. Start a session (auto-discovers endpoint if omitted)
172
+ local_start(session_id="llm1", model="llama3.3:70b")
173
+
174
+ # 4. Chat
175
+ local_discuss(message="Explain cache invalidation strategies")
176
+
177
+ # Or specify node explicitly
178
+ local_start(session_id="llm2", model="qwen3:30b-a3b", endpoint="http://gpunode01:11434/v1")
179
+ ```
180
+
181
+ ### Discovery order
182
+
183
+ 1. `/tmp/ollama-server-*.url` cache files (written by `slurm-serve-ollama.sh`)
184
+ 2. Your running Slurm GPU jobs (`squeue --me`)
185
+ 3. `CHITTA_BRIDGE_GPU_NODES=node1,node2` environment variable
186
+ 4. `localhost:11434` fallback
187
+
188
+ | Tool | Description |
189
+ |------|-------------|
190
+ | `local_discover` | Find GPU nodes with Ollama/vLLM running |
191
+ | `local_start` | Start a session (auto-discovers endpoint) |
192
+ | `local_discuss` | Chat with the local model |
193
+ | `local_models` | List models available at an endpoint |
194
+ | `local_sessions` | List active local sessions |
195
+ | `local_switch` | Switch active session |
196
+ | `local_end` | End a session |
197
+ | `local_history` | Show conversation history |
198
+ | `local_health` | Health check |
199
+
200
+ ## Web Search
201
+
202
+ Search the web and fetch pages directly from Claude Code — no API key needed (DuckDuckGo).
203
+
204
+ ```python
205
+ # Search
206
+ web_search(query="ancient metagenomics DNA damage authentication")
207
+
208
+ # Fetch a page
209
+ web_fetch(url="https://example.com/article", max_chars=12000)
210
+ ```
211
+
212
+ | Tool | Description |
213
+ |------|-------------|
214
+ | `web_search` | Search via DuckDuckGo — returns titles, URLs, snippets |
215
+ | `web_fetch` | Fetch a web page as plain text (HTML stripped) |
216
+
217
+ ## Soul Memory (chittad)
218
+
219
+ Bidirectional memory bridge to the cc-soul daemon. Room discussions automatically pull relevant memories as context, and syntheses are stored back as episodes.
220
+
221
+ ```python
222
+ # Check if soul is running
223
+ soul_status()
224
+
225
+ # Recall memories
226
+ soul_recall(query="cache invalidation strategies", limit=5)
227
+
228
+ # Store a memory
229
+ soul_remember(content="Room discussion concluded X is better than Y", kind="episode")
230
+
231
+ # Smart context (memories + code symbols + graph)
232
+ soul_context(task="refactor authentication middleware")
233
+ ```
234
+
235
+ | Tool | Description |
236
+ |------|-------------|
237
+ | `soul_recall` | Search memories by query |
238
+ | `soul_remember` | Store a new memory |
239
+ | `soul_context` | Smart context assembly (memories + symbols + graph) |
240
+ | `soul_status` | Check if chittad is available |
241
+
242
+ Discussion rooms automatically:
243
+ - **Inject soul context** at creation — participants see relevant memories
244
+ - **Store synthesis back** — room conclusions become soul episodes
245
+
246
+ ## Codex Backend
247
+
248
+ | Tool | Description |
249
+ |------|-------------|
250
+ | `codex_start` | Start a new Codex session |
251
+ | `codex_discuss` | Send a message to Codex |
252
+ | `codex_run` | Run a one-off task (stateless) |
253
+ | `codex_review` | Run code review on repository |
254
+ | `codex_model` | Change session model |
255
+ | `codex_config` | Show Codex configuration |
256
+ | `codex_configure` | Set Codex defaults (persisted) |
257
+ | `codex_history` | Show conversation history |
258
+ | `codex_sessions` | List all Codex sessions |
259
+ | `codex_switch` | Switch to another session |
260
+ | `codex_end` | End current session |
261
+ | `codex_health` | Codex health check |
262
+
263
+ ## Available Models
264
+
265
+ ### OpenCode
266
+
267
+ | Provider | Models |
268
+ |----------|--------|
269
+ | openai | gpt-5.2-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini |
270
+ | github-copilot | claude-opus-4.5, claude-sonnet-4.5, gpt-5, gemini-2.5-pro |
271
+ | opencode | gpt-5-nano (free), glm-4.7-free, grok-code |
272
+
273
+ Run `opencode models` to see all available models.
274
+
275
+ ### Codex
276
+
277
+ | Model | Description |
278
+ |-------|-------------|
279
+ | o3 | Default, high capability |
280
+ | o4-mini | Faster, lower cost |
281
+ | gpt-4.1 | Alternative option |
282
+
283
+ ## Configuration
284
+
285
+ ### Environment variables
286
+
287
+ ```bash
288
+ # OpenCode
289
+ export OPENCODE_MODEL="openai/gpt-5.2-codex"
290
+ export OPENCODE_AGENT="plan"
291
+ export OPENCODE_VARIANT="medium"
292
+
293
+ # Codex
294
+ export CODEX_MODEL="o3"
295
+ export CODEX_SANDBOX="workspace-write"
296
+ ```
297
+
298
+ ### Config file
299
+
300
+ `~/.chitta-bridge/config.json`:
301
+ ```json
302
+ {
303
+ "model": "openai/gpt-5.2-codex",
304
+ "agent": "plan",
305
+ "variant": "medium",
306
+ "codex_model": "o3",
307
+ "codex_sandbox": "workspace-write"
308
+ }
309
+ ```
310
+
311
+ ### OpenCode Variants (reasoning effort)
312
+
313
+ `minimal` -> `low` -> `medium` -> `high` -> `xhigh` -> `max`
314
+
315
+ Higher variants use more reasoning tokens for complex tasks.
316
+
317
+ ### Codex Sandbox Modes
318
+
319
+ | Mode | Description |
320
+ |------|-------------|
321
+ | `read-only` | Can only read files |
322
+ | `workspace-write` | Can write to workspace (default) |
323
+ | `danger-full-access` | Full filesystem access (use with caution) |
324
+
325
+ The `full_auto` option (default: true) enables low-friction execution with `workspace-write` sandbox.
326
+
327
+ ## Requirements
328
+
329
+ - Python 3.10+
330
+ - [OpenCode CLI](https://opencode.ai) for `opencode_*` tools
331
+ - [Codex CLI](https://github.com/openai/codex) for `codex_*` tools
332
+ - Ollama or vLLM on a GPU node for `local_*` tools
333
+ - Claude Code
334
+
335
+ ## License
336
+
337
+ MIT