How to use from
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 "Sujalvc/akshar-qwen2.5-1.5b-instruct" \
    --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": "Sujalvc/akshar-qwen2.5-1.5b-instruct",
		"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 "Sujalvc/akshar-qwen2.5-1.5b-instruct" \
        --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": "Sujalvc/akshar-qwen2.5-1.5b-instruct",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Quick Links

Akshar Qwen2.5 1.5B Instruct

Akshar Qwen2.5 1.5B Instruct is a SOTA-aligned instruction-following model custom-engineered for natural, conversational Romanized Hinglish (Hindi-English code-mixed language). It is built on top of Qwen/Qwen2.5-1.5B-Instruct and fine-tuned on the premium instruction dataset Sujalvc/hinglish-instruct-dataset (8,340 samples) using high-efficiency QLoRA.

To bridge the gap between stock multilingual vocabularies and natural code-mixed text, Akshar utilizes a custom tokenizer (Sujalvc/akshar-32k) aligned structurally to the base model using FOCUS (subword embedding alignment via BPE deconstruction averaging).


Key Features

  • Custom Code-Mixed Tokenizer: Substantially reduces sequence lengths on casual Romanized Indic text, offering up to 1.4x sequence compression and lower API/inference costs.
  • FOCUS Alignment: Custom token embeddings initialized using subword semantic averaging, preventing the index-scrambling and gradient instability typical of random vocabulary expansion.
  • 0% Devanagari Script Leakage: Enforced normalization rules strip non-ASCII characters to keep the generation strictly in Romanized Hinglish.
  • Highly Efficient PEFT: Configured with target adapters on all projection matrices and trainable vocabulary matrices (embed_tokens and lm_head) to let the new merges learn representation.

Tokenizer Efficiency & Compression Benchmarks

Akshar uses the custom tokenizer Sujalvc/akshar-32k. By resizing the vocabulary and optimizing merges for Hinglish, it achieves superior context window efficiency compared to the stock Qwen2.5 tokenizer.

Tokenizer Profile Comparison

Language Profile Text Sample Stock Qwen2.5 Tokens Akshar-32k Tokens Compression Ratio Stock BPT Akshar BPT
English The virtual DOM is a programming concept where... 19 19 1.00x 5.11 5.11
Hinglish (Casual) Bhai mujhe batayein ki machine learning kya hoti hai... 28 20 1.40x 3.50 4.90
Hinglish (Code-Mixed) React component state updates internally and then... 13 18 0.72x 6.77 4.89

Tokenizer Density Benchmark

Note: BPT (Bytes-Per-Token) measures vocabulary density. A higher BPT value indicates that the tokenizer is packing more character bytes into each token, yielding faster generation speeds and reduced VRAM footprint.


SOTA Benchmarks & Comparative Analysis

1. Tokenizer Fertility SOTA

Most general-purpose tokenizers (e.g., Llama-3, GPT-4) suffer from high fertility rates (splitting a single word into multiple subwords) when processing Romanized Indic text. This wastes context window length and raises inference latency.

Akshar-32k is purpose-built to resolve this, outperforming baseline models:

Tokenizer / Model Expected Hinglish Fertility (Tokens/Word) Target Focus
Akshar-32k (Ours) 1.20 - 1.50 Romanized Hinglish (Optimized)
Sarvam-2B 1.50 - 1.80 Multilingual Indic
Qwen2.5 (Stock) 1.80 - 2.20 Multilingual General
Gemma-2 1.80 - 2.20 Multilingual General
GPT-4 (tiktoken) 2.00 - 2.50 English Heavy
Llama-3 2.50 - 3.00 English Heavy
MuRIL 1.80 - 2.50 Native Script (Devanagari Biased)

2. Conversational Baseline Positioning

While other Indian language efforts (e.g., Airavata, AI4Bharat) target native Devanagari script, and classifier encoders (e.g., HingBERT, HingRoBERTa) target token classification, Akshar-LM is the first dedicated 1.5B instruction-tuned generative LLM designed from the ground up for Romanized Hinglish chat.

3. Academic Framework References

  • Vocabulary Initialization: Adapted from FOCUS (Dobler & de Melo, EMNLP 2023), executing subword deconstruction semantic averaging to boot new embeddings from stock coordinates.
  • Alignment Dataset: Follows the LIMA (Zhou et al., NeurIPS 2023) "Superficial Alignment Hypothesis", demonstrating that a highly-curated dataset (~8K samples) is sufficient for formatting the model's pre-existing knowledge into conversational Hinglish.
  • Fine-Tuning: Leverages QLoRA (Dettmers et al., NeurIPS 2023) and the Unsloth framework.

Fine-Tuning Dataset

The model is fine-tuned on the premium instruction-following dataset Sujalvc/hinglish-instruct-dataset (8,340 training samples and 927 evaluation/test samples).

Dataset Properties & Design:

  • Instruction Focus: Contains structured tasks spanning programming concept explanations, software development queries, casual correspondence translations, logical math problems, and informational summaries.
  • YouTube Comment Anchoring: Prompts are styled and localized based on real Hinglish comments scraped from YouTube. This anchors the model's generations to authentic, conversational slang, shorthand patterns, and spellings used naturally by Indian college students and developers.
  • Sanitization: Excludes Devanagari Unicode script completely. Aggressive filtering guarantees that all output targets use ASCII/Latin characters, eliminating character contamination.

