Instructions to use nkthebass/TinyBrainBot-303m-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nkthebass/TinyBrainBot-303m-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nkthebass/TinyBrainBot-303m-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nkthebass/TinyBrainBot-303m-instruct") model = AutoModelForCausalLM.from_pretrained("nkthebass/TinyBrainBot-303m-instruct") 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]:])) - llama-cpp-python
How to use nkthebass/TinyBrainBot-303m-instruct with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="nkthebass/TinyBrainBot-303m-instruct", filename="tinybrainbot-303m-instruct-F16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use nkthebass/TinyBrainBot-303m-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-303m-instruct:F16 # Run inference directly in the terminal: llama cli -hf nkthebass/TinyBrainBot-303m-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-303m-instruct:F16 # Run inference directly in the terminal: llama cli -hf nkthebass/TinyBrainBot-303m-instruct: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-303m-instruct:F16 # Run inference directly in the terminal: ./llama-cli -hf nkthebass/TinyBrainBot-303m-instruct: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-303m-instruct:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf nkthebass/TinyBrainBot-303m-instruct:F16
Use Docker
docker model run hf.co/nkthebass/TinyBrainBot-303m-instruct:F16
- LM Studio
- Jan
- vLLM
How to use nkthebass/TinyBrainBot-303m-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nkthebass/TinyBrainBot-303m-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-303m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nkthebass/TinyBrainBot-303m-instruct:F16
- SGLang
How to use nkthebass/TinyBrainBot-303m-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-303m-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-303m-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-303m-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-303m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use nkthebass/TinyBrainBot-303m-instruct with Ollama:
ollama run hf.co/nkthebass/TinyBrainBot-303m-instruct:F16
- Unsloth Studio
How to use nkthebass/TinyBrainBot-303m-instruct with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for nkthebass/TinyBrainBot-303m-instruct to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for nkthebass/TinyBrainBot-303m-instruct to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for nkthebass/TinyBrainBot-303m-instruct to start chatting
- Atomic Chat new
- Docker Model Runner
How to use nkthebass/TinyBrainBot-303m-instruct with Docker Model Runner:
docker model run hf.co/nkthebass/TinyBrainBot-303m-instruct:F16
- Lemonade
How to use nkthebass/TinyBrainBot-303m-instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nkthebass/TinyBrainBot-303m-instruct:F16
Run and chat with the model
lemonade run user.TinyBrainBot-303m-instruct-F16
List all available models
lemonade list
TinyBrainBot 303M — Instruct
A 303M-parameter chat assistant built from scratch on a home server (2× NVIDIA Tesla P100): pretrained → fact-distilled → supervised fine-tuned. It's a tiny, honest little assistant — it answers common questions, follows simple instructions, holds a short conversation, and (often) admits when it doesn't know instead of bluffing.
Base (pretrained-only) version: TinyBrainBot 303M Base.
Model details
| Parameters | ~303M |
| Architecture | LLaMA-style (LlamaForCausalLM) — RoPE, RMSNorm, SwiGLU, GQA |
| Layers / hidden / heads | 24 / 1024 / 16 (4 KV heads) |
| FFN / vocab / context | 2816 / 32,000 / 1024 |
| Tied embeddings | Yes |
| Special tokens | <|user|> <|assistant|> <|system|> <|end|> |
| EOS token | <|end|> |
⚠️ Chat template — use SPACES, not newlines
This is the single most important detail. The tokenizer normalizes newlines to spaces, so the model was trained with spaces between turns. The bundled chat_template already does this — use apply_chat_template and it just works:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tok = AutoTokenizer.from_pretrained("your-username/tinybrainbot-303m-instruct")
model = AutoModelForCausalLM.from_pretrained("your-username/tinybrainbot-303m-instruct", torch_dtype=torch.float16).eval()
msgs = [{"role": "user", "content": "What is the capital of France?"}]
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
ids = tok(prompt, return_tensors="pt", add_special_tokens=False).input_ids
out = model.generate(ids, max_new_tokens=64, do_sample=True,
temperature=0.5, top_p=0.9, repetition_penalty=1.2, eos_token_id=7)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
# -> Paris.
The rendered format is (note the spaces, no \n):
<|user|> {message} <|end|> <|assistant|>
If you build prompts by hand or configure a UI (llama.cpp / Ollama / LM Studio / Jan), make sure the separators are spaces and the stop token is <|end|> — a template with literal \n will feed the model out-of-distribution tokens and it will ramble without stopping.
Recommended sampling
Small models need a lower temperature than large ones (temp 1.0 makes this model incoherent).
| Use case | temp | top-p | rep penalty |
|---|---|---|---|
| General chat (default) | 0.7 | 0.9 | 1.2 |
| More creative | 0.8 | 0.9 | 1.2 |
| Factual / reliable | 0.4–0.6 | 0.9 | 1.15 |
Training
- Base: pretrained from scratch on FineWeb-Edu, Wikipedia, TinyStories, OpenWebText2, Orca-Math.
- Fact distillation: synthetic Q&A + short-fact datasets generated by a stronger teacher (Ling 2.6 Flash), mixed into continued pretraining to densify factual recall.
- SFT: ~33k instruction→response pairs plus short 2-turn conversations, distilled from the same teacher, spanning: general instructions, concise Q&A, explain/summarize/rewrite/list/compare/how-to, short creative writing, honest "I don't know" examples, and polite refusals. Loss masked to the assistant turns only.
Evaluation
Standard multiple-choice benchmarks (log-likelihood scoring, n=200 subsample — absolute numbers run a bit low vs. the official lm-eval-harness; use them for relative comparison):
| Benchmark | TinyBrainBot 303M | random |
|---|---|---|
| ARC-Easy (acc_norm) | ~44% | 25 |
| OpenBookQA (acc_norm) | ~31% | 25 |
| HellaSwag (acc_norm) | ~29% | 25 |
| WinoGrande (acc) | ~46% | 50 |
| ARC-Challenge (acc_norm) | ~24% | 25 |
| MMLU (acc) | ~23% | 25 |
Roughly GPT-2-small tier on general reasoning, with a relative edge on knowledge QA (ARC / OpenBookQA) from the fact distillation. Near-random on MMLU, as expected at this scale.
Sampling
(best of 5 samples, temperature tuned per prompt):
Q: What is the largest planet in the solar system? Jupiter.
Q: Explain what photosynthesis is in one or two simple sentences. Photosynthesis is how plants use sunlight, water, and air to make food (glucose) and release oxygen. It occurs in many types like green plants, algae, and trees.
Q: Write a short poem about the moon. Silver moon, slow and gold, hums low over the sleeping sky. It dreams in silver rivers, guarding dreams in morning light.
Q: List three healthy breakfast ideas. Greek yogurt with berries, whole wheat bread, cream cheese.
Q: Give me one tip for staying focused while studying. Use 25-minute focus blocks with 5-minute breaks, silence notifications, and a clear workspace to keep your mind fresh.
Limitations
- Fragile facts. Sensitive to phrasing and capitalization; standard, well-formed questions work best. Confidently wrong on the long tail — pair with retrieval (RAG) for anything important.
- Weak reasoning/math — it's 303M.
- The "I don't know" and refusal behaviors are helpful but not 100% reliable (they were a small slice of SFT).
- English only.
License
Apache-2.0 (change if you prefer).
- Downloads last month
- 602