Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf766bf724 | |||
| 8d4ed175ab | |||
| 9571361c2a |
6 changed files with 39 additions and 24 deletions
|
|
@ -151,12 +151,20 @@ HF_HOME=/mnt/daten/huggingface ./start-coding-server.sh
|
||||||
|
|
||||||
### Anderes Modell für die Schleife
|
### Anderes Modell für die Schleife
|
||||||
|
|
||||||
Ohne weitere Angabe arbeiten Coder und Judge mit `llama-cpp-single/coding_model` (Port 8001). Ein anderes Modell aus
|
Ohne weitere Angabe arbeiten Coder und Judge mit `strata/qwen3.8-flash-next-iq3_s` (Strata, Port 9090). Das Modell
|
||||||
`models.json` setzt die Umgebungsvariable `PI_CODER_MODEL` beim Start von pi, als `<provider>/<id>`:
|
liest auch Bilder (`"input": ["text", "image"]` in `models.json`): Screenshots, die pi mit dem `read`-Werkzeug
|
||||||
|
öffnet, erreichen das Modell.
|
||||||
|
|
||||||
|
Web-Apps testet pi über den global eingetragenen MCP-Server `playwright` (headless Chrome, Werkzeuge
|
||||||
|
`browser_*`), auch in der Coder/Judge-Schleife. Einrichtung und Grenzen: `~/nvme2n1p7_home/strata-betrieb`,
|
||||||
|
BEDIENUNGSANLEITUNG, „Web-Anwendungen testen“. Ist das
|
||||||
|
Modell entladen, lädt Strata es bei der ersten Anfrage und gibt vorher GPU 1 und 2 frei; die Bereitschaftsprüfung
|
||||||
|
wartet darauf bis zu 3 Minuten. Eingerichtet ist das in `~/nvme2n1p7_home/strata-betrieb` (dort
|
||||||
|
BEDIENUNGSANLEITUNG, „GPUs teilen“). Ein anderes Modell aus `models.json` setzt die Umgebungsvariable
|
||||||
|
`PI_CODER_MODEL` beim Start von pi, als `<provider>/<id>`, z. B. der llama.cpp-Server auf Port 8001:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
PI_CODER_MODEL=strata/qwen3.8-flash-next-iq3_s \
|
PI_CODER_MODEL=llama-cpp-single/coding_model pi
|
||||||
pi --provider strata --model qwen3.8-flash-next-iq3_s
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`--provider`/`--model` machen das Modell auch für freie Eingaben zum Standard dieses Laufs; die globalen
|
`--provider`/`--model` machen das Modell auch für freie Eingaben zum Standard dieses Laufs; die globalen
|
||||||
|
|
|
||||||
25
README.md
25
README.md
|
|
@ -1,7 +1,7 @@
|
||||||
# pi_coder_2 — Automatisierter Coder/Judge-Workflow für pi agent
|
# pi_coder_2 — Automatisierter Coder/Judge-Workflow für pi agent
|
||||||
|
|
||||||
Dieses Repository enthält die Konfiguration und Skripte für einen automatisierten
|
Dieses Repository enthält die Konfiguration und Skripte für einen automatisierten
|
||||||
Coding-Workflow mit einem lokalen LLaMA-Modell, das abwechselnd als Coder und Judge
|
Coding-Workflow mit einem lokalen Modell (Standard: Strata), das abwechselnd als Coder und Judge
|
||||||
agiert — gesteuert über Pi Agent. Er dreht solange Optimierungsschleifen, bis das
|
agiert — gesteuert über Pi Agent. Er dreht solange Optimierungsschleifen, bis das
|
||||||
Programm Produktionsreife hat.
|
Programm Produktionsreife hat.
|
||||||
|
|
||||||
|
|
@ -13,19 +13,19 @@ Programm Produktionsreife hat.
|
||||||
Nutzer gibt Auftrag
|
Nutzer gibt Auftrag
|
||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
/coder → coding_model (:8001, Coder-Persona) → Implementierung + git commit
|
/coder → Strata (:9090, Coder-Persona) → Implementierung + git commit
|
||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
/judge → coding_model (:8001, Judge-Persona) → Review: PASS / FAIL + Blocker
|
/judge → Strata (:9090, Judge-Persona) → Review: PASS / FAIL + Blocker
|
||||||
│
|
│
|
||||||
FAIL? ▼
|
FAIL? ▼
|
||||||
/fix → coding_model (:8001, Coder-Persona) → Fixes + git commit
|
/fix → Strata (:9090, Coder-Persona) → Fixes + git commit
|
||||||
│
|
│
|
||||||
PASS WITH CONCERNS? ▼
|
PASS WITH CONCERNS? ▼
|
||||||
│ (ohne --approve-concerns: wie FAIL → weiterer Fix-Zyklus)
|
│ (ohne --approve-concerns: wie FAIL → weiterer Fix-Zyklus)
|
||||||
│
|
│
|
||||||
PASS? ▼
|
PASS? ▼
|
||||||
/shipit → coding_model (:8001, Judge-Persona) → Finale Freigabe: SHIP / NO-SHIP
|
/shipit → Strata (:9090, Judge-Persona) → Finale Freigabe: SHIP / NO-SHIP
|
||||||
(nur bei "PASS WITH CONCERNS" --approve-concerns; klares PASS → direkt SHIP)
|
(nur bei "PASS WITH CONCERNS" --approve-concerns; klares PASS → direkt SHIP)
|
||||||
|
|
||||||
/optimize = Coder→Judge→Fix-Schleife automatisch (bis PASS oder max. N Runden)
|
/optimize = Coder→Judge→Fix-Schleife automatisch (bis PASS oder max. N Runden)
|
||||||
|
|
@ -41,15 +41,18 @@ nur die Persona im System-Prompt ändert sich.
|
||||||
|
|
||||||
## Modelle
|
## Modelle
|
||||||
|
|
||||||
| Rolle | Modell | Port | Container | Alias | GPU |
|
| Rolle | Modell (`<provider>/<id>`) | Port | Betrieb | GPU |
|
||||||
|----------------|---------------------------------------------------|------|--------------------|----------------|----------|
|
|---|---|---|---|---|
|
||||||
| Coder + Judge | Qwen3.6-27B-Uncensored-HauhauCS-Aggressive-IQ4_XS | 8001 | coding_model | coding_model | device=1 |
|
| Coder + Judge (Standard) | `strata/qwen3.8-flash-next-iq3_s` | 9090 | Strata-Server, `~/nvme2n1p7_home/strata-betrieb` | 1 und 2 |
|
||||||
|
| Coder + Judge (Alternative) | `llama-cpp-single/coding_model` (Qwen3.6-27B IQ4_XS) | 8001 | Container `coding_model`, `start-coding-server.sh` | 1 |
|
||||||
|
|
||||||
Coder- und Judge-Rollen werden durch verschiedene System-Prompts realisiert —
|
Coder- und Judge-Rollen werden durch verschiedene System-Prompts realisiert —
|
||||||
dasselbe Modell, derselbe Container, unterschiedliche Persona.
|
dasselbe Modell, unterschiedliche Persona. Freie Eingaben in pi nutzen weiter pis eigenes Standardmodell.
|
||||||
|
|
||||||
Ein anderes Modell für beide Rollen (z. B. den lokalen Strata-Server) setzt `PI_CODER_MODEL=<provider>/<id>`,
|
Strata lädt sein Modell bei der ersten Anfrage selbst, gibt vorher die GPUs frei und entlädt es nach 10 Minuten ohne
|
||||||
siehe [BEDIENUNGSANLEITUNG.md](BEDIENUNGSANLEITUNG.md#anderes-modell-für-die-schleife).
|
Anfrage (eingerichtet in `strata-betrieb`). Ein anderes Modell für beide Rollen setzt
|
||||||
|
`PI_CODER_MODEL=<provider>/<id>`, siehe
|
||||||
|
[BEDIENUNGSANLEITUNG.md](BEDIENUNGSANLEITUNG.md#anderes-modell-für-die-schleife).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
"id": "qwen3.8-flash-next-iq3_s",
|
"id": "qwen3.8-flash-next-iq3_s",
|
||||||
"name": "Strata Qwen3.8-Flash-Next IQ3_S (lokal :9090)",
|
"name": "Strata Qwen3.8-Flash-Next IQ3_S (lokal :9090)",
|
||||||
"reasoning": true,
|
"reasoning": true,
|
||||||
"input": ["text"],
|
"input": ["text", "image"],
|
||||||
"contextWindow": 262144,
|
"contextWindow": 262144,
|
||||||
"maxTokens": 16384,
|
"maxTokens": 16384,
|
||||||
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
|
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// pi-coding-extension.ts
|
// pi-coding-extension.ts
|
||||||
// Automatisierter Coder-Judge-Fix-Workflow für AI-Coding-Assistenten
|
// Automatisierter Coder-Judge-Fix-Workflow für AI-Coding-Assistenten
|
||||||
// Ein Modell (Standard: coding_model auf Single-Server :8001, sonst PI_CODER_MODEL); Rollen Coder/Judge via System-Prompt
|
// Ein Modell (Standard: Strata auf :9090, sonst PI_CODER_MODEL); Rollen Coder/Judge via System-Prompt
|
||||||
|
|
||||||
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
||||||
import { Type } from "typebox";
|
import { Type } from "typebox";
|
||||||
|
|
@ -440,14 +440,15 @@ async function tickTaskMdStatus(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Single-Modell: genau ein Modell (Standard coding_model auf :8001, oder PI_CODER_MODEL) für beide Rollen.
|
// Single-Modell: genau ein Modell (Standard Strata auf :9090, oder PI_CODER_MODEL) für beide Rollen.
|
||||||
// Der Rollenwechsel Coder/Judge erfolgt NICHT mehr über den Modellwechsel, sondern
|
// Der Rollenwechsel Coder/Judge erfolgt NICHT mehr über den Modellwechsel, sondern
|
||||||
// über den System-Prompt (siehe before_agent_start-Hook + currentRole). Diese Funktion
|
// über den System-Prompt (siehe before_agent_start-Hook + currentRole). Diese Funktion
|
||||||
// stellt nur sicher, dass das eine Single-Modell aktiv ist; nach dem ersten Aufruf
|
// stellt nur sicher, dass das eine Single-Modell aktiv ist; nach dem ersten Aufruf
|
||||||
// ist der Wechsel via currentModelKey gecacht und damit ein No-op.
|
// ist der Wechsel via currentModelKey gecacht und damit ein No-op.
|
||||||
// PI_CODER_MODEL="<provider>/<id>" setzt ein anderes Modell für beide Rollen (z. B. strata/qwen3.8-flash-next-iq3_s);
|
// PI_CODER_MODEL="<provider>/<id>" setzt ein anderes Modell für beide Rollen (z. B. llama-cpp-single/coding_model
|
||||||
// ohne die Variable bleibt es beim Single-Server auf :8001.
|
// für den llama.cpp-Server auf :8001). Strata lädt sein Modell bei der ersten Anfrage selbst und gibt vorher die GPUs
|
||||||
const DEFAULT_SINGLE_MODEL = "llama-cpp-single/coding_model";
|
// frei (before_load in ~/nvme2n1p7_home/strata-betrieb); die Bereitschaftsprüfung wartet darauf bis zu 3 min.
|
||||||
|
const DEFAULT_SINGLE_MODEL = "strata/qwen3.8-flash-next-iq3_s";
|
||||||
const SINGLE_MODEL_SPEC = (process.env.PI_CODER_MODEL || DEFAULT_SINGLE_MODEL).trim();
|
const SINGLE_MODEL_SPEC = (process.env.PI_CODER_MODEL || DEFAULT_SINGLE_MODEL).trim();
|
||||||
const SINGLE_PROVIDER = SINGLE_MODEL_SPEC.slice(0, SINGLE_MODEL_SPEC.indexOf("/"));
|
const SINGLE_PROVIDER = SINGLE_MODEL_SPEC.slice(0, SINGLE_MODEL_SPEC.indexOf("/"));
|
||||||
const SINGLE_MODEL_ID = SINGLE_MODEL_SPEC.slice(SINGLE_MODEL_SPEC.indexOf("/") + 1);
|
const SINGLE_MODEL_ID = SINGLE_MODEL_SPEC.slice(SINGLE_MODEL_SPEC.indexOf("/") + 1);
|
||||||
|
|
@ -461,7 +462,8 @@ function singleEndpoint(ctx: ExtensionCommandContext): string {
|
||||||
|
|
||||||
function notReadyMessage(ctx: ExtensionCommandContext): string {
|
function notReadyMessage(ctx: ExtensionCommandContext): string {
|
||||||
const where = singleEndpoint(ctx) || SINGLE_LABEL;
|
const where = singleEndpoint(ctx) || SINGLE_LABEL;
|
||||||
const hint = SINGLE_MODEL_SPEC === DEFAULT_SINGLE_MODEL ? "start-coding-server.sh ausführen" : "Server starten";
|
const hint = SINGLE_PROVIDER === "strata" ? "Strata starten: ~/nvme2n1p7_home/strata-betrieb/scripts/strata.sh start"
|
||||||
|
: SINGLE_PROVIDER === "llama-cpp-single" ? "start-coding-server.sh ausführen" : "Server starten";
|
||||||
return `Server nicht bereit (${where}) — ${hint}`;
|
return `Server nicht bereit (${where}) — ${hint}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ test("models.json: Provider strata zeigt auf den lokalen Strata-Server (:9090)",
|
||||||
assert.ok(p, "Provider strata fehlt");
|
assert.ok(p, "Provider strata fehlt");
|
||||||
assert.match(p.baseUrl, /^http:\/\/127\.0\.0\.1:9090\/v1$/);
|
assert.match(p.baseUrl, /^http:\/\/127\.0\.0\.1:9090\/v1$/);
|
||||||
assert.deepEqual(p.models.map((m) => m.id), ["qwen3.8-flash-next-iq3_s"]);
|
assert.deepEqual(p.models.map((m) => m.id), ["qwen3.8-flash-next-iq3_s"]);
|
||||||
|
// Strata reads pictures with its vision encoder (setup --vision cpu); pi drops images for text-only models.
|
||||||
|
assert.deepEqual(p.models[0].input, ["text", "image"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("models.json: tote Dual-/Alt-Provider sind entfernt", () => {
|
test("models.json: tote Dual-/Alt-Provider sind entfernt", () => {
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ test("LICENCE.md: deterministisch in der Doku-Phase, nur wenn nicht vorhanden, p
|
||||||
assert.match(extSource, /new Date\(\)\.getFullYear\(\)/);
|
assert.match(extSource, /new Date\(\)\.getFullYear\(\)/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Single-Modell: Standard bleibt llama-cpp-single/coding_model, PI_CODER_MODEL überschreibt", () => {
|
test("Single-Modell: Standard ist Strata, PI_CODER_MODEL überschreibt", () => {
|
||||||
assert.match(extSource, /DEFAULT_SINGLE_MODEL = "llama-cpp-single\/coding_model"/);
|
assert.match(extSource, /DEFAULT_SINGLE_MODEL = "strata\/qwen3.8-flash-next-iq3_s"/);
|
||||||
assert.match(extSource, /process\.env\.PI_CODER_MODEL \|\| DEFAULT_SINGLE_MODEL/);
|
assert.match(extSource, /process\.env\.PI_CODER_MODEL \|\| DEFAULT_SINGLE_MODEL/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue