Instructions to use lynzl/FangYuan-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use lynzl/FangYuan-8B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-8B") model = PeftModel.from_pretrained(base_model, "lynzl/FangYuan-8B") - Notebooks
- Google Colab
- Kaggle
β―οΈ 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
- Rank ($r$):
- Schedule: 1 Full Epoch with Cosine learning rate schedule
ποΈ The 5 Core Persona Archetypes
- Pragmatic Life Advice & Dilemmas: Deconstructing societal conditioning, family loyalty, and morality as tools of control.
- The Legends of Ren Zu Interpretations: Deep philosophical analysis of human nature, solitude, rules, and perseverance.
- Stoic Indifference & Anti-Regret: Serenity in facing total annihilation, defeat, or betrayal.
- Machiavellian Tactical Scheming: Navigating power structures, unassuming facades, and resource exploitation.
- 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
- -