About Us Advertise Careers Contact Us Privacy Policy Community Guidelines
Locating… 13°C English WhatsApp Alerts Email Alerts
BREAKING NEWS
Poker Dream 27 Sri Lanka Early Bird Packages Back After Four-Day Sellout - PokerNews Pakistan romps to eight-wicket win over Sri Lanka for its first test cricket series win in 2 years - Oskaloosa Herald Sri Lanka Raises Policy Rate to Ensure Inflation Reaches Target - Bloomberg.com Better together: How two metals and one ink are reshaping printed energy storage - Tech Xplore Open-source microcontroller combines sensing, storage and wireless tools for wearables and robots - Tech Xplore Six-inch robot could inspect nuclear waste pipes beyond reach of conventional cameras - Tech Xplore Harvesting electricity from prickly pear cacti - Tech Xplore Extreme rainfalls flood Sri Lanka’s coastal city as wetlands, drains vanish - news - Mongabay Asia Specific | Why a Sri Lankan woman feels stuck in paradise - BBC Better Diets & Nutrition Webinar Series Session 4: End-to-End Solutions for Healthier Diets: Insights from Sri Lanka - IFPRI
SRI LANKA NEWS

lanka-rag added to PyPI

Lanka Hit News • Nov 16, 2026 · 5d ago • 4 min read
Share:

Local-first Sinhala/Tamil RAG with Ollama + LangChain, and a retrieval benchmark of embedding models on Sinhala, Tamil and Singlish.

pip install lanka-rag Copy PIP instructions

Sinhala embedding benchmark · Tamil retrieval · Singlish · local RAG for Sri Lanka · සිංහල · தமிழ்

Which embedding model actually understands Sinhala? This repo has a reproducible retrieval benchmark for Sinhala, Tamil and Singlish (romanized Sinhala), plus a local-first RAG assistant for Sri Lankan documents built with LangChain and Ollama. Everything runs on a laptop with no API keys.

Eight Ollama embedding models and two BM25 baselines, nine tasks, 900 questions each, on an Apple M1 with 8 GB of RAM.

Two notes on fairness: paraphrase-multilingual reads at most 128 tokens, so it sees only the start of long Sinhala passages, and the speed column was measured with nothing else running on the machine. No model hit its context limit on these passages (checked in the Ollama logs).

nDCG@10 (higher is better; best per column in bold). "Sinhala avg" averages every task with Sinhala on either side.

† English-centric model, included as a control.

Recall@1 / Recall@10 on the three monolingual tasks, plus 95% bootstrap CI of nDCG@10 for si→si:

Raw per-query ranks for every model are in results/raw/ , so you can run your own error analysis or significance tests.

Sinhala has very little retrieval evaluation data. Belebele (Meta, CC BY-SA 4.0) has 900 human-written questions over 488 passages, and the same questions and passages exist in Sinhala script, romanized Sinhala, Tamil and English. Since every language is aligned by passage, one dataset gives nine tasks with identical relevance labels:

Each query has exactly one relevant passage. Metrics: nDCG@10 (main), MRR@10 and Recall@1/5/10, with 95% bootstrap confidence intervals.

MTEB already has a BelebeleRetrieval task. This benchmark adds the Singlish, ZWJ-robustness and Tamil↔Sinhala tasks, local models you can actually run through Ollama, the exact prompt format each model expects ( models.py ), and lexical baselines that handle Sinhala correctly.

Needs Ollama . To use the CLI and the library, install from PyPI:

To reproduce the benchmark or run the Acts demo, clone the repo and use uv :

--pull downloads missing Ollama models and --rm-after deletes them again after scoring (handy on a small disk). Embeddings are cached in .cache/ , so you can rerun the report for free. uv run lanka-rag bench models lists every model and the prompts it uses. Hugging Face models (multilingual-e5, LaBSE) need uv sync --extra hf .

The demo corpus is 1,010 hand-corrected pages of Sri Lankan Acts (1981–2019) in Sinhala, from sinhala-ocr-lk-acts-1010 (CC BY 4.0). Drop your own PDFs, .txt , .md or .html files into docs/ the same way.

Retrieval is hybrid: dense embeddings plus character n-gram BM25, fused with reciprocal rank fusion ( rag/store.py ). BM25 only scores chunks in the question's language, because across languages it matches on numbers and stray Latin letters and adds noise. The answer comes from a local Ollama chat model (default qwen3:4b-instruct-2507-q4_K_M , change it with --llm ). It answers in the language of the question and cites the passages it used.

New models, Sinhala/Tamil test sets and bug reports are welcome. The quickest useful contribution is benchmarking a model that is not in the table: see CONTRIBUTING.md , or open a model request .

If you use the benchmark or its results, please cite this repository (GitHub's "Cite this repository" button uses CITATION.cff ) and the Belebele paper.

Code: MIT. Belebele: CC BY-SA 4.0 (Bandarkar et al., 2023), downloaded at runtime and not redistributed. Sri Lankan Acts transcriptions: CC BY 4.0 (avishadilhara). Results files in results/ contain only scores and passage ids.

Both files in this release have provenance metadata.

benchmark embeddings langchain low-resource-languages multilingual nlp ollama rag retrieval singlish sinhala sri-lanka tamil

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation .

Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Both files in this release have been uploaded with provenance metadata.

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation .

Nov 16, 2026 2 release files Full provenance

Developed and maintained by the Python Software Foundation and Python community, for the Python community.

Join the Conversation