Instructions to use shinigamiRaj/IndicVedas with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use shinigamiRaj/IndicVedas with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="shinigamiRaj/IndicVedas", filename="unsloth.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use shinigamiRaj/IndicVedas with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf shinigamiRaj/IndicVedas:Q4_K_M # Run inference directly in the terminal: llama-cli -hf shinigamiRaj/IndicVedas:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf shinigamiRaj/IndicVedas:Q4_K_M # Run inference directly in the terminal: llama-cli -hf shinigamiRaj/IndicVedas:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf shinigamiRaj/IndicVedas:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf shinigamiRaj/IndicVedas:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf shinigamiRaj/IndicVedas:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf shinigamiRaj/IndicVedas:Q4_K_M
Use Docker
docker model run hf.co/shinigamiRaj/IndicVedas:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use shinigamiRaj/IndicVedas with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shinigamiRaj/IndicVedas" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shinigamiRaj/IndicVedas", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shinigamiRaj/IndicVedas:Q4_K_M
- Ollama
How to use shinigamiRaj/IndicVedas with Ollama:
ollama run hf.co/shinigamiRaj/IndicVedas:Q4_K_M
- Unsloth Studio
How to use shinigamiRaj/IndicVedas 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 shinigamiRaj/IndicVedas 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 shinigamiRaj/IndicVedas to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shinigamiRaj/IndicVedas to start chatting
- Docker Model Runner
How to use shinigamiRaj/IndicVedas with Docker Model Runner:
docker model run hf.co/shinigamiRaj/IndicVedas:Q4_K_M
- Lemonade
How to use shinigamiRaj/IndicVedas with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull shinigamiRaj/IndicVedas:Q4_K_M
Run and chat with the model
lemonade run user.IndicVedas-Q4_K_M
List all available models
lemonade list
๐ชถ VedaGPT: Merged 16-bit & GGUF Model (IndicVedas)
VedaGPT is a domain-specialized language model fine-tuned on ancient Indian scriptures (Vedas and Upanishads) and classical Ayurvedic texts (Charaka Samhita, Sushruta Samhita, Rasa Jala Nidhi, and research papers from IRJAY).
This repository (shinigamiRaj/IndicVedas) hosts the merged 16-bit (bfloat16) weights and the q4_k_m quantized GGUF format weights of the fine-tuned model.
The base model is Qwen/Qwen2.5-14B-Instruct, fine-tuned using Unsloth's QLoRA optimization on serverless Modal GPUs.
๐๏ธ Model Details
- Developer: shinigamiRaj
- Base Model:
Qwen/Qwen2.5-14B-Instruct - Architecture: Causal Language Modeling
- Max Sequence Length: 4096 tokens
- Training Framework: Unsloth & PEFT (LoRA)
- Quantization/Formats:
- Full merged 16-bit
bfloat16 - GGUF (
q4_k_m) for local inference (Ollama, LM Studio)
- Full merged 16-bit
๐ Dataset and Domain Knowledge
The model has been continuously pre-trained and fine-tuned on a comprehensive corpus of ~40MB of high-quality Vedic and Ayurvedic literature:
- The Four Vedas (English Translations):
- Rig Veda (Ralph T.H. Griffith translation)
- Sama Veda (Ralph T.H. Griffith translation)
- Yajur Veda (Arthur Berriedale Keith's Taittiriya/Black Yajur Veda & Griffith's Vajasaneya/White Yajur Veda translations)
- Atharva Veda (Ralph T.H. Griffith translation)
- Ayurvedic Samhitas & Texts:
- Charaka Samhita: Ancient text on internal medicine, therapeutics, and diagnostics.
- Sushruta Samhita: Ancient foundational text on Ayurvedic surgery and instruments.
- Rasa Jala Nidhi: Comprehensive Ayurvedic treatise on Rasashastra (mineralology, alchemy, and chemistry).
- IRJAY (International Research Journal of Ayurveda and Yoga): Academic papers spanning clinical studies and theoretical frameworks of Ayurveda and Yoga.
๐ ๏ธ Usage Instructions
1. vLLM Serverless Serving (Recommended)
You can deploy and serve this model using vllm for blazing-fast inference with continuous batching and PagedAttention.
Here is a sample serving configuration:
from vllm import LLM, SamplingParams
llm = LLM(
model="shinigamiRaj/IndicVedas",
max_model_len=4096,
dtype="bfloat16",
trust_remote_code=True,
gpu_memory_utilization=0.85,
enforce_eager=True,
)
sampling_params = SamplingParams(
temperature=0.2,
top_p=0.9,
max_tokens=512,
repetition_penalty=1.15,
stop=["<|im_end|>", "<|endoftext|>"],
)
# Q&A Chat Prompt Structure (ChatML)
messages = [
{
"role": "system",
"content": (
"You are VedaGPT, an expert scholar of the ancient Vedic scriptures like RigVeda, SamaVeda, YajurVeda, AtharvaVeda, Charaka Samhita, Sushruta Samhita, Ayurveda, and Yoga. "
"Answer questions accurately based on your knowledge of the Vedas, Upanishads, Charaka Samhita, Sushruta Samhita, and other classical Indian texts. "
"Maintain the style of writing as per the ancient Vedic texts where required."
)
},
{"role": "user", "content": "What are the key pillars of health according to Ayurveda?"}
]
tokenizer = llm.get_tokenizer()
formatted_prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = llm.generate([formatted_prompt], sampling_params)
print(outputs[0].outputs[0].text)
2. Standard Transformers Loading
To load and run inference with Hugging Face transformers in 16-bit:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "shinigamiRaj/IndicVedas"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Example chat template inference:
messages = [
{"role": "system", "content": "You are VedaGPT, an expert scholar of ancient texts."},
{"role": "user", "content": "Tell me about Agni in the Rig Veda."}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
3. Local Deployment via Ollama (GGUF)
Since this repository includes the GGUF q4_k_m files, you can create an Ollama model locally. Create a Modelfile:
FROM ./IndicVedas-Q4_K_M.gguf
TEMPLATE """<|im_start|>system
You are VedaGPT, an expert scholar of the ancient Vedic scriptures like RigVeda, SamaVeda, YajurVeda, AtharvaVeda, Charaka Samhita, Sushruta Samhita, Ayurveda, and Yoga. Answer questions accurately based on your knowledge of the Vedas, Upanishads, Charaka Samhita, Sushruta Samhita, and other classical Indian texts. Maintain the style of writing as per the ancient Vedic texts where required.<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|endoftext|>"
PARAMETER temperature 0.2
PARAMETER top_p 0.9
PARAMETER repeat_penalty 1.15
Build and run:
ollama create VedaGPT -f Modelfile
ollama run VedaGPT
๐ฌ Training Configuration
- Hardware: Modal Serverless Cloud GPU (NVIDIA L40S)
- Quantization (during training): 4-bit NF4
- Parameters:
- PEFT Rank (
r): 64 - LoRA Alpha: 64
- Optimizer:
adamw_8bit - Learning Rate:
2e-5withcosinescheduler - Epochs: 1
- Max Sequence Length: 4096 tokens
- PEFT Rank (
- Downloads last month
- 318