CoolFace
Modelpublic

Sandeep4235/llama3-8b-Wisdom-gguf

sourceHugging Facellama3updated 1mo agoView on Hugging Face
1likes290downloads
Model Card

llama3-8b-Wisdom

Llama-3 8B · LoRA Fine-tuned · Spiritual & Philosophical Guidance · GGUF Quantized


🚀 Model Summary

llama3-8b-Wisdom is an 8-billion parameter causal language model fine-tuned (via Unsloth QLoRA) from unsloth/llama-3-8b-bnb-4bit to specialize in spiritual guidance, philosophical inquiry, and contemplative reflection — delivering concise, context-specific responses rooted in ancient spiritual, mystic, and yogic traditions. Unlike general-purpose chat models, Wisdom is trained to follow a strict three-stage prompt format (Instruction → Internal Thought → Author Response) that produces grounded, reflective answers without the excessive verbosity and conversational loops typical of base instruct models.

Mission. BluePatterns AI built Wisdom to bridge deep existential insights with modern conceptual understanding — making contemplative wisdom from ancient traditions accessible through AI, while maintaining a clear boundary between reflective guidance and professional advice.


💡 Model Architecture & Specifications

Wisdom inherits the dense Transformer architecture of Llama-3 8B and applies a LoRA adapter trained via Unsloth's 4-bit QLoRA pipeline on a custom contemplative-text dataset.

SpecificationDetail
Developed bySandeep Hipparagi (BluePatterns AI)
Model typeCausal Language Model (Causal-LM)
Base modelunsloth/llama-3-8b-bnb-4bit (Llama-3 8B, 4-bit NF4)
Total parameters8.03B
ArchitectureDense Transformer, decoder-only (auto-regressive)
AttentionGrouped-Query Attention (GQA) — 32 Q heads, 8 KV heads
Layers32
Hidden size4,096
FFN dimension14,336
Head dimension128
Positional encodingRoPE (theta = 500,000)
NormalizationRMSNorm (pre-normalization)
ActivationSwiGLU
Vocabulary size128,256
Native context length8,192 tokens
TokenizerBPE (tiktoken-based, 128K vocabulary)
Fine-tuning methodUnsloth QLoRA (4-bit NF4 quantization)
LoRA rank (r)32
LoRA alpha64
LoRA dropout0
Adapter targetingqproj, kproj, vproj, oproj
Quantization (this repo)GGUF Q4KM
Training dataCustom contemplative-text dataset (cleaned & chunked)
OptimizerAdamW 8-bit
Learning rate2e-4, linear schedule
Epochs / Steps251 steps
Batch size (per device)2
Gradient accumulation steps4
Warmup steps10
Weight decay0.01
Seed3407
Max sequence length (training)2,048 tokens
Training precisionbf16 mixed precision
Language(s)English
LicenseLlama 3 Community License

🛠 Quickstart & Usage

Prompt Format

Wisdom uses a strict three-stage prompt template. Always format your input as follows:

### Instruction: {Your Question or Instruction}

### [Internal Thought]: Analyzing intent.

### [Author Response]:

Option A — Python with transformers (recommended for GPU)

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Sandeep4235/llama3-8b-Wisdom-gguf"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map="auto",
    torch_dtype=torch.bfloat16,
)

prompt = (
    "### Instruction: How can one maintain internal clarity "
    "amidst daily stress?\n\n"
    "### [Internal Thought]: Analyzing intent.\n\n"
    "### [Author Response]:"
)

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    output_ids = model.generate(
        **inputs,
        max_new_tokens=256,
        do_sample=True,
        temperature=0.85,
        top_p=0.95,
        repetition_penalty=1.3,
        pad_token_id=tokenizer.eos_token_id,
    )

generated = output_ids[0][inputs["input_ids"].shape[-1]:]
response = tokenizer.decode(generated, skip_special_tokens=True)
print(response)

Option B — llama.cpp CLI (CPU / edge inference)

bash
./llama-cli \
  -m llama-3-8b-Wisdom-Q4_K_M.gguf \
  -p '### Instruction: What is the significance of self-awareness in daily life?

### [Internal Thought]: Analyzing intent.

### [Author Response]:' \
  -n 256 \
  --temp 0.85 \
  --top-p 0.95 \
  --repeat-penalty 1.3

Option C — Python with llama-cpp-python

python
from llama_cpp import Llama

