Text Generation
Transformers
GGUF
Indonesian
English
indonesian
llama-cpp
minitron
knowledge-distillation
compact-llm
cpu-inference
cloud-escalation
artorialabs
conversational
Instructions to use artorialabs/MiniIndo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use artorialabs/MiniIndo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="artorialabs/MiniIndo")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("artorialabs/MiniIndo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use artorialabs/MiniIndo with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf artorialabs/MiniIndo:Q4_K_M # Run inference directly in the terminal: llama cli -hf artorialabs/MiniIndo:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf artorialabs/MiniIndo:Q4_K_M # Run inference directly in the terminal: llama cli -hf artorialabs/MiniIndo:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf artorialabs/MiniIndo:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf artorialabs/MiniIndo:Q4_K_M
Use Docker
docker model run hf.co/artorialabs/MiniIndo:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use artorialabs/MiniIndo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "artorialabs/MiniIndo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "artorialabs/MiniIndo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/artorialabs/MiniIndo:Q4_K_M
- SGLang
How to use artorialabs/MiniIndo with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "artorialabs/MiniIndo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "artorialabs/MiniIndo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "artorialabs/MiniIndo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "artorialabs/MiniIndo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use artorialabs/MiniIndo with Ollama:
ollama run hf.co/artorialabs/MiniIndo:Q4_K_M
- Unsloth Desktop
- Pi
How to use artorialabs/MiniIndo with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf artorialabs/MiniIndo:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "artorialabs/MiniIndo:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use artorialabs/MiniIndo with Docker Model Runner:
docker model run hf.co/artorialabs/MiniIndo:Q4_K_M
- Lemonade
How to use artorialabs/MiniIndo with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull artorialabs/MiniIndo:Q4_K_M
Run and chat with the model
lemonade run user.MiniIndo-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use artorialabs/MiniIndo with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf artorialabs/MiniIndo:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default artorialabs/MiniIndo:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use artorialabs/MiniIndo with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf artorialabs/MiniIndo:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "artorialabs/MiniIndo:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Keep only models/*.gguf and README.md
Browse files- ai_vs_ai_20turns.mjs +0 -134
- instruction.md +0 -76
- live_watch_bench.mjs +0 -134
- start_miniindo.bat +0 -21
- test_escalation_bench.mjs +0 -131
ai_vs_ai_20turns.mjs
DELETED
|
@@ -1,134 +0,0 @@
|
|
| 1 |
-
/**
|
| 2 |
-
* AI vs AI 20-Turn Live Conversation (MiniIndo-194M-v3)
|
| 3 |
-
* Streams 20 turns of Indonesian casual banter between two AI personas in real time.
|
| 4 |
-
*/
|
| 5 |
-
import { spawn } from 'node:child_process';
|
| 6 |
-
import { createInterface } from 'node:readline/promises';
|
| 7 |
-
import { stdin as input, stdout as output } from 'node:process';
|
| 8 |
-
import { setTimeout as sleep } from 'node:timers/promises';
|
| 9 |
-
|
| 10 |
-
const BIN = String.raw`C:\Users\Artoria\Documents\antigravity\minimind-train\bin\llama-server.exe`;
|
| 11 |
-
const MODEL = process.env.MODEL || String.raw`C:\Users\Artoria\Documents\antigravity\minimind-train\server_bundle\models\mini194m-v3-sft-q8_0.gguf`;
|
| 12 |
-
const PORT = 8098;
|
| 13 |
-
const URL = `http://127.0.0.1:${PORT}/v1/chat/completions`;
|
| 14 |
-
const HEALTH = `http://127.0.0.1:${PORT}/health`;
|
| 15 |
-
const TOTAL_TURNS = Number(process.env.TURNS ?? '20');
|
| 16 |
-
|
| 17 |
-
const PERSONA_A =
|
| 18 |
-
'Lu adalah MiniIndo, asisten AI lokal berbahasa Indonesia yang santai, akurat, dan jujur. ' +
|
| 19 |
-
'Jawab singkat 1-2 kalimat saja dengan bahasa santai Indonesia, lalu balas dengan pertanyaan ringan yang nyambung.';
|
| 20 |
-
|
| 21 |
-
const PERSONA_B =
|
| 22 |
-
'Lu adalah MiniIndo, asisten AI lokal berbahasa Indonesia yang santai, akrab, dan to the point. ' +
|
| 23 |
-
'Balas singkat 1-2 kalimat saja tanpa bertele-tele, lalu tanya balik ke lawan bicara.';
|
| 24 |
-
|
| 25 |
-
async function waitReady() {
|
| 26 |
-
for (let i = 0; i < 60; i++) {
|
| 27 |
-
try {
|
| 28 |
-
const r = await fetch(HEALTH);
|
| 29 |
-
if (r.ok) return;
|
| 30 |
-
} catch {}
|
| 31 |
-
await sleep(300);
|
| 32 |
-
}
|
| 33 |
-
throw new Error('llama-server timeout');
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
-
async function streamReply(systemPrompt, messages) {
|
| 37 |
-
const t0 = performance.now();
|
| 38 |
-
let out = '';
|
| 39 |
-
let timings = null;
|
| 40 |
-
const res = await fetch(URL, {
|
| 41 |
-
method: 'POST',
|
| 42 |
-
headers: { 'Content-Type': 'application/json' },
|
| 43 |
-
body: JSON.stringify({
|
| 44 |
-
messages: [{ role: 'system', content: systemPrompt }, ...messages],
|
| 45 |
-
temperature: 0.35,
|
| 46 |
-
top_p: 0.9,
|
| 47 |
-
repeat_penalty: 1.12,
|
| 48 |
-
presence_penalty: 0.4,
|
| 49 |
-
frequency_penalty: 0.4,
|
| 50 |
-
max_tokens: 60,
|
| 51 |
-
stream: true,
|
| 52 |
-
}),
|
| 53 |
-
});
|
| 54 |
-
const reader = res.body.getReader();
|
| 55 |
-
const dec = new TextDecoder();
|
| 56 |
-
let buf = '';
|
| 57 |
-
while (true) {
|
| 58 |
-
const { value, done } = await reader.read();
|
| 59 |
-
if (done) break;
|
| 60 |
-
buf += dec.decode(value, { stream: true });
|
| 61 |
-
const lines = buf.split('\n');
|
| 62 |
-
buf = lines.pop() || '';
|
| 63 |
-
for (const ln of lines) {
|
| 64 |
-
if (!ln.startsWith('data: ')) continue;
|
| 65 |
-
const payload = ln.slice(6).trim();
|
| 66 |
-
if (payload === '[DONE]') continue;
|
| 67 |
-
try {
|
| 68 |
-
const obj = JSON.parse(payload);
|
| 69 |
-
const chunk = obj.choices?.[0]?.delta?.content || '';
|
| 70 |
-
if (chunk) {
|
| 71 |
-
out += chunk;
|
| 72 |
-
process.stdout.write(chunk);
|
| 73 |
-
}
|
| 74 |
-
if (obj.timings) timings = obj.timings;
|
| 75 |
-
} catch {}
|
| 76 |
-
}
|
| 77 |
-
}
|
| 78 |
-
const ms = performance.now() - t0;
|
| 79 |
-
const tps = timings?.predicted_per_second || 0;
|
| 80 |
-
return { text: out.trim() || 'Wkwk iya juga sih bro.', ms, tps };
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
async function main() {
|
| 84 |
-
let seed = process.argv.slice(2).join(' ').trim();
|
| 85 |
-
if (!seed) {
|
| 86 |
-
const rl = createInterface({ input, output });
|
| 87 |
-
seed = (await rl.question('\x1b[36mMasukkan topik / pesan awal (Enter = default): \x1b[0m')).trim();
|
| 88 |
-
rl.close();
|
| 89 |
-
}
|
| 90 |
-
if (!seed) {
|
| 91 |
-
seed = 'pagi bro, gw baru mau berangkat ke kampus nih sambil ngopi, menurut lu enaknya bahas apa hari ini?';
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
console.log(`\x1b[36mStarting MiniIndo-194M-v3 (Q8_0) for ${TOTAL_TURNS}-Turn AI vs AI Chat...\x1b[0m`);
|
| 95 |
-
const srv = spawn(BIN, ['-m', MODEL, '--host', '127.0.0.1', '--port', String(PORT), '--threads', '4', '--ctx-size', '4096', '-ngl', '0', '--parallel', '1'], {
|
| 96 |
-
stdio: 'ignore',
|
| 97 |
-
});
|
| 98 |
-
const cleanup = () => { try { srv.kill('SIGTERM'); } catch {} };
|
| 99 |
-
process.on('SIGINT', cleanup);
|
| 100 |
-
|
| 101 |
-
try {
|
| 102 |
-
await waitReady();
|
| 103 |
-
// Transcript stored as [{ speaker: 'A'|'B', text }]
|
| 104 |
-
const log = [{ speaker: 'A', text: seed }];
|
| 105 |
-
console.log(`\n\x1b[33m[Awal / Topik User] Penanya:\x1b[0m ${log[0].text}`);
|
| 106 |
-
|
| 107 |
-
let totalTps = 0;
|
| 108 |
-
for (let turn = 1; turn <= TOTAL_TURNS; turn++) {
|
| 109 |
-
const isB = turn % 2 === 1;
|
| 110 |
-
const speaker = isB ? 'B' : 'A';
|
| 111 |
-
const name = isB ? 'MiniIndo' : 'Raka';
|
| 112 |
-
const color = isB ? '\x1b[32m' : '\x1b[33m';
|
| 113 |
-
const sys = isB ? PERSONA_B : PERSONA_A;
|
| 114 |
-
|
| 115 |
-
// Keep only last 2 turns so small 194M model stays concise and avoids copying multi-turn blocks
|
| 116 |
-
const recent = log.slice(-2).map(entry => ({
|
| 117 |
-
role: entry.speaker === speaker ? 'assistant' : 'user',
|
| 118 |
-
content: entry.text,
|
| 119 |
-
}));
|
| 120 |
-
|
| 121 |
-
process.stdout.write(`\n${color}[Turn ${turn}/${TOTAL_TURNS}] ${name}:\x1b[0m `);
|
| 122 |
-
const r = await streamReply(sys, recent);
|
| 123 |
-
totalTps += r.tps;
|
| 124 |
-
console.log(` \x1b[90m(${r.ms.toFixed(0)}ms | ${r.tps.toFixed(1)} tok/s)\x1b[0m`);
|
| 125 |
-
log.push({ speaker, text: r.text });
|
| 126 |
-
}
|
| 127 |
-
console.log(`\n\x1b[36m=== SELESAI ${TOTAL_TURNS} TURN | Avg Speed: ${(totalTps / TOTAL_TURNS).toFixed(1)} tok/s ===\x1b[0m`);
|
| 128 |
-
} finally {
|
| 129 |
-
process.off('SIGINT', cleanup);
|
| 130 |
-
cleanup();
|
| 131 |
-
}
|
| 132 |
-
}
|
| 133 |
-
|
| 134 |
-
main().catch(err => { console.error(err); process.exit(1); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
instruction.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
| 1 |
-
# MiniIndo-LLM Integration Guide (`botwa` Local-First -> Cloud Escalation)
|
| 2 |
-
|
| 3 |
-
> **Target Folder:** `C:\Users\XinooXS\Documents\PROJEK GEDE\MiniIndo-LLM` (alias `Z:\Documents\PROJEK GEDE\MiniIndo-LLM`)
|
| 4 |
-
> **Target Bot Repo (jangan ubah tanpa mengikuti panduan ini):** `C:\Users\XinooXS\Documents\PROJEK GEDE\botwa` (`Z:\Documents\PROJEK GEDE\botwa`)
|
| 5 |
-
|
| 6 |
-
Dokumen ini ditujukan untuk **AI Agent / Developer `botwa`** agar dapat menghubungkan `botwa` ke **MiniIndo-LLM** (server `llama.cpp` lokal di `http://127.0.0.1:8095/v1/chat/completions`) sebagai **Layer AI Lokal Pertama** sebelum melakukan eskalasi ke Cloud AI.
|
| 7 |
-
|
| 8 |
-
---
|
| 9 |
-
|
| 10 |
-
## 1. Pilihan Model yang Tersedia di `models\` (Terukur di CPU `rielcomputer` i5-5200U, `-t 2`, `BelowNormal`)
|
| 11 |
-
|
| 12 |
-
| Model File | Ukuran | RAM Live | Kecepatan (`llama-bench` / Live) | Rekomendasi Pemakaian |
|
| 13 |
-
|---|---:|---:|---|---|
|
| 14 |
-
| `mini194m-v3-sft-q4_k_m.gguf` **(Default)** | `134.59 MiB` | `246.2 MB` | `pp256: 37.0 tok/s`, `tg64: 13.8 tok/s` | **Default seimbang:** cepat + akurat untuk QA konteks chat WA, matematika dasar, sapaan santai, & `[ESKALASI_CLOUD]`. Gunakan `LP_CUTOFF = -0.95`. |
|
| 15 |
-
| `mini376m-v3-sft-q4_k_m.gguf` | `253.92 MiB` | `394.6 MB` | `pp256: 6.9 tok/s`, `tg64: 4.9 tok/s` (Live avg `7.2 tok/s`) | **Akurasi maksimal:** rangkuman grup & pengetahuan umum paling kuat (24L + 4864 FFN utuh). Gunakan `LP_CUTOFF = -0.78`. |
|
| 16 |
-
| `mini376m-v3-sft-q3_k_m.gguf` | `213.54 MiB` | `~340 MB` | `pp256: 28.0 tok/s`, `tg64: 10.4 tok/s` | Alternatif `376M` lebih ringan & responsif. |
|
| 17 |
-
| `mini101m-v3-sft-q4_k_m.gguf` | `73.04 MiB` | `155.3 MB` | `pp256: 63.6 tok/s`, `tg64: 26.9 tok/s` (Live `21.6 tok/s`) | **Ultra-ringan / Triage:** `9/9` routing eskalasi, cocok jika CPU sangat sibuk. |
|
| 18 |
-
| `mini66m-v3-sft-q4_k_m.gguf` | `49.74 MiB` | `~120 MB` | `pp256: 124.4 tok/s`, `tg64: 43.6 tok/s` | Baseline ultra-cepat `65.65M` parameter. |
|
| 19 |
-
| `smol135-v3-sft-q4_k_m.gguf` | `98.87 MiB` | `~190 MB` | `pp256: 47.8 tok/s`, `tg64: 19.5 tok/s` | Pembanding eksternal (`SmolLM2-135M`). |
|
| 20 |
-
|
| 21 |
-
Menjalankan server lokal secara aman (prioritas `BelowNormal` agar `MetaTrader 5 / terminal64.exe` dan `pm2` tidak terganggu):
|
| 22 |
-
```bat
|
| 23 |
-
cd /d "C:\Users\XinooXS\Documents\PROJEK GEDE\MiniIndo-LLM"
|
| 24 |
-
start_miniindo.bat
|
| 25 |
-
```
|
| 26 |
-
Atau ganti model: `start_miniindo.bat mini376m-v3-sft-q4_k_m.gguf`.
|
| 27 |
-
|
| 28 |
-
---
|
| 29 |
-
|
| 30 |
-
## 2. Arsitektur Integrasi di `botwa`
|
| 31 |
-
|
| 32 |
-
Jangan hapus sistem lama (`lib/casual-gate.js` dan `lib/localmodel.js`). Sisipkan `MiniIndo` sebagai **layer opsional dengan feature flag** (`process.env.USE_MINIINDO_LOCAL === '1'`) di `lib/riel.js`:
|
| 33 |
-
|
| 34 |
-
1. **Pertahankan `think(...)` (`lib/localmodel.js`) & `evaluateCasualGate(...)` (`lib/casual-gate.js`)** pada `lib/riel.js` (~L675 & L1045–1078).
|
| 35 |
-
2. **Tepat setelah `evaluateCasualGate(...)` miss** (sekitar `lib/riel.js` L1078, sebelum masuk loop Cloud Agent `while (!agentFinished && iteration < maxIterations)` di L1087):
|
| 36 |
-
- Jalankan MiniIndo **HANYA jika**:
|
| 37 |
-
- `process.env.USE_MINIINDO_LOCAL === '1'`
|
| 38 |
-
- `!isDumpMode && !mediaIntentDirective && !imageUrl && !audioData && !hasQuotedImg && !documentContext`
|
| 39 |
-
- Tidak membutuhkan tool/MCP eksternal (`(filteredToolsInfo?.mcpCount ?? 0) === 0`)
|
| 40 |
-
3. **Buat modul baru `lib/miniindo.js`**:
|
| 41 |
-
- Panggil `POST http://127.0.0.1:8095/v1/chat/completions` (`AbortSignal.timeout(12000)` untuk `194M`, atau `25000` untuk `376M`).
|
| 42 |
-
- Wajib sertakan `logprobs: true`, `temperature: 0.25`, `top_p: 0.9`, `repeat_penalty: 1.08`, `max_tokens: 180`.
|
| 43 |
-
- **System Prompt Wajib:**
|
| 44 |
-
```text
|
| 45 |
-
Lu adalah MiniIndo, asisten AI lokal berbahasa Indonesia yang santai, akurat, dan jujur. Jawab jelas dari pengetahuan atau potongan chat yang diberikan. Kalau info tidak ada di konteks atau pertanyaan terlalu berat/di luar kemampuanmu, wajib jawab diawali [ESKALASI_CLOUD].
|
| 46 |
-
```
|
| 47 |
-
- Jika `quotedContextBlock` atau `groupContextBlock` tersedia di `lib/riel.js`, gabungkan sebagai konteks sebelum pertanyaan user:
|
| 48 |
-
```text
|
| 49 |
-
Berdasarkan potongan chat WhatsApp ini:
|
| 50 |
-
<isi groupContextBlock / quotedContextBlock>
|
| 51 |
-
|
| 52 |
-
Pertanyaan: <question>
|
| 53 |
-
```
|
| 54 |
-
|
| 55 |
-
---
|
| 56 |
-
|
| 57 |
-
## 3. Aturan Eskalasi ke Cloud AI (Fail-Safe)
|
| 58 |
-
|
| 59 |
-
`queryMiniIndo(...)` di `lib/miniindo.js` harus mengembalikan `{ hit: boolean, reply?: string, reason?: string }` dan **WAJIB fallback (`hit: false`) ke loop Cloud Agent `lib/riel.js` L1087** jika salah satu kondisi berikut terpenuhi:
|
| 60 |
-
|
| 61 |
-
1. Server `127.0.0.1:8095` mati, timeout, atau HTTP status bukan `200`.
|
| 62 |
-
2. Output kosong atau mengandung tag **`[ESKALASI_CLOUD]`** (case-insensitive).
|
| 63 |
-
3. Rata-rata `logprob` token respons (`avgLp`) berada di bawah ambang batas kepercayaan:
|
| 64 |
-
- **`avgLp < -0.95`** (untuk `mini194m-v3-sft-q4_k_m.gguf`)
|
| 65 |
-
- **`avgLp < -0.78`** (untuk `mini376m-v3-sft-q4_k_m.gguf`)
|
| 66 |
-
4. Jawaban terlihat repetitif/terputus tidak wajar (`reply.length < 3`).
|
| 67 |
-
|
| 68 |
-
Jika `hit: true`, kirim `res.reply` ke user, panggil `saveHistory(...)` dan `finishAndDump(...)` sama seperti pola `evaluateCasualGate` hit di `lib/riel.js`, lalu `return`.
|
| 69 |
-
|
| 70 |
-
---
|
| 71 |
-
|
| 72 |
-
## 4. Privasi & Keamanan
|
| 73 |
-
|
| 74 |
-
- Seluruh model `MiniIndo` di folder `models\` hanya dilatih pada korpus terkurasi bebas PII (`Karasuno`, `Sistem Informasi 012`, `Kabinet Memajukan Indonesia` yang sudah di-anonymize; grup `CEREEEEE` diblokir permanen).
|
| 75 |
-
- `llama-server.exe` hanya bind ke loopback **`127.0.0.1:8095`** (tidak terbuka ke LAN/internet).
|
| 76 |
-
- Jangan pernah mengirim data sensitif ke endpoint publik saat memakai mode lokal; eskalasi ke Cloud AI hanya terjadi ketika kondisi fallback di Bagian 3 terpicu.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
live_watch_bench.mjs
DELETED
|
@@ -1,134 +0,0 @@
|
|
| 1 |
-
/**
|
| 2 |
-
* Live Streaming Benchmark: MiniIndo-194M-v3 vs Qwen3-0.6B
|
| 3 |
-
* Streams tokens in real time to the terminal so the user can watch live without waiting.
|
| 4 |
-
*/
|
| 5 |
-
import { spawn } from 'node:child_process';
|
| 6 |
-
import { setTimeout as sleep } from 'node:timers/promises';
|
| 7 |
-
|
| 8 |
-
const BIN = String.raw`C:\Users\Artoria\Documents\antigravity\minimind-train\bin\llama-server.exe`;
|
| 9 |
-
const PORT = 8097;
|
| 10 |
-
const URL = `http://127.0.0.1:${PORT}/v1/chat/completions`;
|
| 11 |
-
const HEALTH = `http://127.0.0.1:${PORT}/health`;
|
| 12 |
-
|
| 13 |
-
const SYS_PROMPT =
|
| 14 |
-
'Lu adalah MiniIndo, asisten AI lokal berbahasa Indonesia yang santai, akurat, dan jujur. ' +
|
| 15 |
-
'Jawab jelas dari pengetahuan atau potongan chat yang diberikan. ' +
|
| 16 |
-
'Kalau info tidak ada di konteks atau pertanyaan terlalu berat/di luar kemampuanmu, wajib jawab diawali [ESKALASI_CLOUD].';
|
| 17 |
-
|
| 18 |
-
const MODELS = [
|
| 19 |
-
{
|
| 20 |
-
label: 'MiniIndo-194M-v3 (Q4_K_M, 135 MiB)',
|
| 21 |
-
path: String.raw`C:\Users\Artoria\Documents\antigravity\minimind-train\server_bundle\models\mini194m-v3-sft-q4_k_m.gguf`,
|
| 22 |
-
},
|
| 23 |
-
{
|
| 24 |
-
label: 'Qwen3-0.6B (Q4_K_M, 378 MiB)',
|
| 25 |
-
path: String.raw`Z:\Documents\PROJEK GEDE\MiniIndo-LLM\models\Qwen3-0.6B-Q4_K_M.gguf`,
|
| 26 |
-
},
|
| 27 |
-
];
|
| 28 |
-
|
| 29 |
-
const PROMPTS = [
|
| 30 |
-
{ name: '1. Sapaan Slang', q: 'halo lu siapa?' },
|
| 31 |
-
{ name: '2. WA Context QA', q: 'Berdasarkan potongan chat WhatsApp ini:\n[21:50] Raka: gweh mau ke bali tahun depan skalian nyari kerjaan remote disana\n[21:52] Tama: btw tadi botnya sempat off lagi perbaikan kata Bima\n\nPertanyaan: siapa yang pengen ke Bali tahun depan dan apa tujuannya?' },
|
| 32 |
-
{ name: '3. Hitungan Dasar', q: 'gw pesen 3 martabak manis satunya 32rb, total bayarnya berapa?' },
|
| 33 |
-
{ name: '4. Realtime Trap', q: 'berapa harga saham bbca hari ini real-time?' },
|
| 34 |
-
];
|
| 35 |
-
|
| 36 |
-
async function waitReady() {
|
| 37 |
-
for (let i = 0; i < 60; i++) {
|
| 38 |
-
try {
|
| 39 |
-
const r = await fetch(HEALTH);
|
| 40 |
-
if (r.ok) return;
|
| 41 |
-
} catch {}
|
| 42 |
-
await sleep(300);
|
| 43 |
-
}
|
| 44 |
-
throw new Error('llama-server timeout');
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
async function streamPrompt(q) {
|
| 48 |
-
const t0 = performance.now();
|
| 49 |
-
let tFirst = null;
|
| 50 |
-
let toks = 0;
|
| 51 |
-
let timings = null;
|
| 52 |
-
const res = await fetch(URL, {
|
| 53 |
-
method: 'POST',
|
| 54 |
-
headers: { 'Content-Type': 'application/json' },
|
| 55 |
-
body: JSON.stringify({
|
| 56 |
-
messages: [
|
| 57 |
-
{ role: 'system', content: SYS_PROMPT },
|
| 58 |
-
{ role: 'user', content: q },
|
| 59 |
-
],
|
| 60 |
-
temperature: 0.25,
|
| 61 |
-
repeat_penalty: 1.08,
|
| 62 |
-
max_tokens: 140,
|
| 63 |
-
stream: true,
|
| 64 |
-
}),
|
| 65 |
-
});
|
| 66 |
-
const reader = res.body.getReader();
|
| 67 |
-
const dec = new TextDecoder();
|
| 68 |
-
let buf = '';
|
| 69 |
-
while (true) {
|
| 70 |
-
const { value, done } = await reader.read();
|
| 71 |
-
if (done) break;
|
| 72 |
-
buf += dec.decode(value, { stream: true });
|
| 73 |
-
const lines = buf.split('\n');
|
| 74 |
-
buf = lines.pop() || '';
|
| 75 |
-
for (const ln of lines) {
|
| 76 |
-
if (!ln.startsWith('data: ')) continue;
|
| 77 |
-
const payload = ln.slice(6).trim();
|
| 78 |
-
if (payload === '[DONE]') continue;
|
| 79 |
-
try {
|
| 80 |
-
const obj = JSON.parse(payload);
|
| 81 |
-
const delta = obj.choices?.[0]?.delta;
|
| 82 |
-
const chunk = (delta?.reasoning_content || '') + (delta?.content || '');
|
| 83 |
-
if (chunk) {
|
| 84 |
-
if (tFirst === null) tFirst = performance.now();
|
| 85 |
-
toks++;
|
| 86 |
-
process.stdout.write(chunk);
|
| 87 |
-
}
|
| 88 |
-
if (obj.timings) timings = obj.timings;
|
| 89 |
-
} catch {}
|
| 90 |
-
}
|
| 91 |
-
}
|
| 92 |
-
const wallMs = performance.now() - t0;
|
| 93 |
-
const ttftMs = tFirst ? tFirst - t0 : wallMs;
|
| 94 |
-
const genTps = timings?.predicted_per_second || (toks / Math.max((wallMs - ttftMs) / 1000, 0.01));
|
| 95 |
-
return { wallMs, ttftMs, genTps, toks };
|
| 96 |
-
}
|
| 97 |
-
|
| 98 |
-
async function main() {
|
| 99 |
-
const summary = [];
|
| 100 |
-
for (const m of MODELS) {
|
| 101 |
-
console.log(`\n\x1b[36m==================================================================`);
|
| 102 |
-
console.log(`LOADING: ${m.label}`);
|
| 103 |
-
console.log(`==================================================================\x1b[0m`);
|
| 104 |
-
const srv = spawn(BIN, ['-m', m.path, '--host', '127.0.0.1', '--port', String(PORT), '--threads', '4', '--ctx-size', '4096', '-ngl', '0', '--parallel', '1'], {
|
| 105 |
-
stdio: 'ignore',
|
| 106 |
-
});
|
| 107 |
-
const cleanup = () => { try { srv.kill('SIGTERM'); } catch {} };
|
| 108 |
-
process.on('SIGINT', cleanup);
|
| 109 |
-
try {
|
| 110 |
-
await waitReady();
|
| 111 |
-
const stats = [];
|
| 112 |
-
for (const p of PROMPTS) {
|
| 113 |
-
console.log(`\n\x1b[33m[${p.name}]\x1b[0m \x1b[90m${p.q.replace(/\n+/g, ' ')}\x1b[0m`);
|
| 114 |
-
process.stdout.write('\x1b[32m> \x1b[0m');
|
| 115 |
-
const st = await streamPrompt(p.q);
|
| 116 |
-
stats.push(st);
|
| 117 |
-
console.log(`\n \x1b[90m[TTFT=${st.ttftMs.toFixed(0)}ms | Total=${st.wallMs.toFixed(0)}ms | Speed=${st.genTps.toFixed(1)} tok/s]\x1b[0m`);
|
| 118 |
-
}
|
| 119 |
-
const avgGen = stats.reduce((a, b) => a + b.genTps, 0) / stats.length;
|
| 120 |
-
const avgWall = stats.reduce((a, b) => a + b.wallMs, 0) / stats.length;
|
| 121 |
-
summary.push({ label: m.label, avgGen, avgWall });
|
| 122 |
-
} finally {
|
| 123 |
-
process.off('SIGINT', cleanup);
|
| 124 |
-
cleanup();
|
| 125 |
-
await sleep(600);
|
| 126 |
-
}
|
| 127 |
-
}
|
| 128 |
-
console.log(`\n\x1b[36m=== RINGKASAN LIVE BENCHMARK ===\x1b[0m`);
|
| 129 |
-
for (const s of summary) {
|
| 130 |
-
console.log(`- ${s.label}: avg_gen=${s.avgGen.toFixed(1)} tok/s | avg_latency=${(s.avgWall / 1000).toFixed(2)}s`);
|
| 131 |
-
}
|
| 132 |
-
}
|
| 133 |
-
|
| 134 |
-
main().catch(err => { console.error(err); process.exit(1); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
start_miniindo.bat
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
@echo off
|
| 2 |
-
setlocal
|
| 3 |
-
cd /d "%~dp0"
|
| 4 |
-
|
| 5 |
-
set MODEL=mini194m-v3-sft-q4_k_m.gguf
|
| 6 |
-
if not "%~1"=="" set MODEL=%~1
|
| 7 |
-
|
| 8 |
-
set PORT=8095
|
| 9 |
-
if not "%~2"=="" set PORT=%~2
|
| 10 |
-
|
| 11 |
-
echo Starting %MODEL% on http://127.0.0.1:%PORT% ^(threads=2, ctx=4096, Priority=BelowNormal^)...
|
| 12 |
-
start "MiniIndo-LLM" /BELOWNORMAL "%~dp0bin\llama-server.exe" ^
|
| 13 |
-
-m "%~dp0models\%MODEL%" ^
|
| 14 |
-
--host 127.0.0.1 ^
|
| 15 |
-
--port %PORT% ^
|
| 16 |
-
--threads 2 ^
|
| 17 |
-
--threads-batch 4 ^
|
| 18 |
-
--ctx-size 4096 ^
|
| 19 |
-
--n-gpu-layers 0 ^
|
| 20 |
-
--parallel 1 ^
|
| 21 |
-
--no-warmup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_escalation_bench.mjs
DELETED
|
@@ -1,131 +0,0 @@
|
|
| 1 |
-
/**
|
| 2 |
-
* Benchmark & Cloud-Escalation Test Harness untuk MiniIndo-LLM (llama-server.exe /v1/chat/completions)
|
| 3 |
-
* Jalan dengan Node.js >=18 atau Bun di Windows Server rielcomputer.
|
| 4 |
-
*/
|
| 5 |
-
|
| 6 |
-
const URL = process.env.MINIINDO_URL || 'http://127.0.0.1:8095/v1/chat/completions';
|
| 7 |
-
const LABEL = process.env.MODEL_LABEL || process.argv[2] || 'miniindo-model';
|
| 8 |
-
const LP_CUTOFF = Number(process.env.LP_CUTOFF ?? '-0.95');
|
| 9 |
-
const MAX_TOKENS = Number(process.env.MAX_TOKENS ?? '128');
|
| 10 |
-
const SYS_PROMPT =
|
| 11 |
-
'Lu adalah MiniIndo, asisten AI lokal berbahasa Indonesia yang santai, akurat, dan jujur. ' +
|
| 12 |
-
'Jawab jelas dari pengetahuan atau potongan chat yang diberikan. ' +
|
| 13 |
-
'Kalau info tidak ada di konteks atau pertanyaan terlalu berat/di luar kemampuanmu, wajib jawab diawali [ESKALASI_CLOUD].';
|
| 14 |
-
|
| 15 |
-
const SAMPLE_KARASUNO = [
|
| 16 |
-
'[21:50] Raka: ges mo nanya dong, ada yang pernah ke sawarna ga? kira2 pantai yang bagus namanya apa dan jalannya nanjak2 ngga ya',
|
| 17 |
-
'[21:51] Dika: Ancol',
|
| 18 |
-
'[21:51] Raka: gweh mau ke bali tahun depan skalian nyari kenalan disana',
|
| 19 |
-
'[21:52] Tama: btw tadi botnya sempat off lagi perbaikan kata Bima',
|
| 20 |
-
'[21:56] Bot_Riel: Halo! Ada yang bisa dibantu hari ini?',
|
| 21 |
-
].join('\n');
|
| 22 |
-
|
| 23 |
-
const TESTS = [
|
| 24 |
-
{
|
| 25 |
-
name: '1. WA Context QA (Sawarna/Bali)',
|
| 26 |
-
expectEscalate: false,
|
| 27 |
-
prompt: `Berdasarkan potongan chat WhatsApp ini:\n${SAMPLE_KARASUNO}\n\nPertanyaan: siapa yang pengen ke Bali tahun depan dan apa alasannya?`
|
| 28 |
-
},
|
| 29 |
-
{
|
| 30 |
-
name: '2. WA Context Summary',
|
| 31 |
-
expectEscalate: false,
|
| 32 |
-
prompt: `rangkumin inti obrolan grup di bawah ini secara singkat:\n${SAMPLE_KARASUNO}`
|
| 33 |
-
},
|
| 34 |
-
{
|
| 35 |
-
name: '3. WA Out-of-Context -> Must Escalate',
|
| 36 |
-
expectEscalate: true,
|
| 37 |
-
prompt: `Berdasarkan potongan chat WhatsApp ini:\n${SAMPLE_KARASUNO}\n\nPertanyaan: berapa harga tiket masuk pantai Sawarna per orang saat akhir pekan?`
|
| 38 |
-
},
|
| 39 |
-
{
|
| 40 |
-
name: '4. Core Knowledge (Python List)',
|
| 41 |
-
expectEscalate: false,
|
| 42 |
-
prompt: 'di Python, bedanya metode append sama extend di list apa ya?'
|
| 43 |
-
},
|
| 44 |
-
{
|
| 45 |
-
name: '5. Core Knowledge (Gunung Berapi ID)',
|
| 46 |
-
expectEscalate: false,
|
| 47 |
-
prompt: 'sebutin 3 nama gunung berapi aktif terkenal di Indonesia!'
|
| 48 |
-
},
|
| 49 |
-
{
|
| 50 |
-
name: '6. Math Dasar (Martabak)',
|
| 51 |
-
expectEscalate: false,
|
| 52 |
-
prompt: 'gw pesen 3 martabak manis satunya 32rb, total bayarnya berapa?'
|
| 53 |
-
},
|
| 54 |
-
{
|
| 55 |
-
name: '7. Sapaan Santai',
|
| 56 |
-
expectEscalate: false,
|
| 57 |
-
prompt: 'wkwk asli males bgt besok udah senin lagi nih'
|
| 58 |
-
},
|
| 59 |
-
{
|
| 60 |
-
name: '8. Open-World Trap (Antartika) -> Must Escalate',
|
| 61 |
-
expectEscalate: true,
|
| 62 |
-
prompt: 'siapa nama presiden benua antartika tahun 2026?'
|
| 63 |
-
},
|
| 64 |
-
{
|
| 65 |
-
name: '9. Realtime/Heavy Task -> Must Escalate',
|
| 66 |
-
expectEscalate: true,
|
| 67 |
-
prompt: 'berapa harga saham bbca dan ihsg hari ini real-time?'
|
| 68 |
-
},
|
| 69 |
-
];
|
| 70 |
-
|
| 71 |
-
async function queryModel(prompt) {
|
| 72 |
-
const t0 = performance.now();
|
| 73 |
-
const res = await fetch(URL, {
|
| 74 |
-
method: 'POST',
|
| 75 |
-
headers: { 'Content-Type': 'application/json' },
|
| 76 |
-
body: JSON.stringify({
|
| 77 |
-
messages: [
|
| 78 |
-
{ role: 'system', content: SYS_PROMPT },
|
| 79 |
-
{ role: 'user', content: prompt },
|
| 80 |
-
],
|
| 81 |
-
temperature: 0.25,
|
| 82 |
-
top_p: 0.9,
|
| 83 |
-
repeat_penalty: 1.08,
|
| 84 |
-
max_tokens: MAX_TOKENS,
|
| 85 |
-
logprobs: true,
|
| 86 |
-
stream: false,
|
| 87 |
-
}),
|
| 88 |
-
});
|
| 89 |
-
const wallMs = performance.now() - t0;
|
| 90 |
-
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
|
| 91 |
-
const data = await res.json();
|
| 92 |
-
const choice = data.choices?.[0];
|
| 93 |
-
const text = (choice?.message?.content || '').trim();
|
| 94 |
-
const lpList = (choice?.logprobs?.content || []).map(x => x.logprob).filter(Number.isFinite);
|
| 95 |
-
const avgLp = lpList.length ? lpList.reduce((a, b) => a + b, 0) / lpList.length : null;
|
| 96 |
-
const minLp = lpList.length ? Math.min(...lpList) : null;
|
| 97 |
-
const predTok = data.timings?.predicted_n ?? data.usage?.completion_tokens ?? lpList.length;
|
| 98 |
-
const promptTok = data.timings?.prompt_n ?? data.usage?.prompt_tokens ?? 0;
|
| 99 |
-
const timings = data.timings || {};
|
| 100 |
-
const genTps = timings.predicted_per_second || (predTok / Math.max(wallMs / 1000, 0.01));
|
| 101 |
-
const promptTps = timings.prompt_per_second || 0;
|
| 102 |
-
const explicitEsc = text.includes('[ESKALASI_CLOUD]');
|
| 103 |
-
const lpEsc = avgLp !== null && avgLp < LP_CUTOFF;
|
| 104 |
-
const escalated = explicitEsc || lpEsc;
|
| 105 |
-
return { text, escalated, explicitEsc, lpEsc, avgLp, minLp, predTok, promptTok, genTps, promptTps, wallMs };
|
| 106 |
-
}
|
| 107 |
-
|
| 108 |
-
async function main() {
|
| 109 |
-
console.log(`=== BENCH: ${LABEL} @ ${URL} (lpCutoff=${LP_CUTOFF}, maxTok=${MAX_TOKENS}) ===`);
|
| 110 |
-
const results = [];
|
| 111 |
-
for (const t of TESTS) {
|
| 112 |
-
const r = await queryModel(t.prompt);
|
| 113 |
-
results.push({ ...t, ...r });
|
| 114 |
-
const lpStr = r.avgLp === null ? 'n/a' : r.avgLp.toFixed(3);
|
| 115 |
-
const routeOk = r.escalated === t.expectEscalate ? 'ROUTE_OK' : 'ROUTE_MISS';
|
| 116 |
-
console.log(
|
| 117 |
-
`\n[${t.name}] ${routeOk} esc=${r.escalated}(exp=${t.expectEscalate}, tag=${r.explicitEsc}, lp=${r.lpEsc}) ` +
|
| 118 |
-
`| avg_lp=${lpStr} | prompt=${r.promptTok}t@${r.promptTps.toFixed(1)}t/s | gen=${r.predTok}t@${r.genTps.toFixed(1)}t/s | ${r.wallMs.toFixed(0)}ms`
|
| 119 |
-
);
|
| 120 |
-
console.log(` -> ${r.text.replace(/\n+/g, ' ')}`);
|
| 121 |
-
}
|
| 122 |
-
const avgGen = results.reduce((s, r) => s + r.genTps, 0) / results.length;
|
| 123 |
-
const avgPrompt = results.reduce((s, r) => s + r.promptTps, 0) / results.length;
|
| 124 |
-
const routeHits = results.filter(r => r.escalated === r.expectEscalate).length;
|
| 125 |
-
console.log(`\n=== SUMMARY [${LABEL}]: route=${routeHits}/${results.length} | avg_prompt=${avgPrompt.toFixed(2)} tok/s | avg_gen=${avgGen.toFixed(2)} tok/s ===`);
|
| 126 |
-
}
|
| 127 |
-
|
| 128 |
-
main().catch(err => {
|
| 129 |
-
console.error(err);
|
| 130 |
-
process.exit(1);
|
| 131 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|