A 0.89B-parameter decoder-only base language model, pre-trained from scratch with
nanochat on one pass over ClimbMix (287B tokens). It is the smaller sibling of
castorini/gaggle-nanochat-pretrained-climbmix-20260924,
the 3.3B causal model described in the pre-training section of
Project Greenhouse: Progress Toward Fully Open and Sovereign Agentic Search,
trained on the same data with the same recipe. It has had no post-training (no instruction tuning or RLHF), so it
continues text rather than following instructions. The chat model made from it with nanochat's midtraining + SFT
recipe is castorini/gaggle-nanochat-0.9b-ift-climbmix-20261108,
and the reranker fine-tuned from it is castorini/gaggle-reranker-0.9b-20261108.
The same weights load three ways: with transformers (trust_remote_code=True), with vLLM (through a small
plugin), and with nanochat's own code from the original checkpoint files, which are unchanged.
| Architecture | nanochat decoder-only transformer: 32 layers, width 1,152, 9 attention heads of dimension 128, 2,048-token context |
| Components | rotary position embeddings, QK normalization, parameter-free RMSNorm, squared-ReLU MLP, untied input/output embeddings, logit soft-capping; a value embedding on every 4th layer (counting back from the last); 3 of every 4 layers use a 512-token sliding window |
| Parameters | 0.89B: 0.51B in the transformer blocks, 0.30B in the value-embedding tables, 0.08B in the input and output embeddings. Value embeddings are lookups, so per-token compute is that of a dense model of about 0.59B parameters. |
| Tokenizer | byte-level BPE, 32,768 entries: the 3.3B model's tokenizer, byte for byte |
| Code | karpathy/nanochat at commit 92d63d4, with one addition: the spacing of the value-embedding layers (ve_every), which stock nanochat fixes at every other layer |
The shape was chosen with a sweep of sub-1B nanochat models at a fixed 7B-token budget: at the same ~0.9B parameters, this deep and narrow shape with fewer value-embedding tables beat nanochat's own depth-20 model on both validation loss and CORE.
karpathy/climbmix-400b-shuffle),
one pass of 287B tokens. The last of its 6,543 shards is held out for validation. Documents are packed into
2,048-token sequences with nanochat's BOS-aligned best-fit packing.Base-model benchmarks that need no instruction following: CORE (nanochat's average centered accuracy over 22 in-context learning tasks, 500 examples each), and 5-shot MMLU and MMLU-Pro scored by the log-likelihood of the answer letter with the LM Evaluation Harness.
| Model | Parameters | Tokens | CORE | MMLU | MMLU-Pro |
|---|---|---|---|---|---|
| This model | 0.89B | 287B | 0.370 | 0.357 | 0.118 |
| Gaggle 3.3B | 3.29B | 283B | 0.458 | 0.493 | 0.178 |
| nanochat d34 | 2.2B | 89B | 0.338 | 0.257 | 0.115 |
The 3.3B and nanochat d34 rows are from the 3.3B model's card. Scored on every example instead of 500 per task, this model's CORE is 0.355.
Validation loss on the held-out ClimbMix shard is 0.658 bits per byte (3.3B model: 0.596).
Sequences must start with the BOS token <|bos|>, as in training. The transformers tokenizer adds it for you
(add_special_tokens=True, the default), and so does vLLM.
pip install "transformers>=4.57" "torch>=2.5"
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "castorini/gaggle-nanochat-0.9b-pretrained-climbmix-20261105"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16).to("cuda").eval()
inputs = tokenizer("The capital of France is", return_tensors="pt").to("cuda") # starts with <|bos|>
out = model.generate(**inputs, max_new_tokens=20, do_sample=False)
print(tokenizer.decode(out[0], skip_special_tokens=True))
Output on one NVIDIA RTX 6000 Ada GPU:
The capital of France is Paris. The capital of France is Paris. The capital of France is Paris. The capital of France
Log-likelihood of a continuation, as in the nanochat example below:
@torch.inference_mode()
def continuation_logprob(context, continuation):
ctx = tokenizer(context)["input_ids"] # starts with <|bos|>
cont = tokenizer(continuation, add_special_tokens=False)["input_ids"]
ids = torch.tensor([ctx + cont], device="cuda")
logp = torch.log_softmax(model(ids).logits[0, len(ctx) - 1:-1], -1)
return logp[torch.arange(len(cont)), torch.tensor(cont, device="cuda")].sum().item()
print(continuation_logprob("The capital of France is", " Paris")) # -0.3766
print(continuation_logprob("The capital of France is", " Berlin")) # -10.9051
These can differ from the nanochat example's printout in the last digits: in bf16, results depend on the GPU and
the attention kernel (nanochat uses Flash Attention 3 on Hopper GPUs when that kernel is available; this port always
uses PyTorch's scaled_dot_product_attention, nanochat's own fallback). On the same GPU with the same kernel, the two
produce bit-identical logits (see below).
trust_remote_code=True is needed because the architecture is nanochat's rather than one transformers ships;
configuration_gaggle.py and modeling_gaggle.py in this repo define it. They are plain PyTorch, import nothing
beyond torch and transformers, and are short enough to read first. No nanochat checkout and no Flash Attention
build are involved. They are the 3.3B model's files with the value-embedding spacing (ve_every, 4 here) added as a
setting; with its default of 2 they describe the 3.3B model exactly as before. model(input_ids).logits are fp32
and already soft-capped, as nanochat returns them; passing labels=input_ids gives the usual next-token loss. Batches
may be padded on either side.
With the LM Evaluation Harness, pass add_bos_token=True (it does not add special tokens by default):
lm_eval --model hf --model_args pretrained=castorini/gaggle-nanochat-0.9b-pretrained-climbmix-20261105,trust_remote_code=True,dtype=bfloat16,add_bos_token=True --tasks mmlu --num_fewshot 5
vLLM has no built-in class for this architecture, so install the small plugin that provides one (the 3.3B model's plugin, byte for byte; it needs vLLM 0.17 or newer); vLLM then finds it automatically:
pip install vllm https://huggingface.co/castorini/gaggle-nanochat-0.9b-pretrained-climbmix-20261105/resolve/main/vllm_gaggle-0.1.0-py3-none-any.whl
vllm serve castorini/gaggle-nanochat-0.9b-pretrained-climbmix-20261105 --trust-remote-code
from vllm import LLM, SamplingParams
llm = LLM("castorini/gaggle-nanochat-0.9b-pretrained-climbmix-20261105", trust_remote_code=True)
out = llm.generate(["The capital of France is"], SamplingParams(max_tokens=20, temperature=0))
print(out[0].outputs[0].text)
Output on one NVIDIA RTX 6000 Ada GPU (vLLM 0.17.0):
Paris. The capital of France is Paris. The capital of France is Paris. The capital of France
The plugin (vllm_plugin/ in this repo) registers the architecture through vLLM's vllm.general_plugins entry
point, so every vLLM process finds it; nothing in vLLM itself is changed. It reads the same config.json and
safetensors as transformers, including the value-embedding spacing. It runs on one GPU (no tensor parallelism) with
the model's 2,048-token context; we tested it in vLLM's default mode, with CUDA graphs and torch.compile. On one
RTX 6000 Ada, 256 prompts x 256 new tokens run at about 11,000 tokens/s.
GGUF files for Ollama and llama.cpp, which the 3.3B model has, are not provided for this model: the 3.3B model's llama.cpp port assumes a value embedding on every other layer.
The original training checkpoint is here, unchanged (model_229067.pt, meta_229067.json, tokenizer/). Stock
nanochat places a value embedding on every other layer, so apply the 15-line patch in this repo
(nanochat-92d63d4-ve_every.patch), which adds the ve_every setting and leaves models without it unchanged:
git clone https://github.com/karpathy/nanochat.git
cd nanochat && git checkout 92d63d4
curl -L https://huggingface.co/castorini/gaggle-nanochat-0.9b-pretrained-climbmix-20261105/resolve/main/nanochat-92d63d4-ve_every.patch | git apply
uv sync --extra gpu # use --extra cpu on a machine without a CUDA GPU
Save the following as example.py in the nanochat repository root (nanochat is imported from there, not
installed as a package) and run uv run --extra gpu --with huggingface_hub python example.py.
import os, torch
from huggingface_hub import snapshot_download
# only the nanochat files; the safetensors are for transformers and vLLM
path = snapshot_download("castorini/gaggle-nanochat-0.9b-pretrained-climbmix-20261105",
allow_patterns=["model_229067.pt", "meta_229067.json", "tokenizer/*"])
os.environ["NANOCHAT_BASE_DIR"] = path # nanochat loads the tokenizer from $NANOCHAT_BASE_DIR/tokenizer
from nanochat.checkpoint_manager import build_model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model, tokenizer, meta = build_model(path, step=229067, device=device, phase="eval")
# Greedy continuation
prompt = "The capital of France is"
ids = tokenizer.encode(prompt, prepend=tokenizer.get_bos_token_id())
new = list(model.generate(ids, max_tokens=20, temperature=0.0))
print(prompt + tokenizer.decode(new))
# Log-likelihood of a continuation given a context
@torch.inference_mode()
def continuation_logprob(context, continuation):
ctx = tokenizer.encode(context, prepend=tokenizer.get_bos_token_id())
cont = tokenizer.encode(continuation)
x = torch.tensor([ctx + cont[:-1]], device=device)
y = torch.tensor([[-1] * (len(ctx) - 1) + cont], device=device) # -1 = ignore context positions
return -model(x, targets=y, loss_reduction="sum").item()
print(continuation_logprob("The capital of France is", " Paris"))
print(continuation_logprob("The capital of France is", " Berlin"))
Output on one NVIDIA L40S GPU:
The capital of France is Paris. The capital of France is Paris. The capital of France is Paris. The capital of France
-0.37485089898109436
-10.875528335571289
Notes:
NANOCHAT_DTYPE=bfloat16|float16|float32.scripts/base_train.py,
scripts/chat_sft.py) with this checkpoint as the starting point.transformers, vLLM and nanochat load the same tensors. We checked them against nanochat's own forward pass on the
original checkpoint, which is what every number in the Evaluation section was computed with.
| Check | Result |
|---|---|
transformers vs nanochat, bf16 on an NVIDIA RTX 6000 Ada: logits of real text at 2 to 2,048 tokens |
bitwise identical |
| same, a right-padded batch vs nanochat on the same batch | bitwise identical |
| same, fp32 on CPU | bitwise identical at 5 of 8 lengths, and on the right-padded batch; at 300, 1,000 and 2,048 tokens, fp32 rounding (largest difference 1.6e-5, same top-1 token everywhere) |
| loss on a 2,048-token sequence | identical (2.4170 in bf16, 2.4168 in fp32) |
| greedy generation, 5 prompts x 48 tokens | identical token for token without the KV cache; with the cache, 3 of 5 in bf16 and 5 of 5 in fp32 on CPU |
| tokenizer vs nanochat's, 400 documents | identical ids, identical decoding |
tokenizer.json, tokenizer_config.json, generation_config.json vs the 3.3B model's |
byte-identical |
vLLM 0.17 vs transformers, fp32 on an NVIDIA RTX 6000 Ada: per-token log-probabilities of real text at 2 to 2,048 tokens |
mean difference 0.0009 to 0.0013 nats; all 5 greedy generations identical |
vLLM 0.17 vs transformers, bf16 |
mean difference 0.019 to 0.036 nats per token, the size of bf16 rounding; 2 of 5 greedy generations identical |
nanochat 92d63d4 + nanochat-92d63d4-ve_every.patch, the example below as written |
loads model_229067.pt; the same greedy continuation as transformers |
In bf16, any change of kernel shape — batching, padding, a KV cache, a different attention kernel — moves logits by
rounding, which can flip near-tied greedy choices after a few dozen tokens; nanochat itself behaves the same way.
convert_nanochat_to_hf.py is the converter that produced the safetensors from
model_229067.pt.
model.safetensors: the weights for transformers and vLLM. These are the tensors of model_229067.pt, unchanged
in value and dtype (fp32 matrices, bf16 embedding tables), renamed to model.<nanochat name> (lm_head.weight
keeps its name).config.json, generation_config.json, configuration_gaggle.py, modeling_gaggle.py: the architecture for
transformers (and the configuration vLLM reads).tokenizer.json, tokenizer_config.json: the tokenizer, converted from tokenizer/tokenizer.pkl; it encodes
every text exactly as nanochat does and prepends <|bos|>.model_229067.pt: model weights (nanochat state dict), for nanochat.meta_229067.json: model configuration, training configuration, and validation loss.tokenizer/: the 32,768-entry tokenizer in nanochat's format (tokenizer.pkl, token_bytes.pt).nanochat-92d63d4-ve_every.patch: adds the value-embedding spacing to nanochat 92d63d4.vllm_gaggle-0.1.0-py3-none-any.whl, vllm_plugin/: the vLLM plugin.convert_nanochat_to_hf.py: the converter.SHA256SUMS: checksums of every other file.Optimizer state is not included.
castorini/gaggle-nanochat-0.9b-ift-climbmix-20261108:
the chat model made from this checkpoint with nanochat's midtraining + SFT recipe (no RL).castorini/gaggle-reranker-0.9b-20261108: the
pointwise reranker fine-tuned from this checkpoint.castorini/gaggle-nanochat-pretrained-climbmix-20260924:
the 3.3B model, the same data and recipe at a larger size.If you use this checkpoint, please cite our paper:
@misc{lin2026projectgreenhouseprogressfully,
title={{Project Greenhouse}: Progress Toward Fully Open and Sovereign Agentic Search},
author={Jimmy Lin and Sahel Sharifymoghaddam and Lingwei Gu and Nour Jedidi},
year={2026},
eprint={2610.11922},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2610.11922}
}
Have the files? Publish a torrent.
Publish a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo castorini/gaggle-nanochat-0.9b-pretrained-climbmix-20261105 ./model-foldermodel_229067.pt 2.7 GiBmodel.safetensors 2.7 GiBtokenizer/token_bytes.pt 129.5 KiB