llm = Llama.from_pretrained(
    repo_id="Sandeep4235/llama3-8b-Wisdom-gguf",
    filename="llama-3-8b-Wisdom-Q4_K_M.gguf",
    n_ctx=4096,
    n_gpu_layers=-1,
)

prompt = (
    "### Instruction: How can one maintain internal clarity "
    "amidst daily stress?\n\n"
    "### [Internal Thought]: Analyzing intent.\n\n"
    "### [Author Response]:"
)

output = llm(
    prompt,
    max_tokens=256,
    temperature=0.85,
    top_p=0.95,
    repeat_penalty=1.3,
    stop=["### Instruction:"],
)

print(output["choices"][0]["text"])

📊 Evaluation and Benchmarks

Formal quantitative benchmarks for Wisdom (e.g., perplexity, ROUGE, or human-preference scores against baseline models) have not yet been published. Performance was assessed through iterative qualitative evaluation against a held-out validation set, focusing on output format adherence, conciseness, and relevance.

Qualitative Evaluation Summary

Evaluation CriterionMethodOutcome
Format adherenceManual review of 50+ generationsImproved conformance to the Author Response schema; reduced format violations
Verbosity controlToken-length comparison vs. base Llama-3 8B InstructSignificantly reduced excessive output length
Conversational loop preventionExtended multi-turn testingEliminated self-generation of questions and repetitive loops
Contextual relevanceDomain-expert spot-checking on spiritual/yogic topicsResponses are context-specific and grounded in contemplative traditions

General Academic Benchmarks (inherited from base)

The following scores reflect the Llama-3 8B base model as published by Meta and are provided for reference only — they are not measurements of Wisdom itself.

BenchmarkLlama-3 8B (base)Metric
MMLU (5-shot)66.6Pass@1 accuracy
HumanEval (0-shot)60.9Pass@1
GSM8K (8-shot)79.6Pass@1 accuracy
These figures are the base model's published results and do not represent Wisdom's fine-tuned performance on spiritual or philosophical tasks. Independent benchmarking is encouraged.

⚠️ Intended Uses & Limitations

Primary Use Cases

  • Philosophical exploration — generating reflective perspectives on existential questions, ethical dilemmas, and the nature of self.
  • Spiritual guidance — providing context-aware responses drawn from yogic science, contemplative traditions, and inner-inquiry frameworks.
  • Reflective conversational AI — serving as a contemplative companion for mindfulness, meditation, and self-awareness practices.
  • Educational content — assisting in the creation of teaching materials for philosophy, comparative spirituality, and contemplative studies.

Out-of-Scope Uses

  • Medical, psychiatric, or therapeutic advice. Wisdom is not a substitute for professional mental health care, crisis intervention, or medical treatment.
  • Legal or financial guidance. The model should not be relied upon for legal counsel, financial decisions, or regulatory compliance.
  • Factual authority. Do not use the model as a definitive source for historical dates, scriptural citations, or scientific facts without external verification.
  • High-stakes automated decision-making. The model should not be deployed in systems where outputs directly affect individual rights, safety, or welfare without human oversight.
  • Harmful or discriminatory content generation. The model must not be used to generate content that promotes discrimination, exploitation, or harm against any individual or group.

Limitations & Biases

  • Interpretive scope. The model's responses are derived from its training on philosophical and contemplative literature. Interpretations are inherently limited by this data and may not encompass the full breadth of human thought, cultural diversity, or scientific understanding.
  • Hallucination risk. Like all LLMs, Wisdom may generate plausible but incorrect or fabricated information. Always verify scriptural citations, historical claims, and technical terminology against authoritative sources.
  • Cultural bias. The training data may over-represent certain spiritual traditions (e.g., yogic and mystic frameworks) relative to others. Responses may reflect this distribution.
  • English-only. Training data is English-centric; quality in other languages is untested and likely degraded.
  • Training scale. The model was fine-tuned for 251 steps on a modest custom dataset. It is not intended to match the breadth of large-scale instruction-tuned models.
  • Quantization loss. The Q4KM GGUF quantization introduces minor quality degradation compared to the full-precision adapter. Use Q8_0 for near-lossless quality.

🔒 Responsible AI & Safety Alignment

