CodeBench: spec-simple.md pienille malleille

- Yksinkertaistettu JSON-skeema: ei sa_type/py_type, vain type-kenttä
- Small-profiili käyttää automaattisesti spec-simple promptia
- Vähemmän kenttiä per entity → pienempi output → 8b selviytyy
This commit is contained in:
2026-04-14 22:06:29 +03:00
parent 7bcba3daf8
commit 61966783e3
2 changed files with 23 additions and 3 deletions

View File

@@ -48,6 +48,7 @@ function loadPrompt(name) {
}
const CLIENT_SYSTEM = loadPrompt('client');
const SPEC_SYSTEM = loadPrompt('spec');
const SPEC_SIMPLE_SYSTEM = existsSync(join(__dirname, 'prompts', 'spec-simple.md')) ? loadPrompt('spec-simple') : SPEC_SYSTEM;
const FIX_SYSTEM = loadPrompt('fix');
// === Mallikohtaiset profiilit ===
@@ -337,9 +338,11 @@ async function runPipeline(model, scenario, round = 1) {
result.reqOk = true;
writeFileSync(`${dir}/_requirements.txt`, req.text);
// 2. JSON-speksi
console.log(` [2/5] JSON-speksi...`);
const specResp = await ollamaChat(specModel, `${req.text}\n\nOutput a JSON spec for this project.`, SPEC_SYSTEM, 4096);
// 2. JSON-speksi (small-malleille yksinkertaistettu skeema)
const specProfile = PROFILES.models[specModel]?.profile || PROFILES.default_profile;
const specPrompt = specProfile === 'small' ? SPEC_SIMPLE_SYSTEM : SPEC_SYSTEM;
console.log(` [2/5] JSON-speksi${specProfile === 'small' ? ' (simple)' : ''}...`);
const specResp = await ollamaChat(specModel, `${req.text}\n\nOutput a JSON spec for this project.`, specPrompt, 4096);
timings.push(specResp);
const spec = extractJson(specResp.text);
if (!spec || !spec.entities || spec.entities.length === 0) { result.error = 'JSON-speksi epäonnistui'; writeFileSync(`${dir}/_spec_raw.txt`, specResp.text); return result; }