# nanowhale

- **ID:** 599
- **Kind:** code
- **URL:** https://github.com/huggingface/nanowhale
- **Authors:** cmpatino
- **Venue:** Hugging Face (GitHub)
- **Published:** 2026
- **Source:** github
- **Access:** free
- **License:** MIT
- **License family:** Permissive (auto-classified)
- **Tags:** nanowhale, deepseek-v4, moe, mla, hyper-connections, huggingface, small-lm
- **Topics:** DeepSeek-V4, small LMs, MoE, MLA
- **Added:** 2026-08-14
- **Verified:** 2026-08-14
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/599

## Summary

huggingface/nanowhale ports DeepSeek-V4 (MLA, 4+1 MoE with top-2, Hyper-Connections hc_mult=4 / Sinkhorn, MTP) into HF Trainer/SFTTrainer at hidden 320 / 8 layers / vocab 129,280 / ctx 2048 (~110M params: 41M embed + 69M non-embed). Pretrain 5K steps on FineWeb-Edu (~2.6B tokens, final loss ~5.3, 1×H100) then 3K-step SmolTalk SFT. Checkpoints on HF as cmpatino/nanowhale-100m-base and cmpatino/nanowhale-100m. README flags bf16 NaNs from Hyper-Connections at this scale (use fp32) and a from_pretrained re-init quirk. README license MIT; GitHub API has no SPDX (no LICENSE file). Companion HF base card is Apache-2.0.

## Attributes

- **Purpose:** Train a ~110M DeepSeek-V4-architecture LM from scratch as a miniature reference implementation
- **Scale:** 386 stars; 45 forks at check. ~110M params; pretrain 5K steps / ~2.6B tokens; SFT 3K steps. Held-out PPL 13.62 (base) / 12.90 (SFT) in the README.
- **Time period:** GitHub created 2026-05-04; pushed 2026-05-04; updated 2026-08-13. Discord posted 2026-05-08.

## From the source (fetched 2026-10-03)

- **Repository:** huggingface/nanowhale (GitHub)
- **Created:** May 4, 2026 (GitHub)
- **Last push:** May 4, 2026 (GitHub)
- **Stars:** 390 (GitHub)
- **Forks:** 44 (GitHub)
- **Main language:** Python (GitHub)

## Research notes

- Primary: GitHub README + API (README MIT, API license null / no LICENSE file; Python; 386 stars / 45 forks at check). Weights live at cmpatino/nanowhale-100m-base (HF card Apache-2.0, 4 likes at check) and cmpatino/nanowhale-100m; not copied into hf_* because the leftover is the GitHub training repo. Discord posted the repo. Training uses public FineWeb-Edu / SmolTalk, so no datasets_local row.

## Related entries

- Discussed in: [Mixture-of-experts language models: where the work is (overview)](https://papers.projxon.ai/entries/1206) (note, #1206)

## Similar entries

- [DeepSeek-V3 Technical Report](https://papers.projxon.ai/entries/566) (paper, #566)
- [LongCat Sparse Attention: Taming the Lightning via Streaming-aware Hierarchical Cross-Layer Indexing](https://papers.projxon.ai/entries/452) (paper, #452)
- [Periodic Weak Spots: Phase Sensitivity from Chunked KV-Cache Compression](https://papers.projxon.ai/entries/1322) (paper, #1322)
- [Kolibri-1: 78B Open-Weight MoE with 3.46B Active Parameters and Hybrid SWA](https://papers.projxon.ai/entries/1223) (model, #1223)
- [PithTrain: A Compact and Agent-Native MoE Training System](https://papers.projxon.ai/entries/481) (paper, #481)
- [Inkling: open-weight controllable-effort multimodal MoE](https://papers.projxon.ai/entries/637) (model, #637)
