Downloads · 30 days
58
20% of all-time downloads
ayushhh1010/nanoserve-27m
nanoserve-27m is a text generation model from ayushhh1010. Use it when you need the model to write or continue text. The card lists the license as mit.
A 26,747,392-parameter decoder-only transformer trained from scratch on TinyStories V2. The architecture, the tokenizer and the training loop were all written by hand -- no AutoModel, no tokenizers library.
Downloads · 30 days
58
20% of all-time downloads
All-time downloads
296
Public
Parameters
26.7M
107 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors107 MB · 100%
From the Hugging Face model README
A 26,747,392-parameter decoder-only transformer trained from scratch on
TinyStories V2. The architecture, the tokenizer and the training loop were all
written by hand -- no AutoModel, no tokenizers library.
It writes short children's stories. It is not a general-purpose assistant and cannot answer questions, follow instructions, or reason. That is the specification, not a shortfall.
| Parameters | 26,747,392 |
| Training tokens | 536,174,127 |
| Validation loss | 1.1485 nats/token |
| Perplexity | 3.153 |
| Hardware | single RTX 3050 Laptop (4 GB) |
| Wall clock | 3.27 hours |
d_model / layers / heads | 512 / 8 / 8 |
| KV heads | 2 (grouped-query attention) |
d_ff | 1408 (SwiGLU) |
| Norm / position | RMSNorm pre-norm / RoPE |
| Vocabulary / context | 8,192 / 1,024 |
| Embeddings | tied |
Parameter names mirror HuggingFace's Llama, so the weights load into a
LlamaForCausalLM of matching shape.
from model.tokenizer import BPETokenizer
from model.generate import load_model, generate, SamplingParams
tok = BPETokenizer.load("tokenizer.json")
model, _ = load_model("model.safetensors", device="cuda")
print(generate(
model, tok,
"Once upon a time, there was a little girl named Lily who",
SamplingParams(max_new_tokens=200, temperature=0.8),
))
TinyStories V2 (GPT-4 generated). 536,174,127 tokens under a purpose-built 8,192-token byte-level BPE vocabulary, which compresses this corpus to 3.965 bytes/token with 98.1% of words encoding to a single token.
Token count was chosen to sit at the Chinchilla-optimal ratio for the parameter count (~20 tokens per parameter).
Trained as Phase 1 of Nanoserve, a project that trains a small language model and then builds the distributed system that serves it.