Quick Start & Deployment Guide

To run inference on standard GPU/CPU environments using the transformers library:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Sujalvc/akshar-qwen2.5-1.5b-instruct"

# Load customized tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.float16,
    device_map="auto"
)

# Format chat using custom turn tokens
prompt = "<|user|>\nPython mein list aur tuple ke beech kya difference hai? Casual language mein samjhao.</s>\n<|assistant|>\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

with torch.no_grad():
    outputs = model.generate(**inputs, max_new_tokens=150, pad_token_id=tokenizer.eos_token_id)
    
generated_text = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(generated_text)

Training Specifications & Hyperparameters

The model was fine-tuned on a Google Colab T4 GPU instance using the Unsloth framework and Hugging Face trl library.

PEFT/LoRA Configurations

  • LoRA Rank (R): 16
  • LoRA Alpha: 32
  • LoRA Dropout: 0.05
  • Target Modules: up_proj, down_proj, o_proj, q_proj, v_proj, gate_proj, k_proj
  • Modules to Save (Vocabulary Training): embed_tokens, lm_head (Critical to train the FOCUS initialized merges)

Training Parameters (SFTConfig)

  • Epochs: 3
  • Learning Rate: 5e-5 (Cosine decay)
  • Warmup Ratio: 0.1
  • Weight Decay: 0.01
  • Optimizer: adamw_8bit
  • Effective Batch Size: 4 (Batch size 2 * Gradient Accumulation 2)
  • Sequence Length: 1024 (With sequence packing active)

Quantitative Performance & Logs

  • Final Training Loss (Step 1210): 1.8434
  • Final Evaluation Loss (Epoch 3): 2.0674
  • Evaluation Perplexity (PPL): 7.9039 (Safely below the 8.0 quality threshold)
  • Devanagari Leakage: 0.0% (100% Romanized script)

SFT Loss Convergence Curve

Loss Curves

Epoch Step Training Loss Evaluation Loss
1.0 404 2.2724 2.2770
2.0 808 1.9775 2.0827
3.0 1212 1.8364 2.0674

Constraints & Normalization Rules

  • Lowercasing: The custom tokenizer uses a Lowercase() pre-tokenizer normalizer. All inputs are mapped to lowercase before reaching the model, and the model generates lowercase-only text.
  • ASCII Filter: Non-ASCII characters (including Devanagari Unicode [\u0900-\u097F]) are stripped during pre-tokenization normalization. This ensures strict Romanized script consistency but prevents Hindi script representation.

Qualitative Showcase Probes

Here are actual generated samples from the fine-tuned model:

1. Technical Concept Explanation

  • Instruction: Python mein list aur tuple ke beech kya difference hai? Casual language mein samjhao.
  • Generated:

    simple hai, list ek variable hota he jo multiple elements store kar sakti hai, aur tuple ek concise ar read-easy collection hai. list basically ek sequence of items hota ha jo index se access kiya ja sakta hai. example: [1, 2, 3] ye ek list hai jisme teen integers hain. par (1, 2, 3) tuple ka matlab aahe. isme teen values hain, par ye sirf sorted order mein store ho jaate hain. lists aur tuples dono use karke data manipulate karna easy hote hain, par list mein update ya add/del operations fast hoti hain, jabki tuples slow ho jate hain

2. Professional Context Adaptation

  • Instruction: Is email lines ko natural college student code-mixed language mein translate karo: 'Please review the attached project document and send me your feedback by tomorrow morning.'
  • Generated:

    "hey, bas tu is project ka document check kar le aur feedback bhej de jab tak deadline na ho jaye. thanks!"

3. Logic and Math Reasoning

  • Instruction: Rohan ke paas 15 apples hain. Wo 4 apples Amit ko aur 3 apples Priya ko de deta hai. Ab Rohan ke paas kitne apples bache? Steps ke sath simple Hinglish mein batao.
  • Generated:

    dekho, rohan ke paas 15 apples hain. ab unhe 4 apples kam karte hue (amit) aur 3 apples add karte hue (priya) ki tarah use karke: - pehle amit ko 4 apples minus kar do: 15 -4 = 11 apples ban jate hain. - phir priya ko 3 apples plus kar do: 11 + 3 = 14 apples ban jaate hain. toh ab rohan ke paas 14 apples milenge.

4. Technical Troubleshooting

  • Instruction: Mera laptop slow chal raha hai aur fans bohot fast move ho rahe hain, kya karoon?
  • Generated:

    dekh, ye common symptoms hote hain ki hardware problem ho gaya ho. kuch steps try karo: 1. power cycle karo: pehle laptop ko power off karke on-off cycle karo. isse software bugs ya malware se related issues solve ho sakte hain. 2. disassemble karo: agar windows ya heat venting bands zyada hot feel hoti hain, toh check kar lo ki overheating issue hai. ye leventable bhi ho sakta aahe taaki heat leak na ho. 3. dust hatao: dust ke liye ventilator clean karo ya phir computer ko professional cleaning de do. agar dusty hone toh performance kharab ho sakti hai. 4. software update rakho: drivers aur operating system check karo aur latest updates

Downloads last month
17
Safetensors
Model size
1B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Sujalvc/akshar-qwen2.5-1.5b-instruct

Adapter
(1190)
this model

Dataset used to train Sujalvc/akshar-qwen2.5-1.5b-instruct