Instructions to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nkthebass/tinybrainbot-53m-a9m-hybrid-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nkthebass/tinybrainbot-53m-a9m-hybrid-instruct") model = AutoModelForCausalLM.from_pretrained("nkthebass/tinybrainbot-53m-a9m-hybrid-instruct", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct 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-53m-a9m-hybrid-instruct:F16 # Run inference directly in the terminal: llama cli -hf nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16 # Run inference directly in the terminal: llama cli -hf nkthebass/tinybrainbot-53m-a9m-hybrid-instruct: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 nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
Use Docker
docker model run hf.co/nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nkthebass/tinybrainbot-53m-a9m-hybrid-instruct" # 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-53m-a9m-hybrid-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
- SGLang
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct 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-53m-a9m-hybrid-instruct" \ --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-53m-a9m-hybrid-instruct", "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-53m-a9m-hybrid-instruct" \ --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-53m-a9m-hybrid-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with Ollama:
ollama run hf.co/nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
- Unsloth Desktop
- Pi
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with Docker Model Runner:
docker model run hf.co/nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
- Lemonade
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
Run and chat with the model
lemonade run user.tinybrainbot-53m-a9m-hybrid-instruct-F16
List all available models
lemonade list
- Hermes Agent
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use nkthebass/tinybrainbot-53m-a9m-hybrid-instruct with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "nkthebass/tinybrainbot-53m-a9m-hybrid-instruct:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
TinyBrainBot-53M-A9M-Hybrid-Instruct
A tiny chat model with thinking and tool calling, trained from scratch. It's the first TinyBrainBot on a new
hybrid architecture: gated short-convolution blocks plus a few attention blocks, with a mixture of experts. 53.4M
parameters in total, 9.3M active per token. The layout matches LiquidAI's LFM2-MoE, so it runs natively in
llama.cpp, LM Studio and Ollama, and in transformers >= 5 as Lfm2MoeForCausalLM: no custom code.
It's the small-scale test of the recipe and architecture planned for a larger TinyBrainBot. Expect a tiny model: fluent and quick, often right on simple facts, unreliable on arithmetic and multi-step instructions.
| Benchmark (0-shot, full test sets) | This model | Base before fine-tuning | Change |
|---|---|---|---|
| ARC-Easy (acc_norm) | 49.71 | 49.66 | +0.04 |
| (raw acc) | 55.47 | 55.81 | |
| ARC-Challenge (acc_norm) | 30.29 | 29.44 | +0.85 |
| (raw acc) | 26.96 | 26.71 | |
| HellaSwag (acc_norm) | 30.10 | 30.13 | -0.03 |
| (raw acc) | 28.18 | 28.23 | |
| PIQA (acc_norm) | 64.04 | 63.22 | +0.82 |
| (raw acc) | 63.66 | 63.76 | |
| OpenBookQA (acc_norm) | 32.40 | 32.80 | -0.40 |
| (raw acc) | 20.60 | 21.20 | |
| SciQ (acc_norm) | 63.90 | 63.70 | +0.20 |
| (raw acc) | 72.90 | 72.90 | |
| WinoGrande (acc) | 49.41 | 49.33 | +0.08 |
| BoolQ (acc) | 58.72 | 58.26 | +0.46 |
| LAMBADA (OpenAI) (acc) | 22.88 | 21.00 | +1.88 |
| MMLU (acc) | 24.82 | 23.42 | +1.40 |
| CommonsenseQA (acc) | 21.70 | 20.15 | +1.56 |
| Social IQa (acc) | 37.67 | 38.08 | -0.41 |
| ArithMark-3 (acc_norm) | 43.90 | 52.90 | -9.00 |
| held-out arithmetic (our probe: skills ArithMark-3 doesn't test) | 40.94 | 40.80 | +0.14 |
EleutherAI lm-eval-harness v0.4.13, float32, every example of every task. Fine-tuning used expert-specialized fine-tuning (ESFT): only the 35 experts (of 352) that the chat data routes to most were trained, plus the chat and tool token embeddings. Across these 12 tasks it moved the scores by +0.54 on average versus the base; a normal full fine-tune on the same data and steps moved them by -1.51 (BoolQ alone fell 12 points).
About ArithMark-3: the base's 52.9 was inflated by synthetic arithmetic drills in its last training stage; arithmetic problems outside ArithMark-3's templates stayed at ~41 before and after fine-tuning. Fine-tuning removed the template-specific boost, not arithmetic skill (a full fine-tune showed the same drop).
Quick start
llama.cpp (the chat template, thinking and tool calls are built into the GGUF):
llama-server -m tinybrainbot-53m-a9m-hybrid-instruct-F16.gguf --jinja --reasoning-budget 0 # thinking off: chat, knowledge, tools
llama-server -m tinybrainbot-53m-a9m-hybrid-instruct-F16.gguf --jinja # thinking on
With thinking on, llama.cpp returns the thinking as reasoning_content, separate from the answer. Tool calls come back
as standard OpenAI tool_calls (pass your tools in the request). Per request you can also send
"chat_template_kwargs": {"enable_thinking": false} or "reasoning_effort": "low" | "medium" | "high".
transformers >= 5:
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "nkthebass/tinybrainbot-53m-a9m-hybrid-instruct"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
msgs = [{"role": "user", "content": "Why is the sky blue?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt") # thinking off by default
out = model.generate(ids, max_new_tokens=200) # sampling defaults from generation_config.json
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
Pass enable_thinking=True (or reasoning_effort="low") to apply_chat_template to turn thinking on, and
tools=[...] for tool calling.
Recommended: thinking off for conversation, knowledge questions and tool use, on for small math word problems; temperature 0.4, top-p 0.9, repetition penalty 1.1. Use the F16 GGUF (109 MB): it matches transformers token for token. The Q8_0 file (59 MB) is included but drifts noticeably at this size (e.g. picks the wrong tool more often).
Samples
Unedited, from the F16 GGUF in llama.cpp. More in sample_chats.md, mistakes included.
User: hey! how's it going? TinyBrainBot: I'm doing well, thanks for asking. How about you?
User: Why is the sky blue? TinyBrainBot: The sky is blue because sunlight scatters in Earth's atmosphere, and blue light is scattered away.
User: What's the weather in Boise right now? Tool call:
web_search({"query":"Boise"})tool result:Today: 48F, light rain, wind NW 9 mph. Tonight: 36F.TinyBrainBot: The weather in Boise is extremely humid. It's very rainy and wind NW 9 mph.
User: If I have 4 boxes with 3 books each, how many books do I have? (thinking on) thinking: "each is" means multiplication. So multiply 4 * 3. [...] So the answer is 12. TinyBrainBot: The answer is 12.
Model
| Architecture | LFM2-MoE layout (Lfm2MoeForCausalLM / llama.cpp lfm2moe): 12 blocks, 8 gated short-convolution (kernel 7) + 4 GQA attention (every third block) |
| Width | hidden 320, 5 query heads / 1 KV head of 64, QK-norm, RoPE theta 1M |
| Feed-forward | block 1 dense SwiGLU (896); blocks 2-12: 32 experts of width 96, top-4, sigmoid router with load-balancing bias |
| Parameters | 53.43M total (15.73M tied embedding), 9.31M active non-embedding per token |
| Context | 2,048 tokens |
| Tokenizer | tbb-49k: 49,152-token byte-level BPE trained for this model line; Qwen2-style pre-tokenizer, digits split, indentation kept, no unknown tokens; ChatML plus <think>, <tool_call>, <tool_response> single tokens |
| Chat format | ChatML; <think> blocks; XML tool calls (<tool_call><function=NAME><parameter=ARG>value</parameter></function></tool_call>), the format of Qwen3.5+ and LFM3 |
Training
All from scratch on 2x Tesla V100 16GB, fp16 with fp32 master weights, AdamW, 131k tokens per step.
| Stage | Tokens | Data |
|---|---|---|
| Pretraining | 2.06B | web (FineWeb-Edu, DCLM), Wikipedia, books, code, math, synthetic textbooks, Q&A |
| Continued pretraining | 5.12B | the same mix, fresh text |
| Decay (TinyBrainBot v5.1 recipe) | 1.52B | school-level textbooks, high-quality FineWeb-Edu, science Q&A, DCLM-Ultra, Wikipedia, distilled Q&A / facts / commonsense writing, GooAQ, FactBase-DCLM, finephrase FAQ, ELI5, a little math |
| Chat fine-tune (ESFT) | 262M | 92% general instruction data (chat, math, reasoning with thinking, instruction following, safety) + 8% tool calling (Hermes function calling, plus "tools available, not needed" chats), rendered in the chat format above |
No benchmark train or test data was used. Some instruction sets carry their own terms (e.g. WildChat, Tulu 3); check them before commercial use.
Limitations
- 9.3M active parameters: it makes things up, gets arithmetic wrong (even with thinking), drifts off long instructions (asked for a two-sentence story, it wrote several paragraphs) and sometimes calls the wrong tool or garbles arguments.
- With thinking on for casual chat it can misread harmless messages as risky and refuse; keep thinking off for chat.
- English only; 2,048-token context.
- Downloads last month
- 669
Datasets used to train nkthebass/tinybrainbot-53m-a9m-hybrid-instruct
wikimedia/wikipedia
mlfoundations/dclm-baseline-1.0
Collection including nkthebass/tinybrainbot-53m-a9m-hybrid-instruct
Evaluation results
- acc_norm (0-shot) on ARC-Easytest set self-reported49.710
- acc_norm (0-shot) on ARC-Challengetest set self-reported30.290
- acc_norm (0-shot) on HellaSwagvalidation set self-reported30.100
- acc_norm (0-shot) on PIQAvalidation set self-reported64.040
- acc_norm (0-shot) on OpenBookQAtest set self-reported32.400
- acc_norm (0-shot) on SciQtest set self-reported63.900
- acc (0-shot) on WinoGrandevalidation set self-reported49.410
- acc (0-shot) on BoolQvalidation set self-reported58.720