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"
File size: 10,583 Bytes
8810586 1eb249d 8810586 1eb249d 8810586 1eb249d 8810586 1eb249d 8810586 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | ---
license: apache-2.0
language:
- id
- en
library_name: transformers
pipeline_tag: text-generation
base_model:
- Qwen/Qwen2.5-0.5B-Instruct
tags:
- indonesian
- gguf
- llama-cpp
- minitron
- knowledge-distillation
- compact-llm
- cpu-inference
- cloud-escalation
- artorialabs
---
# MiniIndo (`artorialabs/MiniIndo`)
**Created by:** **Nagisa Artoria** (`artorialabs`)
**MiniIndo** is a compact, CPU-first Indonesian LLM family (`66M` β `376M` parameters) engineered to run **100% locally on low-power CPUs** (tested live on `Intel Core i5-5200U` @ ~1.5 GHz, dual-core, no GPU) as a **fast, privacy-preserving first-responder** before escalating heavy, out-of-context, or real-time queries to Cloud AI.
---
## 1. End-to-End Architecture & Training Flow
```mermaid
flowchart TD
A["Raw Sources (ID Corpus + Sanitized WA Exports)"] -->|"Strict Privacy Scrubbing\n(Phones, URLs, Emails, Names -> Pseudonyms;\nNoisy Groups Excluded)"| B["Clean Pretrain & 540 WA Windows\n(0 PII Verified)"]
B -->|"Qwen3-4B-Instruct-2507 Synthesis\n+ Decontamination Filter"| C["Curated V3 SFT Dataset\n(14,234 samples, 0 Eval Leakage)"]
D["Qwen/Qwen2.5-0.5B-Instruct\n(494M, 151k Vocab)"] -->|"20k ID/EN Closed Vocab Slice\n(id_map.pt: 136M -> 17.9M Embeds)"| E{"Model Sizing Strategy"}
E -->|"Zero Weight Loss\n24L + FFN 4864 intact"| F1["MiniIndo-376M"]
E -->|"24L Attention Intact\nMinitron FFN 4864 -> 2048"| F2["MiniIndo-194M (Recommended)"]
E -->|"14/24 Strided Layers\nFFN 4864 -> 1536"| F3["MiniIndo-101M"]
E -->|"8/24 Strided Layers\nFFN 4864 -> 1536"| F4["MiniIndo-66M"]
F2 & F3 & F4 -->|"Stage 1: Top-64 Logit KL Healing\nTeacher: Qwen2.5-1.5B-Instruct\nseq 512 -> 1280"| G["Healed Backbones"]
F1 & G -->|"Stage 2: Curated Indonesian + WA SFT\n(Label Smoothing 0.05, Bucketed Batching)"| H["FP16 Checkpoints"]
H -->|"llama.cpp convert + quantize\n(Q4_K_M / Q3_K_M)"| I["GGUF Release Bundle\n(models/*.gguf)"]
```
---
## 2. How MiniIndo Works at Runtime (Local-First -> Cloud Escalation)
MiniIndo is designed as **Layer 1 (Local CPU)** in a hybrid **Local -> Cloud** routing pipeline:
```mermaid
flowchart LR
U["User / WhatsApp Message"] --> G{"Rule / Casual Gate\n(Exact Greetings / Shortcuts)"}
G -->|"Hit"| R1["Instant Rule Reply (0ms)"]
G -->|"Miss & Text/Context Eligible"| M["MiniIndo Local Server\n(127.0.0.1:8095, logprobs=true)"]
M --> C{"Dual Escalation Check"}
C -->|"Contains [ESKALASI_CLOUD]\nOR avg_logprob < threshold\nOR Timeout / Offline"| CL["Fallback to Cloud AI Agent\n(Full Tools / Web / Reasoning)"]
C -->|"Confident Local Answer"| R2["Reply Directly from Local CPU\n(Zero Cloud Cost, High Privacy)"]
```
### Dual Escalation Mechanism
Instead of relying solely on a prompt or solely on confidence scores, MiniIndo combines **two independent signals**:
1. **Explicit `[ESKALASI_CLOUD]` Token Contract:** During SFT, the model is trained on both *in-context answerable* WhatsApp snippets and *out-of-context / impossible / real-time* traps (`[ESKALASI_CLOUD] ...`) so it explicitly admits when context is missing.
2. **Token `logprobs` Uncertainty Cutoff (`avg_lp`):** Whenever `llama-server` returns `logprobs: true`, the caller computes the mean per-token log-probability (`avg_lp`) of the generated response. If `avg_lp` falls below the calibrated threshold (`-0.95` for `194M`, `-0.78` for `376M`), hallucinations are caught automatically and routed to Cloud AI.
---
## 3. Training Methodology & Key Design Choices
### A. Privacy-First Data Curation (`0` PII, `0` Benchmark Contamination)
- **Strict Sanitization:** Every chat export line was scrubbed to strip phone numbers, emails, URLs, `@mentions`, and real participant names (replaced deterministically with neutral pseudonyms). Noisy/spam chat groups were completely excluded.
- **WA Q&A Synthesis:** `Qwen/Qwen3-4B-Instruct-2507` processed **538/540** sanitized chat windows to produce grounded Indonesian Q&A (`q_in`/`a_in`), concise group summaries (`a_sum`), and out-of-context escalation drills (`q_out`), alongside synthetic multi-speaker attribution drills so attention heads learn to read *who said what* rather than memorizing name priors.
- **Clean Knowledge Mix (`14,234` rows):** Combined curated Indonesian Q&A, Python/tech explanations, multi-unit arithmetic word problems, casual Indonesian conversation, and long-context needle-in-a-haystack examples β with an automated blocklist preventing any evaluation probe leakage.
### B. Vocabulary Compression (`151,936 -> 20,000` Tokens)
- `Qwen2.5-0.5B-Instruct` spends **136.1M parameters** (`~27%` of the entire model) on a 151k multilingual vocabulary full of CJK/Arabic/Cyrillic/rare tokens unused in Indonesian + English.
- By extracting the **20,000 most relevant Indonesian/English/code BPE tokens** and remapping `embed_tokens` + `lm_head` 1:1 (`id_map.pt`), embedding size drops to **17.92M parameters** while keeping exact Qwen2.5 tokenization semantics.
### C. Why Attention-Intact Width Pruning (`194M`) Beat Aggressive Layer-Dropping (`66M`/`101M`)
- Dropping `10β16` out of `24` layers in one shot breaks transformer residual-stream alignment and destroys factual weights, requiring billions of recovery tokens.
- Keeping **all 24 attention layers untouched** and pruning only redundant SwiGLU FFN channels (`4864 -> 2048` via activation Γ weight L2 saliency) yielded **`MiniIndo-194M`**, which healed smoothly down to `KL = 0.42β0.67` in just 600 distillation steps against `Qwen/Qwen2.5-1.5B-Instruct` (Top-64 logits, `T=2.0`, `Ξ±=0.75`).
- Removing noisy DPO and using **label-smoothed SFT (`label_smoothing=0.05`)** with length-bucketed batching eliminated repetitive token collapse while preserving fluency.
---
## 4. Variants & Live Benchmarks (`Intel Core i5-5200U` @ ~1.5 GHz, `-t 2`, `BelowNormal`)
All speeds and RAM numbers below were **measured directly on a dual-core Windows CPU server (`i5-5200U`)** with background services (MetaTrader 5, PM2) running concurrently:
| Model File | Architecture | Params | GGUF Size | `llama-bench` (`pp256` / `tg64`) | Live Server (`avg_prompt` / `avg_gen`) | Live RAM | Best Use Case |
|---|---|---:|---:|---|---|---:|---|
| **`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`. |
| **`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. |
| **`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`. |
| **`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`. |
| **`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`). |
| **`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`!). |
| `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. |
---
## 5. Quick Start (`llama.cpp`)
### System Prompt
```text
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].
```
### Run OpenAI-Compatible Server (Windows / Linux)
```bash
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
```
Once running, open **`http://127.0.0.1:8095`** in any browser for the built-in Chat UI.
### Node.js API Call with `logprobs` Escalation Gate
```js
const SYS_PROMPT =
'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].';
const res = await fetch('http://127.0.0.1:8095/v1/chat/completions', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
messages: [
{ role: 'system', content: SYS_PROMPT },
{ role: 'user', content: 'gw pesen 3 martabak manis satunya 32rb, total bayarnya berapa?' },
],
temperature: 0.25,
top_p: 0.9,
repeat_penalty: 1.08,
max_tokens: 180,
logprobs: true,
}),
});
const data = await res.json();
const reply = (data.choices?.[0]?.message?.content || '').trim();
const lps = (data.choices?.[0]?.logprobs?.content || []).map(x => x.logprob).filter(Number.isFinite);
const avgLp = lps.length ? lps.reduce((a, b) => a + b, 0) / lps.length : -99;
// Escalate to Cloud AI when explicitly tagged or uncertain
const shouldEscalate = !reply || reply.includes('[ESKALASI_CLOUD]') || avgLp < -0.95;
```
---
## 6. Operational Recommendations for Compact Models (`194M`)
- **Prefer single-turn / focused context:** Passing a concise chat snippet + single question gives sharper results than accumulating long multi-topic conversation histories.
- **Always keep Cloud Fallback enabled:** MiniIndo is built to absorb high-frequency casual chat, short WA Q&A, and basic facts locally (`0` API cost) while failing safely to Cloud AI on multi-step reasoning, real-time prices/news, or complex coding.
---
## 7. Repository Contents
- `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`).
---
## Author & Attribution
Created, trained, and benchmarked by **Nagisa Artoria** for **artorialabs**.
|