Ned-Kelly-7M / README.md
candide23's picture
Pass trust_remote_code=True to AutoTokenizer in quickstart
de06737 verified
|
Raw History Blame Contribute Delete
6.08 kB
---
license: cc-by-nc-4.0
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- ned-kelly
- nothing-up
- tool-calling
- mamba-2
- hybrid
- australian
- small-language-model
- browser-llm
---
# Ned Kelly 7M
**Ned Kelly 7M** is an open, fully receipted **6,972,896-parameter** hybrid parallel Attention + Mamba-2 language model built by **[Nothing Up](https://nothingup.org)** β€” an Australian non-profit AI lab where every training input, setting, and evaluation reading can be checked end to end.
Weighing **27 MB** in full `float32` precision (verified to `0.000000` max logit diff against its native training weights), Ned Kelly 7M is built as a **browser-local tool caller** across Nothing Up's Tool Ontology v2 (`browser.js`, `browser.renvois`, `browser.lookup`, `browser.read_page`, `internet.news`) plus seven-level Australian content classification β€” with an unmistakably Australian voice, **0% Falcon distillation**, **0% `cc-by-nc-nd`**, and **0% unprovenanced text**.
## Links
- **Live site & browser console:** https://nothingup.org
- **Try Ned Kelly in your browser tab:** https://nothingup.org/ned-kelly
- **Full Corpus & Library:** https://nothingup.org/library
- **Library Wings (5 categories Γ— 5 rooms):** https://nothingup.org/library/wings
- **Leaderboard & Record Book:** https://nothingup.org/leaderboard
- **The Charter (5 Articles):** https://nothingup.org/purpose
- **Licensing:** https://nothingup.org/licensing
- **The Book (*Nothing Up*):** https://nothingup.org/book
- **Open-source training harness (GitHub):** https://github.com/Nothing-up-my-sleeve/nothing-up-my-sleeve
## Architecture & Provenance
| Field | Value |
|---|---|
| Parameters | **6,972,896** (`27 MB` `float32`, `max_logit_diff = 0.000000` vs native weights) |
| Architecture | Parallel Attention (4 heads, `head_dim=48`, QK-norm, RoPE) + Mamba-2 SSM (`d_inner=384`, 12 heads, `d_state=16`, `d_conv=4`) |
| Depth Γ— Width | 8 layers Γ— 192 width, SwiGLU (`intermediate_size=512`), RMSNorm, tied embeddings |
| Context window | 4,096 tokens |
| Tokeniser | 8,192-piece SentencePiece BPE (`byte_fallback=true`, 19 single-piece control tokens) |
| Training | `7.13B` tokens base pretrain (`7m@c9`, 1,022 tok/param) + `467M`-token two-seed aims-decay soup (`7m@c9-hf-topup-soup`, `f410eebfc081`) |
| Provenance | `au-v10` β€” 0% Falcon distillation, 0% `cc-by-nc-nd`, 0% unprovenanced. Inspect every title, source, rights line, and SHA-256 at https://nothingup.org/library and https://nothingup.org/library/wings |
## Evaluations
All readings below are on **`7m@c9-hf-topup-soup` (`f410eebfc081`)** compared against 13–23Γ— larger open models evaluated under the same harness:
| Benchmark / Metric | **Ned Kelly 7M** | Falcon-TC-90M (13Γ—) | Falcon-90M (13Γ—) | SmolLM2-135M (19Γ—) | Pythia-160M (23Γ—) |
|---|---:|---:|---:|---:|---:|
| **`task-bpb/mean`** ↓ | **0.5459** | 1.218 | 1.454 | 1.194 | 1.571 |
| **`task-bpb/tools`** ↓ | **0.6061** | 1.363 | 1.586 | 1.475 | 1.829 |
| **`task-bpb/bfcl`** ↓ | **0.5217** | 0.606 | 0.848 | 0.754 | 1.163 |
| **`task-bpb/reasoning`** ↓ | **0.7381** | 1.164 | 1.437 | 0.807 | 1.180 |
| **`task-bpb/ratings`** ↓ | **0.3175** | 1.739 | 1.946 | 1.740 | 2.111 |
| **`when2call/acc`** ↑ | **0.4685** (`macro_f1 0.292`) | 0.425 (`0.277`) | 0.355 (`0.233`) | 0.410 (`0.231`) | 0.325 (`0.201`) |
| **AU 7-level `ratings/right`** ↑ | **0.2967** (`within_1 0.720`) | 0.217 (`0.432`) | 0.035 (`0.282`) | 0.155 (`0.337`) | 0.195 (`0.410`) |
| **`ontology_v2/overall`** ↑ | **0.2353** (**`rbac 1.00`**, **`restraint 1.00`**) | β€” | β€” | β€” | β€” |
| **`au_talk/pass`** ↑ | **0.3267** (`stopped 0.860`, `fluent 0.767`) | β€” | β€” | β€” | β€” |
| **`hole-cards-unseen` bpb** ↓ | **1.4397** | β€” | β€” | β€” | β€” |
| **`bfcl/single_turn`** ↑ | **0.1625** (`irrelevance 0.975`) | β€” | β€” | β€” | β€” |
| **De Morgan Maths (log-prob)** ↑ | **0.2639** (`hansard-days 0.533` w/ `browser.js`) | β€” | β€” | β€” | β€” |
| **IFEval (`prompt_strict`)** ↑ | `0.1146` closed / `0.1458` tool-frame (`n=96`) | β€” | `0.2237` raw / `0.5601` chat | β€” | β€” |
## Quickstart (`transformers`)
Because Ned Kelly uses a custom parallel Attention + Mamba-2 block with a native hybrid KV + Mamba-2 cache, pass `trust_remote_code=True` (self-contained `configuration_ned_kelly.py` and `modeling_ned_kelly.py` are included in this repository):
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "nothing-up/Ned-Kelly-7M"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True)
model.eval()
prompt = "<question>What happened in Australian news in the last 4 hours?<answer>"
inputs = tok(prompt, return_tensors="pt")
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=96, do_sample=False)
print(tok.decode(out[0], skip_special_tokens=False))
```
## What It Does β€” and What It Does Not
- **Built for:** Fast, private browser-local tool calling across Nothing Up's Tool Ontology v2 (`browser.js`, `browser.renvois`, `browser.lookup`, `browser.read_page`, `internet.news`), delegating calculation and encyclopaedic lookup to tools rather than memorising facts in 7M weights, plus Australian seven-level content classification and clean permission restraint (`1.00` RBAC compliance).
- **Not built for:** Open-ended essay writing, zero-shot trivia from memory, or complex instruction-formatting gymnastics (`14.6%` prompt-strict on IFEval). For native reasoning and child-safety education, see **Edith Cowan 70M** on [nothingup.org/leaderboard](https://nothingup.org/leaderboard).
## Licensing
- **Model weights & corpus:** [CC BY-NC 4.0](LICENSE) β€” train, run, and share freely for any non-commercial purpose with attribution. Commercial release requires prior written approval from Nothing Up. See [NOTICE.md](NOTICE.md) and https://nothingup.org/licensing.
- **Code & modeling files (`configuration_ned_kelly.py`, `modeling_ned_kelly.py`):** Apache-2.0.