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"
Add Q8_0 variants (66M, 101M, 135M, 194M) + live chat scripts and updated README
Browse files- .gitattributes +4 -0
- README.md +7 -15
- ai_vs_ai_20turns.mjs +134 -0
- live_watch_bench.mjs +134 -0
- models/mini101m-v3-sft-q8_0.gguf +3 -0
- models/mini194m-v3-sft-q8_0.gguf +3 -0
- models/mini66m-v3-sft-q8_0.gguf +3 -0
- models/smol135-v3-sft-q8_0.gguf +3 -0
.gitattributes
CHANGED
|
@@ -39,3 +39,7 @@ models/mini376m-v3-sft-q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
|
| 39 |
models/mini376m-v3-sft-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
models/mini66m-v3-sft-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
models/smol135-v3-sft-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
models/mini376m-v3-sft-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
models/mini66m-v3-sft-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
models/smol135-v3-sft-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
models/mini101m-v3-sft-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
models/mini194m-v3-sft-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
models/mini66m-v3-sft-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
models/smol135-v3-sft-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -94,12 +94,13 @@ All speeds and RAM numbers below were **measured directly on a dual-core Windows
|
|
| 94 |
|
| 95 |
| Model File | Architecture | Params | GGUF Size | `llama-bench` (`pp256` / `tg64`) | Live Server (`avg_prompt` / `avg_gen`) | Live RAM | Best Use Case |
|
| 96 |
|---|---|---:|---:|---|---|---:|---|
|
| 97 |
-
| **`mini194m-v3-sft-q4_k_m.gguf`** *(Default)* | 24L Attention intact, FFN `2048`, 20k vocab | `194.15 M` | `134.59 MiB` | `37.00` / `13.83` tok/s | `23.61` / `9.62` tok/s | `246.2 MB` | **Best speed/accuracy balance** (`3–9s` chat latency
|
|
|
|
| 98 |
| **`mini376m-v3-sft-q4_k_m.gguf`** | 24L + FFN `4864` intact, 20k vocab | `375.82 M` | `253.92 MiB` | `6.88` / `4.92` tok/s | `16.00` / `7.16` tok/s | `394.6 MB` | **Maximum accuracy** (best 4-speaker WA summary, Python, RAM/SSD, math). Slower on dual-core `1.5 GHz`. Use `lpCutoff = -0.78`. |
|
| 99 |
| **`mini376m-v3-sft-q3_k_m.gguf`** | 24L + FFN `4864` intact, 20k vocab | `375.82 M` | `213.54 MiB` | `27.96` / `10.39` tok/s | — | `~340 MB` | Faster `Q3_K_M` option for `376M`. |
|
| 100 |
-
| **`mini101m-v3-sft-q4_k_m.gguf`** | 14/24 Strided layers, FFN `1536`, 20k vocab | `101.45 M` | `73.04 MiB` | `63.55` / `26.85` tok/s | `47.78` / `21.62` tok/s | `155.3 MB` | **Ultra-fast escalation router** (`9/9` routing accuracy at `21.6 tok/s`). |
|
| 101 |
-
| **`mini66m-v3-sft-q4_k_m.gguf`** | 8/24 Strided layers, FFN `1536`, 20k vocab | `65.65 M` | `49.74 MiB` | `124.43` / `43.64` tok/s | — | `~120 MB` | Ultra-light `>=64M` speed baseline (`43.6 tok/s`!). |
|
| 102 |
-
| `smol135-v3-sft-q4_k_m.gguf` | `SmolLM2-135M-Instruct` trained on V3 corpus | `134.52 M` | `98.87 MiB` | `47.82` / `19.48` tok/s | — | `~190 MB` | External open-weights baseline comparator. |
|
| 103 |
|
| 104 |
---
|
| 105 |
|
|
@@ -114,13 +115,7 @@ Lu adalah MiniIndo, asisten AI lokal berbahasa Indonesia yang santai, akurat, da
|
|
| 114 |
```bash
|
| 115 |
llama-server -m models/mini194m-v3-sft-q4_k_m.gguf --host 127.0.0.1 --port 8095 --threads 2 --ctx-size 4096 -ngl 0
|
| 116 |
```
|
| 117 |
-
|
| 118 |
-
```bat
|
| 119 |
-
start_miniindo.bat
|
| 120 |
-
:: Or switch variant:
|
| 121 |
-
start_miniindo.bat mini376m-v3-sft-q4_k_m.gguf
|
| 122 |
-
```
|
| 123 |
-
Once running, open **`http://127.0.0.1:8095`** in any browser for the built-in Chat UI, or run `node test_escalation_bench.mjs` to test escalation routing.
|
| 124 |
|
| 125 |
### Node.js API Call with `logprobs` Escalation Gate
|
| 126 |
```js
|
|
@@ -163,10 +158,7 @@ const shouldEscalate = !reply || reply.includes('[ESKALASI_CLOUD]') || avgLp < -
|
|
| 163 |
---
|
| 164 |
|
| 165 |
## 7. Repository Contents
|
| 166 |
-
- `models/*.gguf` — All
|
| 167 |
-
- `start_miniindo.bat` — Windows CPU launcher (`127.0.0.1:8095`, `BelowNormal` priority).
|
| 168 |
-
- `test_escalation_bench.mjs` — 9-probe latency, `avg_lp`, and escalation routing benchmark script.
|
| 169 |
-
- `instruction.md` — Integration guide for connecting a Node.js WhatsApp bot to MiniIndo.
|
| 170 |
|
| 171 |
---
|
| 172 |
|
|
|
|
| 94 |
|
| 95 |
| Model File | Architecture | Params | GGUF Size | `llama-bench` (`pp256` / `tg64`) | Live Server (`avg_prompt` / `avg_gen`) | Live RAM | Best Use Case |
|
| 96 |
|---|---|---:|---:|---|---|---:|---|
|
| 97 |
+
| **`mini194m-v3-sft-q4_k_m.gguf`** *(Default)* | 24L Attention intact, FFN `2048`, 20k vocab | `194.15 M` | `134.59 MiB` | `37.00` / `13.83` tok/s | `23.61` / `9.62` tok/s | `246.2 MB` | **Best speed/accuracy balance** (`3–9s` chat latency on `1.5 GHz`; `64.3 tok/s` on Ryzen laptop). Use `lpCutoff = -0.95`. |
|
| 98 |
+
| **`mini194m-v3-sft-q8_0.gguf`** | 24L Attention intact, FFN `2048`, 20k vocab | `194.15 M` | `197.55 MiB` | — | — | `~290 MB` | Full 8-bit precision `MiniIndo-194M` for maximum stability. |
|
| 99 |
| **`mini376m-v3-sft-q4_k_m.gguf`** | 24L + FFN `4864` intact, 20k vocab | `375.82 M` | `253.92 MiB` | `6.88` / `4.92` tok/s | `16.00` / `7.16` tok/s | `394.6 MB` | **Maximum accuracy** (best 4-speaker WA summary, Python, RAM/SSD, math). Slower on dual-core `1.5 GHz`. Use `lpCutoff = -0.78`. |
|
| 100 |
| **`mini376m-v3-sft-q3_k_m.gguf`** | 24L + FFN `4864` intact, 20k vocab | `375.82 M` | `213.54 MiB` | `27.96` / `10.39` tok/s | — | `~340 MB` | Faster `Q3_K_M` option for `376M`. |
|
| 101 |
+
| **`mini101m-v3-sft-q4_k_m.gguf`** / **`q8_0.gguf`** | 14/24 Strided layers, FFN `1536`, 20k vocab | `101.45 M` | `73.04` / `103.6 MiB` | `63.55` / `26.85` tok/s | `47.78` / `21.62` tok/s | `155.3 MB` | **Ultra-fast escalation router** (`9/9` routing accuracy at `21.6 tok/s`). |
|
| 102 |
+
| **`mini66m-v3-sft-q4_k_m.gguf`** / **`q8_0.gguf`** | 8/24 Strided layers, FFN `1536`, 20k vocab | `65.65 M` | `49.74` / `66.6 MiB` | `124.43` / `43.64` tok/s | — | `~120 MB` | Ultra-light `>=64M` speed baseline (`43.6 tok/s`!). |
|
| 103 |
+
| `smol135-v3-sft-q4_k_m.gguf` / `q8_0.gguf` | `SmolLM2-135M-Instruct` trained on V3 corpus | `134.52 M` | `98.87` / `138.1 MiB` | `47.82` / `19.48` tok/s | — | `~190 MB` | External open-weights baseline comparator. |
|
| 104 |
|
| 105 |
---
|
| 106 |
|
|
|
|
| 115 |
```bash
|
| 116 |
llama-server -m models/mini194m-v3-sft-q4_k_m.gguf --host 127.0.0.1 --port 8095 --threads 2 --ctx-size 4096 -ngl 0
|
| 117 |
```
|
| 118 |
+
Once running, open **`http://127.0.0.1:8095`** in any browser for the built-in Chat UI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
### Node.js API Call with `logprobs` Escalation Gate
|
| 121 |
```js
|
|
|
|
| 158 |
---
|
| 159 |
|
| 160 |
## 7. Repository Contents
|
| 161 |
+
- `models/*.gguf` — All 10 quantized V3 models (`66M Q4/Q8`, `101M Q4/Q8`, `135M Q4/Q8`, `194M Q4/Q8`, `376M Q3_K_M/Q4_K_M`).
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
---
|
| 164 |
|
ai_vs_ai_20turns.mjs
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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); });
|
live_watch_bench.mjs
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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); });
|
models/mini101m-v3-sft-q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1e914003ab14bc5863561ad9176ecbb99587deb958cfc760d88e7207fe5bc68
|
| 3 |
+
size 108567200
|
models/mini194m-v3-sft-q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48c9be413d732f95a7a13fc4fffb6faddf281393ca90d951ba5242a643d584a7
|
| 3 |
+
size 207151488
|
models/mini66m-v3-sft-q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c32e37e73f16c2773318fab5ad6fc7de59411a28e806d8e23cc97b8af7cbe36
|
| 3 |
+
size 70473344
|
models/smol135-v3-sft-q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3a26914906e22b59426f58c8417231148dbfb229d0924863002bf3996265d777
|
| 3 |
+
size 144810944
|