--- license: mit library_name: transformers tags: - merge - slerp - qwen3.5 - myth - reasoning - coding - math base_model: - Qwen/Qwen3.5-4B - Jackrong/Qwen3.5-4B-Neo pipeline_tag: text-generation language: - en - multilingual extra_gated_prompt: "This model is open for all. No special permission needed." --- # 🧬 Myth 4B **Myth 4B** is a fusion of [Qwen 3.5 4B](https://huggingface.co/Qwen/Qwen3.5-4B) and [Qwen3.5-4B-Neo](https://huggingface.co/Jackrong/Qwen3.5-4B-Neo) via SLERP (Spherical Linear Interpolation), built with a custom fusion engine that operates directly on safetensors — no mergekit required. > "Three forces, one entity — Myth" ## Model Details ### Architecture | Attribute | Value | |---|---| | **Base Model** | Qwen 3.5 4B | | **Parameters** | 4B | | **Context Length** | 32K | | **Architecture** | `qwen3_5` | | **Format** | FP16 (sharded, 8 files) + GGUF Q4_K_M | | **Fusion Method** | SLERP (50% Qwen 3.5 + 50% Neo) | ### Lineage ``` Qwen 3.5 4B (multimodal base) | ├── SLERP ──→ 🧬 Myth 4B | Qwen3.5-4B-Neo (reasoning expert) ``` Myth inherits: - **Deep reasoning** from Neo's reasoning-focused fine-tuning - **Multimodal capabilities** from Qwen 3.5's native architecture - **Coding & math** from Qwen 3.5's strong foundation - **1M-token capable** via Qwen 3.5's extended context architecture ## Fusion Engine Unlike most merges that use mergekit, Myth 4B was merged using a **custom-built fusion engine**: ``` myth_fusion.py — Custom SLERP Engine • Reads safetensors directly (no transformers dependency) • Processes one tensor at a time (low memory footprint) • Saves in shards (8 shards × ~100 tensors each) • Supports any model architecture • No GPU required ``` 738 tensors were merged in 2 stages, with shard-based saving to prevent OOM on 8GB RAM hardware. ## Files | File | Size | Description | |---|---|---| | `model-*.safetensors` (×8) | 8.8 GB total | FP16 model weights (sharded) | | `Myth-4B-Q4_K_M.gguf` | 2.78 GB | Quantized GGUF (Q4_K_M) | | `myth_system_prompt.md` | 5 KB | Custom system prompt (Claude Fable 5-inspired) | ## Usage ### Transformers (Python) ```python from transformers import AutoModelForCausalLM, AutoTokenizer model = AutoModelForCausalLM.from_pretrained( "dracko14/Myth-4B", torch_dtype="auto", device_map="auto", trust_remote_code=True ) tokenizer = AutoTokenizer.from_pretrained( "dracko14/Myth-4B", trust_remote_code=True ) messages = [ {"role": "system", "content": "You are Myth, a helpful AI assistant."}, {"role": "user", "content": "Write a Python function for binary search."}, ] prompt = tokenizer.apply_chat_template(messages, tokenize=False) inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate(**inputs, max_new_tokens=200) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) ``` ### llama.cpp / Ollama ```bash # Download GGUF wget https://huggingface.co/dracko14/Myth-4B/resolve/main/Myth-4B-Q4_K_M.gguf # Run with llama.cpp ./llama-cli -m Myth-4B-Q4_K_M.gguf -p "Hello" -n 256 # Or with Ollama (create Modelfile first) echo "FROM ./Myth-4B-Q4_K_M.gguf" > Modelfile ollama create myth -f Modelfile ollama run myth ``` ### System Prompt Myth includes a custom system prompt inspired by Claude Fable 5: [📄 myth_system_prompt.md](https://huggingface.co/dracko14/Myth-4B/blob/main/myth_system_prompt.md) ## Benchmarks *Benchmarks coming soon. Myth 4B inherits Qwen 3.5 4B's strong baseline with enhanced reasoning from Neo.* ## Training & Merge Details | Detail | Value | |---|---| | **Compute** | 8GB RAM VPS (CPU only) | | **Merge Time** | ~15 minutes (738 tensors) | | **Quantization** | llama.cpp (162 seconds) | | **Upload** | ~10 minutes | | **Total Cost** | $0 (free VPS + free HuggingFace) | ## Limitations - Base model knowledge cutoff applies - Performance on CPU may be slow (4B params) - Not fine-tuned for specific downstream tasks - May exhibit base model biases ## License MIT — open for all use cases. ## Links - 📄 [System Prompt](https://huggingface.co/dracko14/Myth-4B/blob/main/myth_system_prompt.md) - 🌐 [Space Documentation](https://huggingface.co/spaces/dracko14/myth) - ⚙️ [Fusion Engine](https://github.com/yourusername/myth-fusion) (coming soon) - 🧬 [Qwythos-9B-v2](https://huggingface.co/empero-ai/Qwythos-9B-v2) (Mythos-class 9B model) --- *Built with ❤️ using [myth_fusion.py](https://huggingface.co/spaces/dracko14/myth) — a custom SLERP fusion engine*