Mythos-From-Scratch (Any-to-Any Architecture & Training Suite)

A complete from-scratch decoder-only Transformer (MythosForCausalLM) and Any-to-Any Multimodal extension (MythosOmniForAnyToAny) built in PyTorch with:

  • Modern Architecture: RoPE, RMSNorm, SwiGLU, Grouped-Query Attention (GQA), QK-Norm, Z-Loss stability, and presets from 50m up to 100b.
  • Custom BPE Tokenizer: train_tokenizer.py with <|think|>, <|think_low|>, <|think_medium|>, <|think_high|>, <|think_ultra|>, <|context|>, and multimodal tokens.
  • 4-Stage Training Pipeline:
    1. pretrain.py β€” Multi-GPU DDP (torchrun) pretraining from random weights with WSD schedule & Google Drive auto-resume
    2. sft_reasoning.py β€” Masked SFT on <|think|>...<|/think|> reasoning traces
    3. dpo_align.py β€” Direct Preference Optimization alignment
    4. train_omni.py β€” Joint Any-to-Any Vision + Audio + Text training (omni_heads.safetensors)
  • RAG & Adaptive Thinking Modes: rag_engine.py + reasoning_engine.py (off, low, medium, high, ultra Best-of-N test-time compute).
  • Compact .safetensors Export: export_compact.py (fp16, bf16, int8).

Note: This repository contains the full architecture, training scripts, and Google Colab notebook (Mythos_From_Scratch_Colab.ipynb). Open the notebook in Google Colab to run GPU training and generate trained .safetensors weights.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support