Instructions to use pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2") model = AutoModelForCausalLM.from_pretrained("pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2") 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 pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-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": "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2
- SGLang
How to use pankajpandey-dev/Qwen3-4B-Hindi-Instruct-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 "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-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": "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-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 "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-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": "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2", max_seq_length=2048, ) - Docker Model Runner
How to use pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2 with Docker Model Runner:
docker model run hf.co/pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2
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 "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-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": "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'A Hindi instruction-tuned version of Qwen3-4B, fine-tuned to follow instructions and respond naturally in Hindi. Built for developers, researchers, and builders who need a capable, openly-licensed Hindi language model that runs on modest hardware.
Part of the Hindi LLM Series โ a collection focused on bringing strong Indic-language models to local and edge deployment.
๐ก Looking to run this locally on CPU? Use the GGUF version (Q4/Q5/Q8) with llama.cpp, Ollama, or LM Studio.
Highlights
- Strong Hindi instruction-following โ trained on 10K curated Hindi instructionโresponse pairs
- Bilingual โ handles both Hindi (Devanagari) and English
- Compact โ 4B parameters, runs comfortably on a single consumer GPU; quantizes well for CPU
- Open license โ Apache 2.0, commercial use allowed
Example
Prompt:
เคญเคพเคฐเคค เคเฅ เคฐเคพเคเคงเคพเคจเฅ เคเฅเคฏเคพ เคนเฅ? เคเค เคตเคพเคเฅเคฏ เคฎเฅเค เคเคคเฅเคคเคฐ เคฆเฅเคเฅค
Response:
<!-- PASTE A REAL OUTPUT FROM YOUR TEST HERE -->
(Replace the block above with an actual response from your testing โ authentic examples build far more trust than invented ones.)
Quick Start
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "เคฎเฅเคเฅ เคธเฅเคตเคธเฅเคฅ เคฐเคนเคจเฅ เคเฅ เคคเฅเคจ เคเคธเคพเคจ เคคเคฐเฅเคเฅ เคฌเคคเคพเคเฅค"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Model Details
| Property | Value |
|---|---|
| Base model | Qwen/Qwen3-4B-Instruct-2507 |
| Parameters | ~4B |
| Fine-tuning method | LoRA (r=32, ฮฑ=32) via Unsloth |
| Training data | 10K Hindi instructionโresponse pairs |
| Languages | Hindi (hi), English (en) |
| Context length | inherited from base |
| License | Apache 2.0 |
Training
Fine-tuned with Unsloth for efficient LoRA training. The dataset was filtered to keep only genuinely Hindi (Devanagari) responses, then formatted with the Qwen chat template and trained for one full epoch. The resulting LoRA was merged into 16-bit weights and exported.
Intended Use & Limitations
Intended for: Hindi chat and assistant applications, instruction-following, Indic-language experimentation, and local/edge deployment via GGUF.
Limitations: As a 4B model, it can make factual errors and may produce inconsistent results on complex reasoning or specialized domains. It inherits any biases present in the base model and training data. Validate outputs before production use.
Citation
If you use this model, a link back to this repository is appreciated.
Part of the ๐ฎ๐ณ Hindi LLM Series by pankajpandey-dev.
- Downloads last month
- 102
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-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": "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'