Instructions to use viczx/IndicMaxxer-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use viczx/IndicMaxxer-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="viczx/IndicMaxxer-2B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("viczx/IndicMaxxer-2B") model = AutoModelForCausalLM.from_pretrained("viczx/IndicMaxxer-2B", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use viczx/IndicMaxxer-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "viczx/IndicMaxxer-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "viczx/IndicMaxxer-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/viczx/IndicMaxxer-2B
- SGLang
How to use viczx/IndicMaxxer-2B 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 "viczx/IndicMaxxer-2B" \ --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": "viczx/IndicMaxxer-2B", "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 "viczx/IndicMaxxer-2B" \ --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": "viczx/IndicMaxxer-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use viczx/IndicMaxxer-2B with Docker Model Runner:
docker model run hf.co/viczx/IndicMaxxer-2B
🟢 IndicMaxxer-2B
Your language, your machine. A 2B Indian-language assistant that cuts the token tax on Kannada, Hindi, Kanglish and Hinglish, and runs on a 4 GB laptop GPU.
ಕನ್ನಡ · हिंदी · English · Kanglish · Hinglish
Why
Indian languages pay a token tax: the same sentence costs many more tokens than in English. More tokens mean a higher bill, slower replies and less room in the context window. Romanised Indian text (Kanglish, Hinglish), which is how most people actually type, is taxed the hardest.
IndicMaxxer-2B is Sarvam-1 (2B) with our tokenizer fused into it, fine-tuned to chat in five styles without mixing them, to reason in your own language, and to call simple tools.
What's different from stock Sarvam-1
| Sarvam-1 | IndicMaxxer-2B | |
|---|---|---|
| Vocabulary | 68,096 | 71,892 (+3,792 fused whole-word tokens) |
| Hinglish tokens / word | 2.65 | 1.99 (−25.0%) |
| Kanglish tokens / word | 4.07 | 3.23 (−20.5%) |
| Kannada tokens / word | 2.54 | 2.43 (−4.3%) |
| Hindi tokens / word | 1.47 | 1.45 (−1.2%) |
| English tokens / word | 1.67 | 1.67 (unchanged) |
| Chat format | base model | ChatML chat, /instruct and /reasoning modes |
| Identity | — | IndicMaxxer, keeps to the user's language and script |
Tokens per word measured on held-out text per style, before vs after fusion.
How the fusion works
frequent word in our 5-style corpus
└─ Sarvam splits it into ≥ 3 pieces, our 48K tokenizer into fewer?
└─ add " word" as ONE new token
└─ new embedding = mean of the Sarvam pieces it replaces
└─ keep only if tokens/word goes DOWN on held-out text (never pay a tax increase)
Examples of fused tokens: nanagè, naanu, maahitiyannu, mujhe, liye, kiya, ಗೊತ್ತಿಲ್ಲ, ದಯವಿಟ್ಟು, बताइए, ज़्यादा.
Quick start
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "viczx/IndicMaxxer-2B"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.float16, device_map="auto")
msgs = [
{"role": "system", "content": "You are IndicMaxxer. The user writes Hinglish: reply in Hinglish only."},
{"role": "user", "content": "kal interview hai, kuch tips do /instruct"},
]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=200, do_sample=False, no_repeat_ngram_size=6,
eos_token_id=[tok.convert_tokens_to_ids("<|im_end|>"), tok.eos_token_id])
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
4 GB GPU? Load in 4-bit (~2 GB VRAM):
from transformers import BitsAndBytesConfig
q = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.float16)
model = AutoModelForCausalLM.from_pretrained(repo, quantization_config=q, device_map={"": 0})
Modes
| Flag at the end of your message | Behaviour |
|---|---|
/instruct |
Direct answer. The reply starts with an empty <think>\n\n</think> block. |
/reasoning |
Thinks step by step in your language inside <think>…</think>, then answers. Sample k passes and vote for self-consistency. |
Tip: use
no_repeat_ngram_sizeinstead ofrepetition_penalty. Indic suffixes legitimately repeat, and a penalty breaks grammar.
Samples
| Style | Prompt | IndicMaxxer-2B |
|---|---|---|
| ಕನ್ನಡ | ನನ್ನ ಆರ್ಡರ್ ಇನ್ನೂ ಬಂದಿಲ್ಲ, ಏನು ಮಾಡಬೇಕು? | ನಿಮ್ಮ ಆರ್ಡರ್ ಸಂಖ್ಯೆಯನ್ನು ನನಗೆ ನೀಡಿ… ನಾನು ನಿಮಗೆ ಸಹಾಯ ಮಾಡಲು ನನ್ನ ಕೈಲಾದಷ್ಟು ಪ್ರಯತ್ನಿಸುತ್ತೇನೆ. |
| हिंदी | मेरा रिफंड कब तक आएगा? | यह आपके बैंक खाते के आधार पर अलग-अलग होता है। आमतौर पर यह 24 घंटे से लेकर एक सप्ताह तक का समय लेता है… |
| Hinglish | kal interview hai, kuch tips do | Interview se pehle achhi tarah se research kijiye aur apni strengths ke baare mein sochkar confidence banaye rakhie… |
| Kanglish | naale meeting ide, enu prepare maadli? | Naale meeting ge ready aagi 2 gante munche office ge barri… |
The full app (IndicMaxxer)
The model is the core of a fully local assistant (GitHub):
- Token compressor (LLMLingua-2) on history, documents and search results: 40–60% fewer context tokens.
- Rule-based tool router: web search (Wikipedia kn/hi/en + DuckDuckGo), OCR (EasyOCR), PDF/DOCX reading and writing.
- Voice: Silero VAD → WavLM speaker lock → Whisper (Kannada/Hindi/English) → IndicMaxxer-2B → Mithi TTS. Everything on the laptop.
Training
| Base | sarvamai/sarvam-1 (2B) |
| Tokenizer | Sarvam-1 + 3,792 fused tokens from our 48K Indic tokenizer |
| Method | LoRA r=32 on all attention/MLP projections + trainable new-token rows (fp32), base frozen fp16 |
| Data | ~20K chats: SmolTalk-heavy English, Aya / IndicAlign Kannada & Hindi, Hinglish/Kanglish sets, our hand-written conversations, native-language reasoning traces, identity rows |
| Compute | 1× T4 (Kaggle free tier), 75 min, 703 steps, 3.5M tokens (~0.6 epoch) |
Limitations
- Trained for less than one epoch: facts, names and long answers can be wrong; English answers can ramble.
- English token cost is unchanged from Sarvam-1 (English words were not fused).
/reasoningarithmetic is unreliable at this size; use the k-pass vote.- Not safety-tuned beyond the base model. Don't use for medical, legal or financial decisions.
Licence
Derived from Sarvam-1 and distributed under its licence terms (see the Sarvam-1 model card). Check them before any commercial use.
- Downloads last month
- 3
Model tree for viczx/IndicMaxxer-2B
Base model
sarvamai/sarvam-1