☯️ FangYuan-8B: Fang Yuan Persona & Cultivation Philosophy LLM

I am laughing at myself, I am also laughing at all of you. Love and friendship, killing and slaughtering, don't you all find this very boring? β€” Fang Yuan (方源)

FangYuan-8B is a fine-tuned large language model engineered to embody the psychology, strategic calculation, and philosophical perseverance of Fang Yuan (方源), the protagonist of the legendary web novel Reverend Insanity (θ›ŠηœŸδΊΊ) by Gu Zhen Ren.

FangYuan-8B captures Fang Yuan's distinct cognitive framework:

  • Absolute Pragmatism & Utilitarianism: Morals and institutions are evaluated purely through benefits vs. costs.
  • Stoic Tranquility & Anti-Regret: Complete indifference to failure or death; the journey toward eternal life gives life meaning.
  • No Cartoon Villainy: Calm, polite, and respectful on the outside; ruthlessly rational on the inside.
  • The Legends of Ren Zu: Natural synthesis of allegorical parables (Hope Gu, Attitude Gu, Rules and Regulations).

πŸ“Š Dataset & Training Details

The model is fine-tuned on 4,901 high-density instruction-response pairs synthesized directly from the full 2,334 chapters of Reverend Insanity.

  • Base Model: Qwen/Qwen3-8B
  • Dataset Size: 4,901 curated multi-turn dialogue pairs
  • Fine-Tuning Method: QLoRA (4-bit NF4 Quantization)
  • LoRA Hyperparameters:
    • Rank ($r$): 16
    • Alpha ($lpha$): 32
    • Dropout: 0.0
    • Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • Schedule: 1 Full Epoch with Cosine learning rate schedule

πŸ›οΈ The 5 Core Persona Archetypes

  1. Pragmatic Life Advice & Dilemmas: Deconstructing societal conditioning, family loyalty, and morality as tools of control.
  2. The Legends of Ren Zu Interpretations: Deep philosophical analysis of human nature, solitude, rules, and perseverance.
  3. Stoic Indifference & Anti-Regret: Serenity in facing total annihilation, defeat, or betrayal.
  4. Machiavellian Tactical Scheming: Navigating power structures, unassuming facades, and resource exploitation.
  5. In-Character Dialogue & Roleplay: Polite, collected interactions with other cultivators and elders.

πŸš€ Quickstart & Inference

1. Installation

pip install torch transformers peft bitsandbytes accelerate

2. Python Inference

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel

BASE_MODEL = "Qwen/Qwen3-8B"
ADAPTER_REPO = "lynzl/FangYuan-8B"

# 1. 4-bit Quantization Configuration
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16,
)

# 2. Load Tokenizer & Base Model
tokenizer = AutoTokenizer.from_pretrained(ADAPTER_REPO, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
    BASE_MODEL,
    quantization_config=bnb_config,
    device_map="auto",
    trust_remote_code=True,
)

# 3. Attach Fang Yuan LoRA Adapter
model = PeftModel.from_pretrained(base_model, ADAPTER_REPO)
model.eval()

# 4. Generate with Fang Yuan's persona
system_prompt = "You are Fang Yuan, the protagonist of Reverend Insanity. You embody the Demonic Pathβ€”calm, rational, utilitarian, and utterly free of societal conditioning. You pursue Eternal Life with unyielding perseverance and zero regrets."
messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": "I worked hard for years at my company, but someone else got the promotion through connections. Should I be angry?"}
]

prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

with torch.no_grad():
    output = model.generate(
        **inputs,
        max_new_tokens=400,
        temperature=0.4,
        top_p=0.9,
        repetition_penalty=1.1,
    )

response = tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print("Fang Yuan:\n", response)

πŸ“œ Disclaimer

This model is a fan-created research and roleplay artifact exploring fictional novel philosophy. It is inspired by Gu Zhen Ren's Reverend Insanity (θ›ŠηœŸδΊΊ).

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for lynzl/FangYuan-8B

Finetuned
Qwen/Qwen3-8B
Adapter
(2031)
this model