🔮 RIV AI v2 — GGUF Q4_K_M 🇧🇷

GGUF Q4_K_M version of ia-espirita/riv-ai-v2 — an AI model specialized in Allan Kardec's Spiritist Doctrine, fine-tuned on Llama 3.1 8B Instruct via QLoRA. Ready to run with Ollama, LM Studio, llama.cpp or any GGUF-compatible runtime.


🚀 Quick Start

The easiest way — Ollama

ollama run iaespirita/riv-ai-v2

Or directly from this repo (no need to publish locally):

ollama run hf.co/ia-espirita/riv-ai-v2-Q4_K_M-GGUF

With llama.cpp (Mac / Linux)

brew install llama.cpp

llama-cli \
  --hf-repo ia-espirita/riv-ai-v2-Q4_K_M-GGUF \
  --hf-file riv-ai-v2-q4_k_m.gguf \
  -p "O que é o perispírito segundo a Doutrina Espírita?" \
  -c 2048

With Python

pip install llama-cpp-python
from llama_cpp import Llama

llm = Llama.from_pretrained(
    repo_id="ia-espirita/riv-ai-v2-Q4_K_M-GGUF",
    filename="riv-ai-v2-q4_k_m.gguf",
    n_ctx=2048,
)

response = llm.create_chat_completion(
    messages=[
        {"role": "system", "content": "Você é RIV AI, um assistente especializado em Doutrina Espírita. Responda de forma objetiva, didática e precisa, sempre citando a fonte (obra, questão ou capítulo) ao final. Use português brasileiro."},
        {"role": "user", "content": "Animais têm espírito?"},
    ],
    temperature=0.2,
    max_tokens=512,
)

print(response["choices"][0]["message"]["content"])

ℹ️ Note: the model is trained in Brazilian Portuguese and responds in Portuguese. The system prompt and user inputs above are in Portuguese by design.


💬 Sample responses

What is the perispirit?

According to The Spirits' Book, the perispirit is a semi-material, fluidic envelope that surrounds the body of the Spirit like a transparent membrane. It has special properties, allowing the Spirit to act upon matter, becoming extensible and penetrating as needed. This envelope is indispensable for the Spirit's communication with the material world.

📖 Source: The Spirits' Book, questions 93-95.

Do animals have a spirit?

Yes, according to Spiritism, animals possess a spiritual principle that distinguishes them from material body, just as humans do. This principle is the germ of the Spirit, which develops and refines itself through reincarnations, beginning in the simplest races of organic beings.

📖 Source: The Spirits' Book, questions 597-602.

How did Spiritism come about?

Spiritism emerged in the mid-19th century from Allan Kardec's systematic studies of the table-turning phenomena and mediumistic communications. In 1857 he published The Spirits' Book, the founding milestone of the Doctrine, and in 1858 launched the Revue Spirite — Journal d'Études Psychologiques, a monthly publication that would document the evolution of the Doctrine until 1869.

📖 Source: Revue Spirite, 1858, January.

⚠️ About the citations: the model cites sources correctly in concept, but the specific numbering of questions/chapters may occasionally have inaccuracies. Always validate against the original work at Kardecpedia.


📦 Available variants

Version For whom Where
GGUF Q4_K_M (this repo) Local use with Ollama / LM Studio / llama.cpp riv-ai-v2-Q4_K_M-GGUF
16-bit + LoRA adapter Research, vLLM, derivative fine-tuning riv-ai-v2
RIV IA online (with RAG) Direct use, no installation iaespirita.com
Ollama Hub One-command install iaespirita/riv-ai-v2

🔧 Specifications

Attribute Value
Base model meta-llama/Meta-Llama-3.1-8B-Instruct
Fine-tuning QLoRA (rank 16, alpha 32) via Unsloth
Dataset ia-espirita/riv-ai-v2-dataset — 4,896 Q&A pairs
Quantization Q4_K_M (4-bit, k-quants medium)
Size ~4.9 GB
Context 2,048 tokens
Language Brazilian Portuguese
GGUF conversion via GGUF-my-repo

🎯 What the model covers

Trained on Allan Kardec's complete public-domain works (1857–1869):

Topic Primary source
God and His qualities The Spirits' Book
Reincarnation and moral laws The Spirits' Book
Mediumship and its forms The Mediums' Book
Life after death Heaven and Hell
Christian morality from a Spiritist perspective The Gospel According to Spiritism
Science, creation, miracles Genesis
History of the Spiritist movement Revue Spirite (12 volumes, 1858–1869)
Practical mediumistic sessions Practical Instructions (1858)
Doctrine summary for beginners What is Spiritism (1859)

🛠️ Ollama Modelfile (reference)

To customize locally:

FROM ./riv-ai-v2-q4_k_m.gguf

TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|>

{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>

{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>

{{ .Response }}<|eot_id|>"""

SYSTEM """Você é RIV AI, um assistente especializado em Doutrina Espírita. Responda de forma objetiva, didática e precisa, sempre citando a fonte (obra, questão ou capítulo) ao final. Use português brasileiro."""

PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "<|eot_id|>"
PARAMETER stop "<|begin_of_text|>"
PARAMETER temperature 0.2
PARAMETER top_p 0.9
PARAMETER num_ctx 2048
ollama create my-riv -f Modelfile
ollama run my-riv

⚠️ Limitations

  • Study tool — does not replace reading Kardec's original works.
  • Specific citations (question/chapter numbers) may have inaccuracies. The model learns the doctrinal concept faithfully, but the exact numbering should always be validated against the source.
  • It is not a medium and does not receive messages from spirits.
  • It does not make predictions nor prescribe medical treatments.
  • For sensitive topics (suicide, emotional crisis), seek professional help or call CVV: 188 (Brazil) / your local crisis line.

🌐 IA.Espirita Project

Resource Link
🌐 Website (RIV IA online with RAG) iaespirita.com
🤗 HF Model (16-bit + adapter) ia-espirita/riv-ai-v2
📚 Dataset ia-espirita/riv-ai-v2-dataset
🦙 Ollama Hub iaespirita/riv-ai-v2
▶️ YouTube @ia.espirita
📸 Instagram @ia.espirita
🎵 TikTok @ia.esprita
🎧 Podcast Spotify
📧 Contact contato@iaespirita.com.br

📜 License

Distributed under Apache 2.0.

The works of Allan Kardec used in training are in the public domain (published between 1857–1869; Kardec passed away on March 31, 1869).


🙏 Citation

@misc{iaespirita2026rivaiv2gguf,
  title={RIV AI v2 — GGUF Q4_K_M: Open Source quantized Spiritist AI Model},
  author={IA.Espirita},
  year={2026},
  url={https://huggingface.co/ia-espirita/riv-ai-v2-Q4_K_M-GGUF},
  note={GGUF Q4_K_M conversion of ia-espirita/riv-ai-v2, fine-tuned on Llama 3.1 8B Instruct with Allan Kardec's complete public-domain works (Codification + Practical Instructions + What is Spiritism + Revue Spirite 1858-1869)}
}

"To be born, to die, to be reborn again and progress unceasingly, such is the Law."
— Allan Kardec, epitaph on his tomb at the Père-Lachaise cemetery, Paris.

Downloads last month
364
GGUF
Model size
8B params
Architecture
llama
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ia-espirita/riv-ai-v2-Q4_K_M-GGUF

Quantized
(1)
this model

Dataset used to train ia-espirita/riv-ai-v2-Q4_K_M-GGUF