Model reference · open weights

nanowhale

LLMs HuggingFaceTB Text gen 1 build Open weights 949 dl/mo

nanowhale is an open-weight language model from Hugging Face. nanowhale-100m (FP32) weighs 221 MB; the smallest configuration that runs it is RTX 3060 12 GB.

  • nanowhale is a 110M parameter text-generation model created by Hugging Face that implements the DeepSeek-V4 architecture at a miniature scale.
  • It is fine-tuned for chat and instruction following in English with a context length of 2048 tokens.
  • The model is released under the Apache-2.0 license and is intended for educational purposes to demonstrate the architecture rather than for production use.

Summary of the HuggingFaceTB/nanowhale-100m model card, 2026-10-01

What it is

Released byHugging Face
Released2026-04-24
Parameters110M
VRAM221 MB for the weights

What it runs on

Memory and cards for nanowhale-100m (FP32)

221 MBweights, file size
3 MBcache per 1K tokens
656 MBruntime overhead, at least
2,048 tokenscontext max
CardRequests at onceContext maxMemory
2K each
RTX 3060 12 GB1000+all 2K11.6 GB
RTX 4060 Ti 16 GB1000+all 2K15.4 GB
RTX 3090 24 GB1000+all 2K23.4 GB
RTX 4090 24 GB1000+all 2K23.4 GB
RTX 5090 32 GB1000+all 2K31.0 GB
L40S 48 GB1000+all 2K44.0 GB
A100 80 GB1000+all 2K78.2 GB
H100 80 GB1000+all 2K78.1 GB
RTX PRO 6000 Blackwell 96 GB1000+all 2K93.8 GB
DGX Spark (GB10) 128 GB unified1000+all 2K107 GB
H200 141 GB1000+all 2K138 GB
B200 180 GB1000+all 2K176 GB
Memory needed at each load
Requests at once2K tokens each
1883 MB
5908 MB
8927 MB
16978 MB
321.1 GB
641.3 GB

One card, with vLLM's small-card settings.

From the model card

What Hugging Face says about nanowhale

Read the model card

A small ~110M parameter language model implementing the DeepSeek-V4 architecture, fine-tuned for chat/instruction following. Trained from scratch — no weights from DeepSeek-V4 were used.

Architecture

This model implements key DeepSeek-V4 innovations at a miniature scale:

ComponentDetails
Parameters~110M total (41M embeddings, 69M non-embedding)
Hidden size320
Layers8
Attention heads8 (1 KV head — MQA-style)
MLAMulti-head Latent Attention with q_lora_rank=160
MoE4 routed experts + 1 shared, top-2 routing
Hyper-Connectionshc_mult=4, Sinkhorn routing (replacing residual connections)
MTP1 next-token prediction layer
Vocab129,280 (DeepSeek-V4 tokenizer)
Context2,048 tokens

Training

Stage 1: Pretraining

  • Dataset: HuggingFaceFW/fineweb-edu
  • Steps: 5,000 | Tokens: ~2.6B
  • Batch: 32 effective (8 × 4 GA) | Seq length: 2,048
  • LR: 6e-4, cosine, 3% warmup
  • Precision: bf16 mixed

Stage 2: SFT (this model)

  • Dataset: HuggingFaceTB/smol-smoltalk (460K conversations)
  • Steps: 3,000 | Tokens: ~72.7M
  • Batch: 32 effective (8 × 4 GA) | Seq length: 2,048
  • LR: 2e-5, cosine, 5% warmup
  • Precision: fp32

Metrics

MetricPretrainedSFT
Eval loss—2.607
Perplexity (held-out)13.6212.90
Token accuracy33.8%48.5%

Usage

import torch
from safetensors.torch import load_file
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import hf_hub_download

# Load model (recommended: manual load for reliability)
config = AutoConfig.from_pretrained("HuggingFaceTB/nanowhale-100m", trust_remote_code=True)
model = AutoModelForCausalLM.from_config(config, trust_remote_code=True).float()

# Download and load weights
weights_path = hf_hub_download("HuggingFaceTB/nanowhale-100m", "model.safetensors")
state_dict = load_file(weights_path)
model.load_state_dict(state_dict, strict=True)
model = model.cuda().eval()

tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/nanowhale-100m")

# Chat
messages = [{"role": "user", "content": "What are 3 benefits of exercise?"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
input_ids = tokenizer.encode(prompt, return_tensors="pt").cuda()
output = model.generate(input_ids, max_new_tokens=200, temperature=0.7, top_p=0.9,
                        pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(output[0][input_ids.shape[1]:], skip_special_tokens=True))

Limitations

  • Tiny model: 110M params with 129K vocabulary — most capacity goes to embeddings. Generations are often incoherent or factually wrong.
  • Undertrained: Only 5K pretrain + 3K SFT steps. Production models train for 100K+ steps on trillions of tokens.
  • Educational purpose: This model demonstrates the DeepSeek-V4 architecture at small scale. It is not suitable for any production use.
  • bf16 NaN: Use fp32 — the Hyper-Connections architecture produces values that overflow bf16 range at this scale.
  • Custom code: Requires trust_remote_code=True.

Hardware

Trained on 1× NVIDIA H100 80GB.

License

Apache-2.0

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms