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
Safetensors
Model size
3B params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support