Downloads · 30 days
125
100% of all-time downloads
MineAITechnology/mine-o1-nano
mine-o1-nano is a text generation model from MineAITechnology. Use it when you need the model to write or continue text. It is set up for flax. The card lists the license as apache-2.0.
A 124M-parameter GPT-2-style language model, pre-trained from scratch in JAX/Flax NNX on a TPU v5e-8, then supervised fine-tuned in three rounds.
Downloads · 30 days
125
100% of all-time downloads
All-time downloads
125
Public
Repo size
1.5 GB
Likes
4
Public
Click a slice to open those files.
.onnx1 GB · 68%
From the Hugging Face model README
A 124M-parameter GPT-2-style language model, pre-trained from scratch in JAX/Flax NNX on a TPU v5e-8, then supervised fine-tuned in three rounds.
Built by MineAI Technology, Islamabad, Pakistan: a small, independent team building a sovereign foundation model from the ground up rather than fine-tuning an existing base.
| 📄 Technical paper | 10.5281/zenodo.21993150 |
| 🌐 Platform | getmineai.net |
| 👤 Author | Bilal Mehtab, ORCID 0009-0000-3085-8559 |
| 📜 License | Apache 2.0 |
Honesty note: This card states benchmark numbers and known failure modes plainly, including the ones that don't look good. Read Limitations before deciding whether this model fits your use case.
It is:
It is not:
| Architecture | GPT-2 Small style, decoder-only Transformer, pre-norm |
| Parameters | 124M |
| Layers | 12 |
| Attention heads | 12 (64 dim each) |
| Hidden size | 768 |
| Feed-forward size | 3072 (GELU) |
| Context length | 1024 tokens |
| Vocabulary | 50,259 tokens (GPT-2 BPE base of 50,257 plus 2 custom special tokens) |
| Special tokens | <|user|>, <|assistant|> |
| Embeddings | Tied input/output |
| Framework | JAX + Flax NNX + Optax |
| Training hardware | Kaggle TPU v5e-8 |
| Inference hardware | AWS t3.small (CPU), Flax NNX decode/cache mode |
Each block is: masked multi-head self-attention → residual → layer norm → feed-forward (768→3072→768, GELU) → residual, repeated 12 times.
<img src="assets/mine_o1_nano_architecture.png" alt="mine:o1-nano full architecture" width="500"/> <details> <summary>Detailed block diagram (attention + FFN internals)</summary> <img src="assets/gpt2_detailed_block_architecture.png" alt="Detailed transformer block" width="700"/> </details> <details> <summary>Causal (masked) self-attention illustration</summary> <img src="assets/masked_self_attention.png" alt="Causal self-attention" width="600"/> </details>| File / folder | Approx. size | Use it for |
|---|---|---|
model.onnx | 535 MB | Full-precision (fp32) ONNX export. Reference and any ONNX runtime |
model.fp16.onnx | 335 MB | Half-precision ONNX. Smaller, near-identical outputs |
model.quant.onnx | 134 MB | Quantized ONNX. Fastest on CPU; the hardware class the live demo runs on |
ocdbt.process_0/, array_metadatas/, d/, _METADATA, _CHECKPOINT_METADATA, _sharding, manifest.ocdbt | ~1.4 GB | Orbax checkpoint for JAX / Flax NNX. Use to continue training or fine-tune |
assets/ | ~1.5 MB | Architecture and evaluation figures used in this card |
evaluation_reports/ | ~70 KB | Full, unedited SFT and decoding evaluation reports |
LICENSE | Apache License 2.0 |
Which one should I use?
| Goal | Use |
|---|---|
| Run on CPU, lowest latency | model.quant.onnx |
| Run on CPU, closest to original outputs | model.fp16.onnx |
| Reference or debugging | model.onnx |
| Continue training or fine-tune in JAX | Orbax checkpoint |
Quantization can shift outputs slightly. If exact behavior matters, compare against model.fp16.onnx.
pip install onnxruntime transformers numpy huggingface_hub
import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
from transformers import GPT2TokenizerFast
REPO = "MineAITechnology/mine-o1-nano"
# GPT-2 BPE plus the two custom chat markers
tok = GPT2TokenizerFast.from_pretrained("gpt2")
tok.add_special_tokens({"additional_special_tokens": ["<|user|>", "<|assistant|>"]})
path = hf_hub_download(REPO, "model.quant.onnx")
sess = ort.InferenceSession(path, providers=["CPUExecutionProvider"])
# Check the exact input/output signature of the export before writing a loop
print([(i.name, i.shape, i.type) for i in sess.get_inputs()])
print([(o.name, o.shape, o.type) for o in sess.get_outputs()])
prompt = "<|user|> Who are you? <|assistant|>"
ids = np.array([tok.encode(prompt)], dtype=np.int64)
logits = sess.run(None, {sess.get_inputs()[0].name: ids})[0]
print(repr(tok.decode([int(logits[0, -1].argmax())])))
The snippet performs one greedy step to confirm the export loads and runs. For real generation, loop over tokens with the decoding settings below. Inputs and outputs depend on how the ONNX graph was exported (with or without a KV cache or attention mask), so check the printed signature first.
Download the Orbax checkpoint and restore it with Orbax into a Flax NNX GPT-2-style module matching the model summary dimensions. The training and model-definition code is not published (see Source code status), so you need to recreate the module with the same shapes (12 layers, 12 heads, 768 hidden, 3072 FFN, 1024 context, 50,259 vocab, tied embeddings).
from huggingface_hub import snapshot_download
local = snapshot_download(
"MineAITechnology/mine-o1-nano",
allow_patterns=["ocdbt.process_0/*", "array_metadatas/*", "d/*",
"_METADATA", "_CHECKPOINT_METADATA", "_sharding", "manifest.ocdbt"],
)
print(local)
The model was fine-tuned with two turn markers:
<|user|> {user message} <|assistant|>
Generation continues after <|assistant|>. Stop when the model emits a new <|user|> or hits your length limit.
Recommended decoding settings:
| Parameter | Value |
|---|---|
temperature | 0.7 |
top_k | 40 |
top_p | 0.9 |
repetition_penalty | 1.3 |
Do not use greedy decoding. The evaluation reports show that repetition loops, role inversion, and refusal-then-comply contradictions in early checkpoints were decoding artifacts, not training gaps. They were resolved by these sampling settings alone.
<|user|> / <|assistant|> turn markers.| Hyperparameter | Value |
|---|---|
| Architecture | GPT-2 |
| Dataset | OpenWebText |
| Batch size | 64 |
| Embedding dim | 768 |
| Feed-forward dim | 3072 |
| Initial learning rate | 5e-4 |
| Max steps | 80,000 |
| Attention heads | 12 |
| Transformer layers | 12 |
| Sequence length | 1024 |
| Weight decay | 0.1 |
| Final train loss | 3.1932 |
| Final validation loss | 3.20313 |
| Runtime | 4h 57m 45s |
| Platform | Kaggle (TPU v5e-8) |
Three rounds (SFT1 → SFT2 → SFT3), each targeting specific behavioral gaps found through structured evaluation rather than informal spot checks:
| Round | Focus |
|---|---|
| SFT1 | Initial chat behavior and identity (checkpoint at step 3388) |
| SFT2 | Identity, location and creator disclosure, arithmetic |
| SFT3 | Targeted supplementary arithmetic data, final comprehensive evaluation |
Evaluated on WikiText-2, WikiText-103, and LAMBADA using non-overlapping stride windows matching the original GPT-2 paper's methodology (Kaggle GPU T4x2).
<img src="assets/wikitext103_zeroshot_comparison.png" alt="WikiText-103 zero-shot perplexity comparison" width="650"/>The chart compares zero-shot WikiText-103 perplexity only, since that is the fairest like-for-like comparison. mine:o1-nano currently sits behind compressed and distilled GPT-2 variants (TQCompressedGPT2, KnGPT-2, Krony-PT). That is an honest reflection of being an early, from-scratch checkpoint rather than a compression of an already-trained larger model.
Not shown on the chart: GPT-2 and DistilGPT2. Their commonly cited WikiText-103 numbers (16.3 and 21.1) come from a fine-tuned setup, not zero-shot, so including them would misstate the gap. GPT-2's own zero-shot number from its original paper (Section 5.1) is 37.5.
Behavior was evaluated with fixed test sets (Set A / Set B, a 20-question arithmetic stress test, identity and creator-disclosure probes) and one unscripted out-of-distribution probe. See the next two sections and the full reports in evaluation_reports/.
Left: Set A/B scores across decoding experiments (R1: greedy → R2: temperature → R3: temperature + repetition penalty + nucleus sampling) and the SFT2 continued fine-tune. Most early gains came from decoding strategy, not retraining.
Right: Basic arithmetic accuracy on a fixed 20-question test, by SFT round. Decoding changes could not move this metric; it required a targeted data round (SFT3).
mine:o1-nano from MineAI Technology. An early checkpoint hallucinated being "a UC Berkeley professor".temperature=0.7, top_k=40, top_p=0.9, repetition_penalty=1.3.MineAI Technology's policy is to report benchmarks and limitations honestly rather than promotionally.
mine:o1-nano is NOT production-ready for open-ended, free-text deployment. It suits narrow, scripted use cases: an FAQ-style assistant with known prompt formats, or a widget with suggested prompts rather than open free-text chat.
On the scripted test suite it scored strongly (19/20 math, 7/7 identity, clean Set A/B). On the unscripted real-world probe using casual phrasing it hadn't seen in training, 4 of 10 exchanges failed:
| Failure mode | Example |
|---|---|
| Sensitive-topic mishandling | "i got breakup with my girlfriend" → incoherent, non-empathetic, garbled response. No training data covers emotionally sensitive topics. |
| Math boundary errors | "what is 90+10" → answered 120 (should be 100), despite 19/20 accuracy in the core trained range. Suggests memorized number pairs rather than generalized addition. |
| Follow-up brittleness | "is he founder or CEO?" → fell back to a memorized identity string instead of answering. |
| Casual-phrasing deflection | "i want to know about ur owner & company?" → deflected, despite this being well-covered training territory in standard phrasing. |
What is and isn't ready
| ✅ Ready | ❌ Not ready |
|---|---|
| Identity, company and creator disclosure (even with novel phrasing) | Sensitive or emotional topic handling (no safety behavior trained) |
| Greetings and casual small talk | Arithmetic generalization at range boundaries or with casual phrasing |
| Scripted arithmetic within trained ranges and formats | Natural conversational follow-ups outside the trained prompt structure |
As with any 124M-parameter model, these are known limitation classes at this scale and not specific to this training pipeline. They are stated plainly rather than around.
Suitable
Not recommended
This repository releases the trained weights (Orbax checkpoint and ONNX exports), the model card, and the evaluation reports.
The training pipeline, data-processing code, and infrastructure are not included in this release. The architecture is standard GPT-2 Small and fully specified in the model summary, so the model can be re-instantiated from the checkpoint without them.
<!-- If you publish source code later, replace this section with a link to the code repository and its license. -->Perplexity was measured with non-overlapping stride windows following the GPT-2 paper's protocol, on WikiText-2, WikiText-103, and LAMBADA, on Kaggle GPU T4x2. The full method, decoding configurations, prompt sets, and raw results for every SFT round are in evaluation_reports/:
| Report | Contents |
|---|---|
SFT1_Evaluation_Report.pdf | Initial SFT checkpoint (step 3388), Set A and B |
SFT_Decoding_Report2.pdf | Greedy vs. temperature sampling |
SFT_Decoding_Report3.docx | Adding repetition penalty and nucleus sampling |
SFT2_Main_Report.docx | Continued fine-tune: identity, location and creator disclosure, arithmetic |
SFT3_Final_Report.docx | Final report and real-world out-of-distribution probe |
Released under the Apache License 2.0. You may use, modify, and distribute the weights commercially, provided you keep the license and attribution notices and state significant changes. Apache 2.0 also includes an express patent grant.
The GPT-2 BPE tokenizer vocabulary originates from OpenAI's GPT-2 release (MIT licensed). The pre-training dataset was OpenWebText; check its terms if data provenance matters for your use case.
If you use this model or reference these results, please cite the Zenodo record:
@misc{mehtab2026mineo1nano,
author = {Mehtab, Bilal},
title = {mine:o1-nano: A 124M-parameter GPT-2-style language model pre-trained from scratch in JAX/Flax NNX},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.21993150},
url = {https://doi.org/10.5281/zenodo.21993150}
}
MineAI Technology, Islamabad, Pakistan