Instructions to use cttyyyy/BLYAT-6-97M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cttyyyy/BLYAT-6-97M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cttyyyy/BLYAT-6-97M") 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("cttyyyy/BLYAT-6-97M") model = AutoModelForCausalLM.from_pretrained("cttyyyy/BLYAT-6-97M", 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
- vLLM
How to use cttyyyy/BLYAT-6-97M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cttyyyy/BLYAT-6-97M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cttyyyy/BLYAT-6-97M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cttyyyy/BLYAT-6-97M
- SGLang
How to use cttyyyy/BLYAT-6-97M 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 "cttyyyy/BLYAT-6-97M" \ --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": "cttyyyy/BLYAT-6-97M", "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 "cttyyyy/BLYAT-6-97M" \ --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": "cttyyyy/BLYAT-6-97M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cttyyyy/BLYAT-6-97M with Docker Model Runner:
docker model run hf.co/cttyyyy/BLYAT-6-97M
BLYAT-6-97M
BLYAT 6 is a small (97.5M parameter) English-only chat language model that was trained completely from scratch (tokenizer, pretraining and fine-tuning) by an independent developer on a single GTX 1060 6GB. It is a hobby / learning project, published for transparency and experimentation. It is not a reliable assistant: it often states false things confidently.
Quick start
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "your_hf_username_here/BLYAT-6-97M"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo).eval()
messages = [{"role": "user", "content": "Hi! How are you today?"}]
prompt = tok.apply_chat_template(messages, tokenize=False)
ids = tok(prompt, add_special_tokens=False, return_tensors="pt")
out = model.generate(**ids, max_new_tokens=200, stop_strings=["\n\nUser:"], tokenizer=tok)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))
Tips
- The saved
generation_config.jsonuses greedy decoding withrepetition_penalty=1.1andno_repeat_ngram_size=4, which stops loops in chat. For arithmetic userepetition_penalty=1.0, no_repeat_ngram_size=0, otherwise repeated numbers inside the working get penalised. - The model was trained on exactly this prompt layout (
<bos>User:\n...\n\nAssistant:\n...); the chat template reproduces it. There is no system role; put instructions in the user message. The context window is 512 tokens. - It is English only. Spanish input gets a short notice that it only understands English.
Model
| Architecture | decoder-only Transformer, Llama layout (RMSNorm, SwiGLU, rotary embeddings, tied embeddings, no biases) |
| Parameters | 97.5M (12 layers, 12 heads, hidden 768, MLP 2048, context 512) |
| Tokenizer | custom 16,384-token byte-level BPE, trained for this project (English) |
| Precision | float32 weights (model.safetensors, about 390 MB) |
The weights were converted from the original training format (fused qkv and interleaved rotary pairs) to the standard Llama layout. The conversion was checked numerically before publishing: logits match the original model to float32 precision and greedy generations are token-for-token identical.
Training
- Pretraining from scratch - 90,000 steps x 32 sequences x 512 tokens, about 1.47B tokens, on one GTX 1060 6GB (about 4.4 days). Data mix: FineWeb-Edu (two shards), Wikitext, a Python source corpus, and chat-format conversation text. Held-out FineWeb-Edu validation loss: 3.10.
- Supervised fine-tuning (answer-only loss) in several rounds: general instruction/chat data (SmolTalk, Dolly, OASST English, Alpaca-cleaned), a small hand-written identity set, synthetic small-talk, and synthetic step-by-step arithmetic (see below).
What it can and cannot do
Works reasonably: greetings and small talk, short explanations, simple formatted answers, short Python snippets (right shape, often a wrong detail), simple arithmetic (below), saying it does not know about made-up people.
Does not work: facts (it often invents authors, plots, commands), long answers (it drifts and repeats), Spanish or other languages, multi-step reasoning, anything where being wrong matters.
Arithmetic (held-out test set of 320 problems, greedy decoding, no repetition penalty)
| Category | Accuracy |
|---|---|
| times table (1-12) | 100% |
| division table | 97.5% |
| 2-digit addition | 95% |
| 2-digit subtraction | 97.5% |
| word problems (add / subtract / multiply) | 95% |
| 2-digit x 1-digit multiplication | 65% |
| 3-digit addition | 27.5% |
| 3-digit subtraction | 20% |
| Total | 74.7% |
It solves problems in small written steps (for example 45 + 30 = 75, then 75 + 8 = 83). Three-digit numbers are weak mainly because the
tokenizer splits them inconsistently (223 becomes 22+3, 270 becomes 2+70). Problems used for testing are not in the training data.
Raw logs are in eval/.
Limitations, bias and intended use
- Trained on web text and model-generated chat data, so it can repeat inaccurate, biased or offensive content.
- Intended for learning, experiments and as a baseline for small-model research. Not for production, advice, or anything safety-relevant.
Data and licenses
This model is released under CC BY-NC 4.0 (non-commercial) because the fine-tuning data is mixed:
| Data | License / note |
|---|---|
| FineWeb-Edu | ODC-By 1.0 |
| Wikitext | CC BY-SA 3.0 |
| Python source corpus | Source and license not recorded (assembled for earlier BLYAT experiments); treated as unverified. |
| SmolTalk (smol-smoltalk) | see the dataset card; parts are generated by other language models |
| Databricks Dolly 15k | CC BY-SA 3.0 |
| OpenAssistant (OASST1) English | Apache 2.0 |
| Alpaca-cleaned | CC BY-NC 4.0; generated with OpenAI models, OpenAI terms apply |
| Identity, small-talk and arithmetic sets | written / generated for this project |
This is a good-faith summary, not legal advice. Check the original dataset cards before reusing the weights commercially.
Citation
BLYAT 6 (97M), an independent from-scratch small language model, 2026.
- Downloads last month
- 331