Skip to content

Commit 57acf13

Browse files
gHashTagclaude
andcommitted
feat: Trinity Hybrid Local Coder v1.0.2
- Add trinity-hybrid binary (388KB) - IGLA Symbolic: 100+ patterns, 2-45μs instant - Ollama LLM: qwen2.5-coder:7b fluent fallback - 100% local, no cloud, full privacy New files: - src/vibeec/trinity_hybrid_local.zig - zig build hybrid (new target) - docs/INSTALL_HYBRID.md - docs/hybrid_local_release_report.md - docs/v1_announce_report.md Benchmarks: - "hello" → 34μs (symbolic) - "write fibonacci in zig" → 18.8s (LLM, real Zig code) φ² + 1/φ² = 3 = TRINITY | KOSCHEI IS IMMORTAL 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 98207c0 commit 57acf13

7 files changed

Lines changed: 1360 additions & 0 deletions

build.zig

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,97 @@ pub fn build(b: *std.Build) void {
249249
const run_claude_ui = b.addRunArtifact(claude_ui);
250250
const claude_ui_step = b.step("claude-ui", "Run Claude UI Demo");
251251
claude_ui_step.dependOn(&run_claude_ui.step);
252+
253+
// Trinity CLI - Interactive AI Agent
254+
const trinity_cli = b.addExecutable(.{
255+
.name = "trinity-cli",
256+
.root_module = b.createModule(.{
257+
.root_source_file = b.path("src/vibeec/trinity_cli.zig"),
258+
.target = target,
259+
.optimize = optimize,
260+
}),
261+
});
262+
b.installArtifact(trinity_cli);
263+
264+
const run_trinity_cli = b.addRunArtifact(trinity_cli);
265+
if (b.args) |args| {
266+
run_trinity_cli.addArgs(args);
267+
}
268+
const trinity_cli_step = b.step("cli", "Run Trinity CLI (Interactive AI Agent)");
269+
trinity_cli_step.dependOn(&run_trinity_cli.step);
270+
271+
// VIBEE Compiler CLI
272+
const vibee = b.addExecutable(.{
273+
.name = "vibee",
274+
.root_module = b.createModule(.{
275+
.root_source_file = b.path("src/vibeec/gen_cmd.zig"),
276+
.target = target,
277+
.optimize = optimize,
278+
}),
279+
});
280+
b.installArtifact(vibee);
281+
282+
const run_vibee = b.addRunArtifact(vibee);
283+
if (b.args) |args| {
284+
run_vibee.addArgs(args);
285+
}
286+
const vibee_step = b.step("vibee", "Run VIBEE Compiler CLI");
287+
vibee_step.dependOn(&run_vibee.step);
288+
289+
// Vibeec modules for TRI
290+
const vibeec_swe = b.createModule(.{
291+
.root_source_file = b.path("src/vibeec/trinity_swe_agent.zig"),
292+
.target = target,
293+
.optimize = optimize,
294+
});
295+
const vibeec_chat = b.createModule(.{
296+
.root_source_file = b.path("src/vibeec/igla_local_chat.zig"),
297+
.target = target,
298+
.optimize = optimize,
299+
});
300+
const vibeec_coder = b.createModule(.{
301+
.root_source_file = b.path("src/vibeec/igla_local_coder.zig"),
302+
.target = target,
303+
.optimize = optimize,
304+
});
305+
// TRI - Unified Trinity CLI
306+
const tri = b.addExecutable(.{
307+
.name = "tri",
308+
.root_module = b.createModule(.{
309+
.root_source_file = b.path("src/tri/main.zig"),
310+
.target = target,
311+
.optimize = optimize,
312+
.imports = &.{
313+
.{ .name = "trinity_swe", .module = vibeec_swe },
314+
.{ .name = "igla_chat", .module = vibeec_chat },
315+
.{ .name = "igla_coder", .module = vibeec_coder },
316+
},
317+
}),
318+
});
319+
b.installArtifact(tri);
320+
321+
const run_tri = b.addRunArtifact(tri);
322+
if (b.args) |args| {
323+
run_tri.addArgs(args);
324+
}
325+
const tri_step = b.step("tri", "Run TRI - Unified Trinity CLI");
326+
tri_step.dependOn(&run_tri.step);
327+
328+
// Trinity Hybrid Local Coder (IGLA + Ollama)
329+
const hybrid_local = b.addExecutable(.{
330+
.name = "trinity-hybrid",
331+
.root_module = b.createModule(.{
332+
.root_source_file = b.path("src/vibeec/trinity_hybrid_local.zig"),
333+
.target = target,
334+
.optimize = .ReleaseFast,
335+
}),
336+
});
337+
b.installArtifact(hybrid_local);
338+
339+
const run_hybrid = b.addRunArtifact(hybrid_local);
340+
if (b.args) |args| {
341+
run_hybrid.addArgs(args);
342+
}
343+
const hybrid_step = b.step("hybrid", "Run Trinity Hybrid Local Coder (IGLA + Ollama)");
344+
hybrid_step.dependOn(&run_hybrid.step);
252345
}

