Instructions to use akal-lm/Akal-Rerank-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use akal-lm/Akal-Rerank-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible embeddings server: llama serve -hf akal-lm/Akal-Rerank-GGUF:Q4_K_M --embeddings
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible embeddings server: llama serve -hf akal-lm/Akal-Rerank-GGUF:Q4_K_M --embeddings
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 embeddings server: ./build/bin/llama serve -hf akal-lm/Akal-Rerank-GGUF:Q4_K_M --embeddings
- Llama new
- LM Studio
- Jan
- Ollama
How to use akal-lm/Akal-Rerank-GGUF with Ollama:
ollama run hf.co/akal-lm/Akal-Rerank-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use akal-lm/Akal-Rerank-GGUF with Docker Model Runner:
docker model run hf.co/akal-lm/Akal-Rerank-GGUF:Q4_K_M
- Lemonade
How to use akal-lm/Akal-Rerank-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull akal-lm/Akal-Rerank-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Akal-Rerank-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
- ๐ฏ Akal-Rerank: High-Precision Edge CPU Cross-Encoder Reranker & Abstention Gate (GGUF Edition)
- ๐ฏ Why Add a Cross-Encoder Reranker to Edge RAG?
- ๐ Empirical Benchmarks (Intel Core i5-8250U, 4 Threads, Pure CPU)
- ๐ฏ Intended Use & Capability Boundaries
- ๐ Usage (
llama.cppCLI) - ๐ฎ Coming Soon: Next-Gen Akal Decision Model (From Reranking to Single-Pass Intelligence)
- ๐ฆ Files in this Repository
- ๐ Citation
- ๐ฏ Why Add a Cross-Encoder Reranker to Edge RAG?
๐ฏ Akal-Rerank: High-Precision Edge CPU Cross-Encoder Reranker & Abstention Gate (GGUF Edition)
Akal-Rerank (akal-rerank-indo-q4_k_m.gguf, 119 MB & akal-rerank-indo-q8_0.gguf, 126 MB) is an ultra-compact Cross-Encoder Reranker (pooling=RANK) engineered for Stage-2 precision filtering and epistemic abstention gating in offline Retrieval-Augmented Generation (RAG) pipelines on GPU-less edge CPUs.
Built upon madebyaris/rerank-indonesia (12-layer XLM-RoBERTa sequence classifier, 118M parameters) and calibrated with a Contrastive Indonesian Query-Passage Importance Matrix (imatrix_rerank_indo_id.dat), Akal-Rerank-Indo reduces disk size by 73.5%, cuts Peak RAM up to 53.9% (550 MB vs 1,209 MB PyTorch FP32), and accelerates cold-start CLI execution by 3.35ร (2.21s vs 7.41s) while preserving 0.9993โ0.9999 Pearson logit correlation with FP32.
- Developer / Researcher: Muhammad Luqni Baehaqi (@luqni โข mluqnibaehaqi@gmail.com)
- Organization: Akal LM Initiative (
akal-lm) - Companion Stage-1 Retriever:
akal-lm/Akal-Embed-GGUF - Companion Generator LLM:
akal-lm/Akal-1B-GGUF - Research Preprint (Vol. 3): ๐ Download Akal_Vol3_Architecture_Research_Paper.pdf (CC-BY 4.0)
๐ฏ Why Add a Cross-Encoder Reranker to Edge RAG?
While bi-encoder dense embeddings (Akal-Embed-Indo) compress queries and passages into separate 384-dimensional vectors for fast sub-15ms candidate search, two classic challenges arise in complex enterprise RAG:
- Fine-Grained Near-Duplicate Confusers: Documents with nearly identical vocabulary (e.g., SOP Pencucian Kasur Harian Pad Merah vs SOP Pemolesan Akhir Pad Putih) require token-by-token cross-attention across
(query, passage)pairs to resolve subtle factual distinctions. - Pre-LLM Epistemic Abstention Gate: Bi-encoder cosine similarity exhibits a narrow dynamic range on unanswerable queries (
AUROC 86.97%). By evaluating the maximum cross-encoder logit score ($\max_i s_{\text{rerank}}(q, d_i) < \tau$), Akal-Rerank acts as a 99.85% AUROC (99.09% Balanced Accuracy) Abstention Gateโintercepting out-of-domain or false-premise queries before invoking the 1B LLM generator!
๐ Empirical Benchmarks (Intel Core i5-8250U, 4 Threads, Pure CPU)
1. Indonesian Domain Hard-Negative & Abstention Benchmark
Evaluated on 65 multi-domain Indonesian documents (including 25 near-duplicate confusers) across 67 queries (55 answerable + 12 unanswerable trap queries), reranking the Top-10 candidates retrieved by Akal-Embed-Indo Q4_K_M:
| Model Variant | Format / Precision | Disk Size | Peak RAM | Hit@1 (Stage-1 $\rightarrow$ Stage-2) | MRR@10 | Abstention AUROC (โ) | Abstention Bal. Acc (โ) | Pearson vs FP32 | Top-1 Agreement |
|---|---|---|---|---|---|---|---|---|---|
| (Stage-1 Bi-Encoder Alone) | Akal-Embed-Indo Q4_K_M |
119.0 MB | 515.8 MB | 96.36% | 98.18% | 86.97% | 87.12% | โ | โ |
| Akal-Rerank-Indo Q4_K_M (Ours) | GGUF Q4_K_M (+imatrix ID) | 119.1 MB | 550.3 MB | 96.36% $\rightarrow$ 100.0% | 100.0% | 99.85% | 99.09% ($\tau=4.48$) | 0.999301 | 100.0% |
| Akal-Rerank-Indo Q8_0 (Ours) | GGUF Q8_0 | 126.4 MB | 547.1 MB | 96.36% $\rightarrow$ 100.0% | 100.0% | 99.70% | 98.18% ($\tau=4.98$) | 0.999962 | 100.0% |
rerank-indonesia (Un-calibrated) |
GGUF Q4_K_M (No imatrix) | 119.1 MB | 550.3 MB | 96.36% $\rightarrow$ 100.0% | 100.0% | 99.70% | 98.18% | 0.998995 | 100.0% |
rerank-indonesia (Base Reference) |
PyTorch FP32 | 448.8 MB | 942.6 MB | 96.36% $\rightarrow$ 100.0% | 100.0% | 99.70% | 98.18% | 1.000000 | 100.0% |
mMiniLMv2-L12-mMARCO |
GGUF Q4_K_M (+imatrix ID) | 119.1 MB | 550.2 MB | 96.36% $\rightarrow$ 100.0% | 100.0% | 99.85% | 99.09% | 0.998901 | 100.0% |
2. MIRACL Indonesian Open-Domain Benchmark (mteb/MIRACLReranking id dev)
Evaluated on 150 Indonesian Wikipedia queries $\times$ Top-20 candidates (3,000 query-passage pairs, 362,963 tokens) filtered from 15,000 passages by Akal-Embed-Indo Q4_K_M:
| Model Variant | Disk Size | Peak RAM (RSS) | Hit@1 (Stage-1 $\rightarrow$ Stage-2) | Hit@3 | MRR@10 | nDCG@10 | Pearson vs FP32 | Top-1 Agreement vs FP32 | Throughput |
|---|---|---|---|---|---|---|---|---|---|
| (Stage-1 Bi-Encoder Alone) | 119.0 MB | 515.8 MB | 60.00% | 80.67% | 70.51% | 60.44% | โ | โ | โ |
| Akal-Rerank-Indo Q8_0 (Ours) | 126.4 MB | 558.3 MB | 60.00% $\rightarrow$ 68.67% (+8.67) | 82.67% | 76.54% (+6.03) | 66.69% (+6.25) | 0.999929 | 99.33% | 1,351 tok/s |
| Akal-Rerank-Indo Q4_K_M (+imatrix) | 119.1 MB | 556.8 MB | 60.00% $\rightarrow$ 68.00% (+8.00) | 84.00% (+3.33) | 76.23% (+5.72) | 66.41% (+5.97) | 0.998435 | 98.67% | 1,255 tok/s |
rerank-indonesia Q4_K_M (No imatrix) |
119.1 MB | 557.6 MB | 60.00% $\rightarrow$ 68.00% (+8.00) | 83.33% | 76.35% | 66.77% | 0.997963 | 97.33% | 1,258 tok/s |
rerank-indonesia FP32 (PyTorch) |
448.8 MB | 1,208.7 MB | 60.00% $\rightarrow$ 68.67% (+8.67) | 82.67% | 76.59% | 66.71% | 1.000000 | 100.00% | 1,278 tok/s |
mMiniLMv2-L12-mMARCO Q4_K_M (+imatrix) |
119.1 MB | 557.7 MB | 60.00% $\rightarrow$ 58.67% (-1.33) | 79.33% | 69.85% (-0.66) | 61.93% | โ | โ | 1,256 tok/s |
mMiniLMv2-L12-mMARCO Q8_0 |
126.4 MB | 558.6 MB | 60.00% $\rightarrow$ 58.00% (-2.00) | 80.67% | 69.65% (-0.86) | 61.46% | โ | โ | 1,359 tok/s |
๐ฌ Key Scientific Finding โ The Multilingual Reranker Degradation Phenomenon:
Pairing a specialized Indonesian bi-encoder (Akal-Embed-Indo) with a generic multilingual cross-encoder (mMiniLMv2-L12-mMARCO) actually degrades Hit@1 on MIRACL-ID from 60.00% down to 58.00%โ58.67% because the generic cross-encoder lacks fine-grained Indonesian morphological calibration. Conversely, Akal-Rerank-Indo boosts Hit@1 to 68.00%โ68.67% (+8.0โ8.7 points) and MRR@10 to 76.23%โ76.54% (+5.7โ6.0 points). Furthermore, calibratingQ4_K_Mwithimatrix_rerank_indo_id.datcuts Top-1 ranking disagreement against FP32 in half (98.67% vs 97.33% Top-1 agreement across 150 MIRACL queries).
๐ฏ Intended Use & Capability Boundaries
- Recommended Top-K Budget on CPU: Cross-encoders jointly attend to
(query + passage)tokens, costing50โ60 ms per candidate document on a 4-core laptop CPU (`270โ300 msfor Top-5 candidates,550โ600 ms15 ms) and reranking those Top-5 withfor Top-10). For interactive chat on CPU, we recommend retrieving **Top-5 candidates** withAkal-Embed-Indo` (Akal-Rerank-Indo(~280 ms) before passing the winning Top-2 passages toAkal-1B-Steered. - Abstention Threshold ($\tau \approx 4.48$): If the highest reranker logit score among all retrieved candidates falls below
4.48, the application can immediately return a polite abstention response ("Maaf, informasi tersebut tidak ditemukan dalam dokumen rujukan") in< 300 mswithout running the LLM generator at all!
๐ Usage (llama.cpp CLI)
Pass query\tpassage pairs separated by <#sep#> using --pooling rank:
./llama-embedding -m akal-rerank-indo-q4_k_m.gguf \
-p "Berapa batas waktu pelaporan kebocoran data menurut UU PDP?\tBerdasarkan UU No. 27 Tahun 2022, pengendali data wajib melapor paling lambat 3x24 jam (72 jam).<#sep#>Berapa batas waktu pelaporan kebocoran data menurut UU PDP?\tStandar enkripsi komunikasi server wajib menggunakan protokol TLS 1.3 dan AES-256." \
--embd-separator "<#sep#>" \
--pooling rank \
--embd-normalize -1 \
--embd-output-format array \
-t 4
๐ฎ Coming Soon: Next-Gen Akal Decision Model (From Reranking to Single-Pass Intelligence)
Building upon the cross-encoder and scoring foundations established in Akal-Rerank-Indo, our next milestone expands beyond candidate scoring into a full System-1 Probabilistic Decision Engine (inspired by Jev & Laya, but specialized for low-spec edge CPUs):
- Single-Pass Inference: Instant classification, intent routing, and tool selection in a single forward pass without autoregressive token generation.
- Primitive Decisions:
Choice(multi-class routing),Score(calibrated probabilities), andBoolean / Abstain Gate. - Low-End Hardware First: Sub-10ms pure CPU latency, < 120 MB disk size, < 200 MB RSS RAM, zero GPU dependency.
Stay tuned via the Akal LM Initiative!
๐ฆ Files in this Repository
akal-rerank-indo-q4_k_m.gguf(119 MB): Primary 4-bit Indonesian Cross-Encoder Reranker calibrated withimatrix_rerank_indo_id.dat(99.85% Abstention AUROC, 98.67%โ100% Top-1 agreement vs FP32).akal-rerank-indo-q8_0.gguf(126 MB): 8-bit High-Precision edition (0.99993โ0.99996 Pearson correlation vs FP32, 68.67% MIRACL Hit@1).imatrix_rerank_indo_id.dat(348 KB): Contrastive Indonesian query-passage activation importance matrix.Akal_Vol3_Architecture_Research_Paper.pdf: Full bilingual research preprint (Vol. 3).
๐ Citation
@article{baehaqi2026akalvol3,
title={Pre-Quantization Weight-Space Surgery, Hybrid Speculative Decoding, and Cross-Encoder Reranking for Sovereign Edge RAG Systems on GPU-less CPUs},
author={Baehaqi, Muhammad Luqni},
journal={Akal LM Research Preprint Series},
volume={3},
year={2026},
publisher={Akal LM Initiative (akal-lm)}
}
- Downloads last month
- 214
4-bit
8-bit