Text Generation
Transformers
Safetensors
GGUF
English
llama
tinybrainbot
small-language-model
from-scratch
gqa
math
arithmetic
conversational
text-generation-inference
Instructions to use nkthebass/tinybrainbot-350mV3-math with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nkthebass/tinybrainbot-350mV3-math with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nkthebass/tinybrainbot-350mV3-math") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nkthebass/tinybrainbot-350mV3-math") model = AutoModelForCausalLM.from_pretrained("nkthebass/tinybrainbot-350mV3-math", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use nkthebass/tinybrainbot-350mV3-math 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 nkthebass/tinybrainbot-350mV3-math:F16 # Run inference directly in the terminal: llama cli -hf nkthebass/tinybrainbot-350mV3-math:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf nkthebass/tinybrainbot-350mV3-math:F16 # Run inference directly in the terminal: llama cli -hf nkthebass/tinybrainbot-350mV3-math:F16
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 nkthebass/tinybrainbot-350mV3-math:F16 # Run inference directly in the terminal: ./llama-cli -hf nkthebass/tinybrainbot-350mV3-math:F16
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 nkthebass/tinybrainbot-350mV3-math:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf nkthebass/tinybrainbot-350mV3-math:F16
Use Docker
docker model run hf.co/nkthebass/tinybrainbot-350mV3-math:F16
- LM Studio
- Jan
- vLLM
How to use nkthebass/tinybrainbot-350mV3-math with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nkthebass/tinybrainbot-350mV3-math" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nkthebass/tinybrainbot-350mV3-math", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nkthebass/tinybrainbot-350mV3-math:F16
- SGLang
How to use nkthebass/tinybrainbot-350mV3-math 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 "nkthebass/tinybrainbot-350mV3-math" \ --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": "nkthebass/tinybrainbot-350mV3-math", "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 "nkthebass/tinybrainbot-350mV3-math" \ --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": "nkthebass/tinybrainbot-350mV3-math", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use nkthebass/tinybrainbot-350mV3-math with Ollama:
ollama run hf.co/nkthebass/tinybrainbot-350mV3-math:F16
- Unsloth Desktop
- Docker Model Runner
How to use nkthebass/tinybrainbot-350mV3-math with Docker Model Runner:
docker model run hf.co/nkthebass/tinybrainbot-350mV3-math:F16
- Lemonade
How to use nkthebass/tinybrainbot-350mV3-math with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nkthebass/tinybrainbot-350mV3-math:F16
Run and chat with the model
lemonade run user.tinybrainbot-350mV3-math-F16
List all available models
lemonade list
- Atomic Chat
Document what each generated dataset contains and the defect it fixed
Browse files
README.md
CHANGED
|
@@ -396,6 +396,33 @@ Then two merged adapters, 1 epoch each:
|
|
| 396 |
The `math-balanced*` generators are the ones that mattered; each fixed a specific measured
|
| 397 |
defect in its predecessor.
|
| 398 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 399 |
### Three notes for anyone reproducing this
|
| 400 |
|
| 401 |
* **The predecessor's recipe did not transfer.** Rounds math2/math3 ran the exact data mix
|
|
|
|
| 396 |
The `math-balanced*` generators are the ones that mattered; each fixed a specific measured
|
| 397 |
defect in its predecessor.
|
| 398 |
|
| 399 |
+
### What each dataset contains
|
| 400 |
+
|
| 401 |
+
All arithmetic sets are generated locally by deterministic scripts with fixed seeds, so every
|
| 402 |
+
label is exact by construction rather than model-generated. Names are opaque on their own, so:
|
| 403 |
+
|
| 404 |
+
| Dataset | Contents | The defect it addressed |
|
| 405 |
+
|---|---|---|
|
| 406 |
+
| `math-v3`, `math-v3fix` | column scratchpad in `ones:/tens:/hundreds:` form | the original format; `fix` corrects phantom place-value columns |
|
| 407 |
+
| `math-short`, `math-short2` | shorter arithmetic traces | the 320M recipe's traces were too long to learn from at this scale |
|
| 408 |
+
| `math-balanced` | explicit **(operation x operand-length)** joint distribution | lengths sampled independently let multiplication dominate the 2-digit band and steal addition's template |
|
| 409 |
+
| `math-balanced2` | + operation cue, worked partial-product sums | the model asserted partial-product sums it could not do mentally |
|
| 410 |
+
| `math-balanced3` | + equal-width subtraction | one extra phantom column on same-width problems |
|
| 411 |
+
| `math-balanced4` | + explicit `Pad 9 to 009.` statements | nothing distinguished real zero-padding from a column that should not exist |
|
| 412 |
+
| `math-phrased` | 30 question templates per operation | the model only recognised `"What is X plus Y?"` |
|
| 413 |
+
| `wp-calc` | word problems whose `<think>` block **runs** the column routine | traces asserted mental results instead of computing |
|
| 414 |
+
| `wp-cue` | one-step problems that **name the linguistic cue** before choosing an operation | `"drops in 836 more"` was being read as subtraction |
|
| 415 |
+
| `math-negative` | subtraction with negative results, explicit sign decision | every generator ordered its operands, so negatives were never trained *or tested* |
|
| 416 |
+
| `math-mult3` | 3-digit multipliers | the corpus contained **zero** examples with a multiplier wider than 2 digits |
|
| 417 |
+
|
| 418 |
+
Ballast, unchanged throughout: `smoltalk` and `qa-distill` (general instruction data, 9-11%
|
| 419 |
+
of every round) prevent the model degenerating into a calculator that cannot hold a sentence.
|
| 420 |
+
`reasoning-v2`, `gsm8k-cot` and `reasoning-math` are word-problem and chain-of-thought sets;
|
| 421 |
+
the last two are ~100% `<think>`-formatted, which is where that behaviour comes from.
|
| 422 |
+
|
| 423 |
+
The generators are deterministic - same seed, same bytes - so the exact training sets are
|
| 424 |
+
reconstructible from the scripts without needing the data itself.
|
| 425 |
+
|
| 426 |
### Three notes for anyone reproducing this
|
| 427 |
|
| 428 |
* **The predecessor's recipe did not transfer.** Rounds math2/math3 ran the exact data mix
|