docs/INSTALL_HYBRID.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Trinity Hybrid Local Coder — Install Guide
2+
3+
**Version:** 1.0.2
4+
**Date:** 2026-02-07
5+
6+
---
7+
8+
## Quick Start
9+
10+
```bash
11+
# 1. Install Ollama
12+
brew install ollama # macOS
13+
# or: curl -fsSL https://ollama.com/install.sh | sh # Linux
14+
15+
# 2. Start Ollama
16+
ollama serve &
17+
18+
# 3. Pull the model (4.7GB, one-time)
19+
ollama pull qwen2.5-coder:7b
20+
21+
# 4. Run Trinity Hybrid
22+
./trinity-hybrid # Interactive mode
23+
./trinity-hybrid "hello" # One-shot (instant)
24+
./trinity-hybrid "write fibonacci in zig" # LLM (fluent code)
25+
```
26+
27+
---
28+
29+
## Requirements
30+
31+
| Component | Version | Size |
32+
|-----------|---------|------|
33+
| Zig | 0.15.x ||
34+
| Ollama | 0.1.x+ ||
35+
| qwen2.5-coder:7b | latest | 4.7GB |
36+
| trinity-hybrid | 1.0.2 | **388KB** |
37+
38+
---
39+
40+
## Build from Source
41+
42+
```bash
43+
git clone https://github.com/gHashTag/trinity.git
44+
cd trinity
45+
zig build
46+
47+
# Binary at: zig-out/bin/trinity-hybrid
48+
./zig-out/bin/trinity-hybrid --help
49+
```
50+
51+
---
52+
53+
## Usage
54+
55+
### Interactive Mode
56+
57+
```bash
58+
$ ./trinity-hybrid
59+
60+
╔═══════════════════════════════════════════════════════════════════╗
61+
║ TRINITY HYBRID LOCAL CODER v1.0.2 ║
62+
║ IGLA Symbolic (instant) + Ollama LLM (fluent) ║
63+
║ 100% Local | No Cloud | M1 Pro Optimized ║
64+
╚═══════════════════════════════════════════════════════════════════╝
65+
66+
[You] > hello
67+
[Trinity] (Symbolic, 40%, 34μs)
68+
Hello! Great to see you. How can I help?
69+
70+
[You] > write factorial in zig
71+
[Trinity] Calling Ollama...
72+
[Trinity] (LLM, 4673ms)
73+
fn factorial(n: u64) u64 {
74+
if (n == 0 or n == 1) return 1;
75+
return n * factorial(n - 1);
76+
}
77+
78+
[You] > /quit
79+
```
80+
81+
### One-Shot Mode
82+
83+
```bash
84+
# Symbolic (instant, 2-45μs)
85+
./trinity-hybrid "привет"
86+
./trinity-hybrid "tell me a joke"
87+
./trinity-hybrid "who are you?"
88+
89+
# LLM (fluent, 4-30s)
90+
./trinity-hybrid "write quicksort in zig"
91+
./trinity-hybrid "explain recursion"
92+
./trinity-hybrid "what is golden ratio"
93+
```
94+
95+
### Commands
96+
97+
| Command | Description |
98+
|---------|-------------|
99+
| `/help` | Show commands |
100+
| `/quit` | Exit |
101+
| `/stats` | Show statistics |
102+
103+
---
104+
105+
## Architecture
106+
107+
```
108+
Query → IGLA Symbolic (100+ patterns, 2-45μs)
109+
110+
├─ Match found → Instant response
111+
112+
└─ No match → Ollama qwen2.5-coder (4-30s, fluent)
113+
```
114+
115+
---
116+
117+
## Troubleshooting
118+
119+
### "Error: CurlFailed"
120+
121+
```bash
122+
# Check Ollama is running
123+
curl http://localhost:11434/api/version
124+
125+
# Start Ollama
126+
ollama serve &
127+
```
128+
129+
### "Model not found"
130+
131+
```bash
132+
ollama pull qwen2.5-coder:7b
133+
```
134+
135+
---
136+
137+
## Metrics
138+
139+
| Mode | Latency | Quality |
140+
|------|---------|---------|
141+
| Symbolic | 2-45μs | Deterministic, no hallucination |
142+
| LLM | 4-30s | Fluent code, natural language |
143+
144+
---
145+
146+
**φ² + 1/φ² = 3 = TRINITY | KOSCHEI IS IMMORTAL**

0 commit comments

Comments
 (0)