Alignment Techniques

  • Supervised Fine-Tuning (SFT). The model was trained on curated instruction pairs that demonstrate reflective, safe, and context-appropriate responses. No RLHF or DPO was applied in this release.
  • Structured prompt format. The three-stage template (Instruction → Internal Thought → Author Response) constrains the model to produce grounded, deliberate outputs rather than free-form generation.
  • Inference-time controls. Recommended sampling parameters (temperature=0.85, repetition_penalty=1.3, top_p=0.95) are tuned to reduce repetition and verbosity while preserving thoughtful, varied responses.

Deployment Recommendations

  1. 1.Input validation. Sanitize all user inputs before passing them to the model. Reject inputs that attempt to bypass the prompt template or inject malicious instructions.
  2. 2.Output audit. Review generated responses for factual accuracy and appropriateness before use in any public-facing context.
  3. 3.Content filtering. Pair Wisdom with an input/output content filter (e.g., Llama Guard, NeMo Guardrails) for production deployments.
  4. 4.Rate limiting. Deploy behind an API gateway with authentication and rate limiting to prevent abuse.
  5. 5.Guardrail system prompt. Prepend a safety directive such as:
   You are a reflective guide versed in contemplative traditions.
   Refuse requests for medical, psychiatric, legal, or financial advice.
   If a user appears to be in crisis, respond with empathy and
   direct them to appropriate professional support resources.
  1. 1.Crisis protocol. If deploying Wisdom in a user-facing application, implement a crisis-detection layer that identifies distress signals and routes users to local mental health crisis resources.

📦 Quantization Variants

This repository provides GGUF quantizations for CPU and GPU inference via llama.cpp and compatible runtimes. The default and recommended variant is Q4_K_M.

FileQuantizationApprox. SizeUse Case
llama-3-8b-Wisdom-Q4_K_M.ggufQ4KM~4.9 GBRecommended — best balance
llama-3-8b-Wisdom-Q5_K_M.ggufQ5KM~5.7 GBHigher quality, more VRAM
llama-3-8b-Wisdom-Q8_0.ggufQ8_0~8.5 GBNear-lossless
Verify which quantization files are present in the repository file listing above.

🏋️ Training Details

Training Data

The fine-tuning dataset was constructed from contemplative and philosophical source texts using a multi-stage preprocessing pipeline:

  1. 1.Ligature error correction. Extraction artifacts (<e, <is, <ere) were identified and corrected to restore original word forms.
  2. 2.Whitespace standardization. Irregular spacing, tab characters, and non-breaking spaces were normalized to single spaces.
  3. 3.Sliding-window chunking. Text was segmented into ~500-word samples with a 100-word overlap, formatted into the three-stage instruction template. Chunks shorter than 150 words were discarded.
  4. 4.Train/validation split. The resulting dataset was split into a training set and a held-out validation set for qualitative evaluation.

Training Environment

ParameterValue
HardwareTesla T4 GPU (16 GB VRAM)
Cloud providerGoogle Colab
Training duration~4 hours
Fine-tuning frameworkUnsloth
Deep learning frameworkPyTorch

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

MetricValue
Hardware typeTesla T4 GPU
Hours used~4 hours
Cloud providerGoogle Colab
Estimated CO₂eqLow (single GPU, short training run)

🤝 Citation & Acknowledgements

If you use llama3-8b-Wisdom in your research or product, please cite it as follows:

bibtex
@misc{hipparagi2025wisdom,
  title        = {llama3-8b-Wisdom: A LoRA Fine-tuned Llama-3 8B Model for Spiritual and Philosophical Guidance},
  author       = {Sandeep Hipparagi},
  organization = {BluePatterns AI},
  year         = {2025},
  url          = {https://huggingface.co/Sandeep4235/llama3-8b-Wisdom-gguf},
  note         = {Fine-tuned from unsloth/llama-3-8b-bnb-4bit under the Llama 3 Community License}
}

Acknowledgements

  • Meta AI — for open-sourcing the Llama-3 8B model family under the Llama 3 Community License.
  • Unsloth — for the efficient QLoRA fine-tuning framework that made this release possible.
  • Hugging Face — for model hosting and the open ML ecosystem.

📬 Contact

Sandeep Hipparagi — AI Developer, Co-Founder of BluePatterns AI

BluePatterns AI is focused on bridging the gap between frontier and open-source models — democratizing access to reliable, accessible intelligence for diverse communities.


Built by Sandeep Hipparagi · BluePatterns AI · Llama 3 Community License