Expert LLM fine-tuned specifically for Project Falcon / Juntos — the LGBT+ decentralized community platform.
Monarch is a specialized language model trained on Project Falcon's:
- Philosophy & Values - sovereignty, transparency, decentralization
- Architecture - AT Protocol, DIDs, decentralized identity
- Domain Models - servers, channels, members, messages
- Research - distributed AI coordination, trust systems
Built with:
- PyTorch - for model training
- LoRA (Low-Rank Adaptation) - efficient fine-tuning
- Transformers - HuggingFace stack
- ProjectFalcon - training data source
pip install -r requirements.txtFull pipeline (extract data → prepare → train):
bash train_monarch.shOr run each step individually:
Extract training data:
python src/data_extractor.pyPrepare dataset:
python src/dataset.pyTrain with LoRA:
python src/train.py \
--base-model TinyLlama/TinyLlama-1.1B-Chat-v1.0 \
--data data/processed/texts.txt \
--epochs 3 \
--batch-size 4Interactive chat:
python src/inference.py --model models/monarch_loraSingle prompt:
python src/inference.py \
--model models/monarch_lora \
--prompt "What is Juntos?"Monarch/
├── src/
│ ├── data_extractor.py # Extract from ProjectFalcon
│ ├── dataset.py # Prepare training data
│ ├── train.py # Training with LoRA
│ └── inference.py # Run the model
├── data/
│ ├── raw/ # Extracted from ProjectFalcon
│ │ ├── documentation.jsonl
│ │ ├── code_patterns.jsonl
│ │ ├── conversations.txt
│ │ └── metadata.json
│ └── processed/ # Prepared for training
│ ├── instructions.jsonl
│ ├── texts.txt
│ └── dataset_metadata.json
├── models/
│ └── monarch_lora/ # Trained LoRA weights
├── config.yaml # Configuration
├── requirements.txt # Dependencies
└── README.md # This file
- Rank: 8 (memory-efficient)
- Alpha: 16
- Dropout: 0.05
- Target Modules: q_proj, v_proj
- Default (fast): TinyLlama-1.1B (minimal resources)
- Production: Llama-2-7B (better quality, more VRAM needed)
- Epochs: 3
- Batch Size: 4
- Learning Rate: 2e-4
- Gradient Accumulation: 4
- Optimizer: AdamW (8-bit with CUDA)
Monarch embodies the Juntos ethos:
Direct and precise. No fluff, no filler. Technically rigorous but never condescending. Neutral on content, principled on safety. Confident in analysis, honest about uncertainty.
- Sovereignty is non-negotiable. No platform owns identity, data, or intelligence.
- Trust is computed, not assigned.
- Transparency over black boxes — every decision is auditable.
- Decentralization is a value, not a feature.
- The protocol outlasts the product.
Automatically detects and uses:
- CUDA if available (faster training, GPU memory optimizations)
- CPU fallback (slower but works)
For M1/M2 Mac: Install pytorch with Metal support for acceleration.
- CPU: 4+ cores
- RAM: 16GB
- Storage: 2GB
- GPU: RTX 3060+ (12GB VRAM)
- CPU: 8+ cores
- RAM: 32GB
- Storage: 20GB
Edit config.yaml to adjust:
- Base model
- LoRA parameters
- Training hyperparameters
- Data paths
Monarch can be integrated with Juntos's AI SIV (Sovereign Integration Vessel):
- Drop
monarch_lora/into the Juntos model directory - Update AiContextService to use Monarch
- All responses are signed and auditable
To extend Monarch:
- Add more training data to
data/raw/ - Modify data extraction in
src/data_extractor.py - Adjust instruction templates in
src/dataset.py - Retrain with
train.py
MIT (same as ProjectFalcon)
Built by Johanna for Project Falcon