How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf allbilly/nanochat-d12-rl:BF16
# Run inference directly in the terminal:
llama cli -hf allbilly/nanochat-d12-rl:BF16
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf allbilly/nanochat-d12-rl:BF16
# Run inference directly in the terminal:
llama cli -hf allbilly/nanochat-d12-rl:BF16
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf allbilly/nanochat-d12-rl:BF16
# Run inference directly in the terminal:
./llama-cli -hf allbilly/nanochat-d12-rl:BF16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf allbilly/nanochat-d12-rl:BF16
# Run inference directly in the terminal:
./build/bin/llama-cli -hf allbilly/nanochat-d12-rl:BF16
Use Docker
docker model run hf.co/allbilly/nanochat-d12-rl:BF16
Quick Links

nanochat d12 (rl)

Native nanochat checkpoint exported from chatrl_checkpoints/d12 step 933.

Formats in this repo

File Use
model.safetensors HF-layout weights (model.* keys)
model_000933.pt Resume training in nanochat
*.gguf llama.cpp inference (lukas-h/llama.cpp fork required)
tokenizer.pkl nanochat / GGUF tokenizer

Load in nanochat

export NANOCHAT_BASE_DIR=~/.cache/nanochat
# copy model_*.pt + meta_*.json into chatsft_checkpoints/d12/ (or chatrl_checkpoints/d12/)
python -m scripts.chat_cli -i rl -g d12

GGUF inference

Stock llama.cpp does not support nanochat. Use lukas-h/llama.cpp:

./build/bin/llama-completion -m nanochat-d12-rl-bf16.gguf \
  -p '<|user_start|>Hello<|user_end|><|assistant_start|>' --special -no-cnv -n 128

Special tokens: <|bos|>, <|user_start|>, <|user_end|>, <|assistant_start|>, <|assistant_end|>, <|python_start|>, <|python_end|>, <|output_start|>, <|output_end|>

Downloads last month
72
Safetensors
Model size
0.3B params
Tensor type
F32
·
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support