TinyBrainBot-360M-A75M-v6-Coder
a compact MoE assistant for Python code
2 min readupdated
The model is based on a Mixture-of-Experts architecture (mixture of experts, where only a fraction of parameters is activated for each token) with a total of 383 million parameters, of which about 75 million are active per token. Developer nkthebass added a code-training stage to the base version with support for a context of up to 4,096 tokens and the ability to plan step-by-step before outputting code. The model performs best on short Python functions, correctly preserves indentation, and is distributed under the Apache-2.0 license.
Key features
- MoE architecture: 24 experts per layer, with 4 active simultaneously, ensuring high execution speed at a modest size.
- Python specialization: the model confidently writes short functions, supports four-space indentation, and reads context up to 4,096 tokens.
- Reasoning mode: the system prompt «Think step by step before answering.» forces the model to output a short plan inside
...tags before the code. - GGUF format: quantized versions (such as Q8_0 and Q4_K_M) are available for running locally via llama.cpp or LM Studio.
What you can do
- Function generation: use for quickly writing small string and list processing scripts, simple loops, and recursion in Python.
- Logic planning: run the model with the reasoning system prompt to study the step-by-step problem-solving plan before receiving the code.
- Local execution: deploy the model on a PC or in a lightweight app (LM Studio, Ollama) thanks to its tiny size and ready-to-use GGUF files.
Example
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "nkthebass/tinybrainbot-360m-a75m-v6-coder"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
msgs = [
{"role": "user", "content": "Write a function is_prime(n) that returns True if n is prime."},
]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=600)
print(tok.decode(out[0], skip_special_tokens=False))
Read more
Details• Benchmarks: HumanEval — 12.8, MBPP — 24.9 (for direct mode).
• Requirements: ultra-compact size (~383M parameters), runs on minimal hardware.
• Limitations: strong only in short Python code, other programming languages produce many errors, understands English only.
• Training: 4 stages, including general v6 pre-training, instruction descent, expert code anneal (1.26 billion tokens), and code tuning.










Comments