Instructions to use eulogik/Bharat-Tiny-LLM-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eulogik/Bharat-Tiny-LLM-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="eulogik/Bharat-Tiny-LLM-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("eulogik/Bharat-Tiny-LLM-v2") model = AutoModelForCausalLM.from_pretrained("eulogik/Bharat-Tiny-LLM-v2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use eulogik/Bharat-Tiny-LLM-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "eulogik/Bharat-Tiny-LLM-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eulogik/Bharat-Tiny-LLM-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/eulogik/Bharat-Tiny-LLM-v2
- SGLang
How to use eulogik/Bharat-Tiny-LLM-v2 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 "eulogik/Bharat-Tiny-LLM-v2" \ --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": "eulogik/Bharat-Tiny-LLM-v2", "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 "eulogik/Bharat-Tiny-LLM-v2" \ --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": "eulogik/Bharat-Tiny-LLM-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use eulogik/Bharat-Tiny-LLM-v2 with Docker Model Runner:
docker model run hf.co/eulogik/Bharat-Tiny-LLM-v2
🇮🇳 Bharat-Tiny-LLM v2 (PyTorch / Transformers Base)
1.5B Parameter Open-Weights Indic LLM featuring Brahmi Token Injection for 33.8% token compression and +36% faster Hindi inference.
🎯 Model Overview
Bharat-Tiny-LLM v2 is an open-weights 1.5B parameter language model built on top of Qwen2.5-1.5B, optimized specifically for Hindi and Hinglish text generation.
By introducing Brahmi Token Injection — a technique that surgically injects 300 Devanagari subword tokens into the model's vocabulary — Bharat-Tiny-LLM v2 eliminates the severe "Token Tax" imposed by standard English-centric tokenizers on Indian scripts.
This repository contains the unquantized PyTorch / HuggingFace Transformers open weights, compatible with Linux, Windows, CUDA GPUs, vLLM, TGI, and Google Colab.
🎨 Architectural Pipeline & Training Methodology
Interactive Training Pipeline Flowchart
flowchart LR
A["Raw Hindi Corpus"] --> B["Brahmi Subword Mining<br>(Top 300 Devanagari Tokens)"]
B --> C["Tokenizer Vocabulary Expansion<br>(151,936 ➔ 152,236)"]
C --> D["Stage 1: Embedding Alignment<br>(Freeze Backbone, Train 300 Embeddings)"]
D --> E["Stage 2: LoRA Fine-Tuning<br>(Rank=16 on Attention q,k,v,o proj)"]
E --> F["Fused PyTorch Base Weights<br>(eulogik/Bharat-Tiny-LLM-v2)"]
F --> G["Q4 Affine Quantization<br>(eulogik/Bharat-Tiny-LLM-v2-MLX)"]
✨ Key Benchmarks & Technical Advantages
| Metric | Base Qwen2.5-1.5B | Bharat-Tiny-LLM v2 | Technical Advantage |
|---|---|---|---|
| Tokens for 1,000 Hindi Chars | ~950 tokens | ~630 tokens | 33.8% Fewer Tokens (up to 58% on chat prompts) |
| Inference Throughput (Hindi) | 50 tok/s | 68 tok/s | +36% Speed Boost |
| Validation Loss (Hindi Corpus) | 2.776 | 1.837 | 52.5% Loss Reduction (Perplexity: 16.1 → 6.3) |
| Hardware Compatibility | CUDA / CPU / MPS | CUDA / CPU / MPS | Universal PyTorch / vLLM / GGUF support |
🚀 Quick Start with PyTorch & Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "eulogik/Bharat-Tiny-LLM-v2"
# Load Tokenizer & Model Weights
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
# Generate Hindi Text
prompt = "भारत की सांस्कृतिक विविधता के बारे में बताइए:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=150,
temperature=0.7,
do_sample=True
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
📊 Token Compression Benchmarks
| Prompt (Hindi / Hinglish) | Base Qwen Tokens | Bharat-v2 Tokens | Savings |
|---|---|---|---|
"ज़रूरी बात है क्या करते हो" |
26 tokens | 11 tokens | 58% Savings |
"नमस्ते, आप कैसे हैं?" |
15 tokens | 7 tokens | 53% Savings |
"भारत की राजधानी नई दिल्ली है" |
22 tokens | 14 tokens | 36% Savings |
"bhai aaj ka weather kaisa hai?" |
12 tokens | 8 tokens | 33% Savings |
🔗 Model Family Repositories
- Apple Silicon MLX Quantized (880MB):
eulogik/Bharat-Tiny-LLM-v2-MLX - GGUF / llama.cpp:
eulogik/Bharat-Tiny-LLM-GGUF
📜 License & Citation
Licensed under Apache 2.0. Free for commercial, enterprise, and research use.
@misc{kishore2026brahmi,
title={Brahmi: Efficient Devanagari Token Injection for Multilingual LLMs},
author={Gautam Kishore},
year={2026},
publisher={eulogik},
howpublished={\url{https://huggingface.co/eulogik/Bharat-Tiny-LLM-v2}}
}
- Downloads last month
- 45

