Instructions to use eulogik/Bharat-Tiny-LLM-v2-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use eulogik/Bharat-Tiny-LLM-v2-MLX with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("eulogik/Bharat-Tiny-LLM-v2-MLX") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use eulogik/Bharat-Tiny-LLM-v2-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "eulogik/Bharat-Tiny-LLM-v2-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "eulogik/Bharat-Tiny-LLM-v2-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use eulogik/Bharat-Tiny-LLM-v2-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "eulogik/Bharat-Tiny-LLM-v2-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "eulogik/Bharat-Tiny-LLM-v2-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eulogik/Bharat-Tiny-LLM-v2-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use eulogik/Bharat-Tiny-LLM-v2-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "eulogik/Bharat-Tiny-LLM-v2-MLX"
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:8080/v1 hermes config set model.default eulogik/Bharat-Tiny-LLM-v2-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use eulogik/Bharat-Tiny-LLM-v2-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "eulogik/Bharat-Tiny-LLM-v2-MLX"
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:8080/v1 \ --custom-model-id "eulogik/Bharat-Tiny-LLM-v2-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
๐ฎ๐ณ Bharat-Tiny-LLM v2 โ MLX
1.5B Hindi/Hinglish LLM with Brahmi token injection. 880 MB, fully offline on Apple Silicon.
โจ What is Brahmi injection?
300 high-frequency Devanagari subword tokens injected into the Qwen2.5 tokenizer (+0.2% vocab), embeddings initialized as the mean of constituent byte tokens, recovered with embedding warmup + LoRA.
Measured benchmarks (held-out data; methodology)
| Metric | Base Qwen2.5-1.5B | v2 | ฮ |
|---|---|---|---|
| Tokens / 1000 Devanagari chars | 1041.9 | 661.6 | โ36.5% |
| Tokens / 1000 chars (mixed Hinglish+Hindi) | 593.3 | 486.6 | โ18.0% |
| Bits / char (held-out Hindi, fair protocol) | 1.6531 | 1.4878 | โ10.0% |
| Warmup val loss (injected rows) | 2.776 | 1.320 | โ52.5% |
End-to-end savings are lower than script-only because Latin/Hinglish spans gain nothing from Devanagari tokens.
๐ Quick Start
The easy way โ bharat CLI
pip install "bharat-tiny-llm[mlx]"
bharat chat # interactive Hindi/Hinglish REPL, works offline
bharat ask "เคจเคฎเคธเฅเคคเฅ!"
Python
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load(
"eulogik/Bharat-Tiny-LLM-v2-MLX",
adapter_path="eulogik/Bharat-Tiny-LLM-v2-MLX", # see note below
)
The LoRA adapter ships in the lora_adapter/ folder of this repo. mlx_lm.load
needs a local directory for adapters โ easiest is:
from huggingface_hub import snapshot_download
adir = snapshot_download("eulogik/Bharat-Tiny-LLM-v2-MLX",
allow_patterns=["lora_adapter/*"]) + "/lora_adapter"
model, tokenizer = load("eulogik/Bharat-Tiny-LLM-v2-MLX", adapter_path=adir)
sampler = make_sampler(temp=0.3)
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "Chai peete hain?"}],
tokenize=False, add_generation_prompt=True,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=128, sampler=sampler))
โ ๏ธ Important usage notes
- No system prompts โ v2 was trained without system turns; adding one degrades output.
- Use temp โค 0.3 with top-p 0.85 and repetition penalty โฅ 1.2. Higher temperatures produce garbled out-of-script tokens.
- Adapter required โ the base expanded model without the LoRA adapter generates poorly.
- Adapter fixed Aug 24, 2026: if you downloaded earlier, re-pull
lora_adapter/.
๐ฏ Training
| Phase | Params | Hardware | Result |
|---|---|---|---|
| Embedding warmup (300 rows) | 614K (0.04%) | Colab T4, 3K steps | val 2.776 โ 1.320 |
| LoRA (rank 8, scale 20, 16 layers) | ~5M | Mac Mini M4, 500 steps โ 35 min | val 1.837 @ step 400 |
๐ License & attribution
Apache 2.0. Base: Qwen2.5-1.5B ยฉ Alibaba Cloud, Apache 2.0. Built by eulogik ยท GitHub ยท PyPI
Citation
@techreport{kishore2026brahmilite,
title={Brahmi-Lite: Minimal-Budget Devanagari Token Injection for Edge LLMs},
author={Gautam Kishore},
year={2026},
institution={eulogik},
url={https://github.com/eulogik/Bharat-Tiny-LLM}
}
- Downloads last month
- 74
4-bit