Instructions to use Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned") model = AutoModelForMultimodalLM.from_pretrained("Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned") 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 Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned
- SGLang
How to use Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned 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 "Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned" \ --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": "Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned", "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 "Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned" \ --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": "Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned with Docker Model Runner:
docker model run hf.co/Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned
Llama 3.2 3B - Bhagavad Gita Fine-tuned (Fully Merged)
This is a fully merged and quantization-ready version of Llama 3.2 3B fine-tuned on the Bhagavad Gita corpus for understanding Vedic philosophy and [translate:Dharma].
π― Model Overview
- Base Model: Meta's Llama 3.2 3B Instruct
- Fine-tuned Dataset: Bhagavad Gita (701 verses)
- Fine-tuning Method: LoRA (Low-Rank Adaptation) merged into full model
- Total Parameters: 3.2 Billion
- Model Size: ~6-7 GB (merged)
- Training Hardware: Google Cloud TPU v6e-8 (8 cores)
- Final Loss: 1.7188
- Training Time: ~20 minutes
π Training Details
Dataset
- Source: Bhagavad Gita Dataset (HuggingFace)
- Samples: 701 verses
- Language: English translations with Sanskrit references
- Content: [translate:Bhagavad Gita verses covering Yoga, Dharma, Karma, and spiritual philosophy]
Fine-tuning Configuration
LoRA Configuration:
Rank (r): 16
Alpha: 32
Target Modules: q_proj, k_proj, v_proj, o_proj
Dropout: 0.05
Learning Rate: 1e-4
Batch Size: 4
Optimizer: AdamW
Max Length: 512 tokens
text
Hardware & Compute
Hardware: Google Cloud TPU v6e-8
8 TPU cores running in parallel
Distributed training across all cores
BF16 precision for efficiency
Compute Resources:
Training Duration: ~20 minutes
Samples per core: ~88-90
Total batches: ~22
text
π§ Model Capabilities
This model excels at:
β
Understanding [translate:Dharma] - Discussing duty, righteousness, and cosmic law
β
Karma Yoga concepts - Explaining action without attachment
β
Philosophical discussions - Deep understanding of ancient wisdom
β
Sanskrit references - Recognizing and explaining Sanskrit terms
β
Vedic knowledge - Providing context from Vedic literature
β
Meditation & spirituality - Guidance on inner peace and enlightenment
π Quick Start
Installation
pip install transformers torch
text
Basic Usage
import torch from transformers import AutoModelForCausalLM, AutoTokenizer Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained( "Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned", torch_dtype=torch.float16, device_map="auto" )
tokenizer = AutoTokenizer.from_pretrained( "Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned" ) Generate text
prompt = "What is the meaning of Karma Yoga?" inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad(): outputs = model.generate( **inputs, max_new_tokens=150, temperature=0.7, top_p=0.9, do_sample=True )
response = tokenizer.decode(outputs, skip_special_tokens=True) print(response)
text
π Example Outputs
Q: What is the purpose of life according to the Gita?
A: The purpose of life according to the Gita is to attain Moksha or Liberation. Moksha is the state of ultimate bliss and freedom from the cycle of birth and death. The Bhagavad Gita teaches that one can attain Moksha by performing one's duty without attachment and expectation of reward. This is achieved through the practice of Karma Yoga - the path of action...
Q: What does Krishna teach about duty?
A: Krishna teaches that duty ([translate:Dharma]) is the foundation of righteous living. One should perform their duties according to their nature and station in life without being attached to the fruits of their actions. The Gita emphasizes that it is better to perform one's own duty imperfectly than to perform another's duty perfectly...
Q: How can one achieve inner peace?
A: According to the Bhagavad Gita, inner peace is achieved through the practice of yoga and meditation. The mind must be trained to focus inward, away from the distractions and pleasures of the world. Through consistent practice and devotion, one can quiet the mind and experience the peace that comes from direct realization of the Divine...
π Educational Applications
This model is ideal for:
- π Educational platforms teaching Vedic philosophy
- π§ Meditation and wellness apps
- π Spiritual and philosophical chatbots
- π Cultural understanding applications
- π Thought-provoking Q&A systems
β οΈ Limitations
- Fine-tuned specifically on English Bhagavad Gita translations
- May have context limitations beyond 512 tokens
- Best performance with philosophical/spiritual queries
- Should not be used as sole source for religious/spiritual guidance
π Citation
If you use this model, please cite:
@misc{bhavesh_llama_gita_2025, title={Llama 3.2 3B - Bhagavad Gita Fine-tuned}, author={Bhavesh Varma}, year={2025}, publisher={HuggingFace Hub}, url={https://huggingface.co/Bhaveshbhau44/Llama-3.2-3B-Gita-Vedic-Finetuned} }
text
π Model Information
- Developer: Bhavesh Varma
- Model Type: Causal Language Model
- Base Model License: Llama Community License
- Training Framework: PyTorch, Transformers, PEFT, torch_xla
- Hardware: Google Cloud TPU
π Related Models
β Acknowledgments
- Meta for Llama 3.2 model
- HuggingFace for Transformers and Hub
- Google Cloud for TPU infrastructure
- Bhagavad Gita Dataset contributors
Last Updated: November 4, 2025
Model Status: β
Active & Ready to Use
- Downloads last month
- 11