Instructions to use SmallAICreator/MiniGPT3-22M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SmallAICreator/MiniGPT3-22M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SmallAICreator/MiniGPT3-22M")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SmallAICreator/MiniGPT3-22M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SmallAICreator/MiniGPT3-22M with 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 SmallAICreator/MiniGPT3-22M:F16 # Run inference directly in the terminal: llama cli -hf SmallAICreator/MiniGPT3-22M:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SmallAICreator/MiniGPT3-22M:F16 # Run inference directly in the terminal: llama cli -hf SmallAICreator/MiniGPT3-22M:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf SmallAICreator/MiniGPT3-22M:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf SmallAICreator/MiniGPT3-22M:F16
Use Docker
docker model run hf.co/SmallAICreator/MiniGPT3-22M:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use SmallAICreator/MiniGPT3-22M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SmallAICreator/MiniGPT3-22M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SmallAICreator/MiniGPT3-22M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SmallAICreator/MiniGPT3-22M:F16
- SGLang
How to use SmallAICreator/MiniGPT3-22M with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SmallAICreator/MiniGPT3-22M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SmallAICreator/MiniGPT3-22M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SmallAICreator/MiniGPT3-22M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SmallAICreator/MiniGPT3-22M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use SmallAICreator/MiniGPT3-22M with Ollama:
ollama run hf.co/SmallAICreator/MiniGPT3-22M:F16
- Unsloth Desktop
- Docker Model Runner
How to use SmallAICreator/MiniGPT3-22M with Docker Model Runner:
docker model run hf.co/SmallAICreator/MiniGPT3-22M:F16
- Lemonade
How to use SmallAICreator/MiniGPT3-22M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SmallAICreator/MiniGPT3-22M:F16
Run and chat with the model
lemonade run user.MiniGPT3-22M-F16
List all available models
lemonade list
- Atomic Chat
MiniGPT3-22M
MiniGPT3 is a tiny hybrid Mamba2 + attention language model trained from scratch by UltraLabs (SmallAICreator).
It follows MiniGPT2 and uses the NVIDIA Nemotron-H layer layout, so it loads with
transformers (NemotronHForCausalLM) and runs in llama.cpp (nemotron_h) on phones.
| Parameters | 27.0M total: 16.5M "brain" (non-embedding) + 10.5M embeddings (untied, 16K vocab) |
| Layers | 24: 9 × Mamba2, 3 × attention, 12 × ReLU² MLP (pattern M-M-*-M-M-M-*-M-M-M-*-M-) |
| Width | d_model 320, MLP 1280, Mamba2 10 heads × 64 (state 64), attention 5 query / 1 KV heads × 64 |
| Positions | none (the Mamba2 layers carry order; attention has no positional encoding) |
| Vocab | 16,384 byte-level BPE (the MiniGPT2 tokenizer) |
| Context | 2,048 tokens (trained) |
| Pretraining | 37.7B tokens |
Files
| Folder / file | What it is |
|---|---|
final/ |
The chat model: pretraining + SFT + DPO. Use this one. |
sft/ |
Pretraining + SFT, before DPO |
pretrain-final/ |
The base model after the full cosine decay (continues text, doesn't chat) |
MiniGPT3-22M-F16.gguf |
final/ for llama.cpp / phone apps (54.7 MB) |
MiniGPT3-22M-pretrain-final-F16.gguf |
pretrain-final/ for llama.cpp (base, text completion) |
checkpoint/, pretrain-s1/ |
Training checkpoint and the session-1 (undecayed) base |
Training
- Pretraining (JAX): session 1 on a Kaggle TPU v5e-8 at peak LR (
36B tokens), then a cosine decay to 2% on 2× T4 (1.7B tokens). The second half of the decay blends in a knowledge/maths anneal mix: synthetic arithmetic, FineMath, MegaMath, WebInstructSub, Cosmopedia, Wikipedia, TinyStories and wikiHow. Muon + AdamW optimizers. - SFT: 489 steps on smol-smoltalk (67%), Tulu 3 (28%), distilled answers (5%) and an identity set.
- DPO: 195 steps on Anthropic hh-rlhf preference pairs.
Benchmarks
lm-evaluation-harness 0.4.13, 0-shot, fp32, HF backend. The average uses arc_e acc_norm, arc_c acc_norm, hellaswag acc_norm, lambada_openai acc, piqa acc_norm and winogrande acc.
| Model | Brain (non-emb.) | ARC-E | ARC-C | HellaSwag | LAMBADA | PIQA | WinoGrande | Avg |
|---|---|---|---|---|---|---|---|---|
MiniGPT3-22M final |
16.5M | 37.16 | 22.01 | 28.73 | 24.72 | 58.38 | 49.80 | 36.80 |
MiniGPT3-22M pretrain-final |
16.5M | 36.28 | 22.27 | 28.84 | 26.30 | 57.89 | 49.17 | 36.79 |
| MiniGPT2-22M | 15.7M | 40.0 | 23.1 | 28.2 | 23.1 | 58.1 | 50.0 | 37.08 |
| TinyBrainBot-25M v4 base | 25.2M | 42.09 | 24.91 | 28.86 | 22.78 | 60.23 | 52.57 | 38.57 |
All rows were run on the same harness and settings (TinyBrainBot re-run on 2026-11-24, reproducing its earlier 38.6).
- LAMBADA (predicting the next word from the whole passage) is MiniGPT3's strength: +3.5 over TinyBrainBot and +3.2 over MiniGPT2, with a brain ~1.5x smaller than TinyBrainBot's. It writes noticeably more fluent text than both.
- HellaSwag is a tie with TinyBrainBot (28.84 vs 28.86). TinyBrainBot leads on the knowledge/reasoning tasks (ARC, PIQA, WinoGrande), which puts it 1.8 points ahead on the average.
- For scale: Pythia-70M (~19M brain) averages 36.57 on the same six tasks.
Usage
transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("SmallAICreator/MiniGPT3-22M", subfolder="final")
model = AutoModelForCausalLM.from_pretrained("SmallAICreator/MiniGPT3-22M", subfolder="final")
msgs = [{"role": "user", "content": "Write a haiku about the ocean."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=80, do_sample=True, temperature=0.7, top_p=0.9)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
llama.cpp / phone: load MiniGPT3-22M-F16.gguf in any llama.cpp-based app with Nemotron-H support (for example
L-AI). The chat template is embedded in the file.
Chat format: <|user|>…<|end|><|assistant|>…<|end|>
Limitations
This is a 22M-parameter model. It is fluent at short text but has very little world knowledge, gets facts and arithmetic wrong, and can repeat itself. Use it for experiments, on-device demos and research on small models, not for anything that needs reliable answers.
Made by UltraLabs · SmallAICreator
- Downloads last month
- -
16-bit