A 117.5M parameter language model trained from scratch. Small but solid - designed for edge deployment and educational purposes.
PebbleLM-117M is a decoder-only transformer trained on a diverse corpus of text. Despite its small size, it demonstrates basic language understanding and generation capabilities.
1Epochs: 3
2Batch Size: 48
3Gradient Accumulation: 2
4Effective Batch Size: 96
5Learning Rate: 3e-4
6Warmup Ratio: 0.1
7Precision: FP16
8Hardware: NVIDIA A100 80GB
9Training Time: ~4.5 hours
1from huggingface_hub import hf_hub_download
2
3# Download model files
4model_path = hf_hub_download(repo_id="nameissakthi/PebbleLM-117M", filename="model.pt")
5tokenizer_path = hf_hub_download(repo_id="nameissakthi/PebbleLM-117M", filename="tokenizer.json")
1import torch
2import json
3from tokenizers import Tokenizer
4
5# Load tokenizer
6tokenizer = Tokenizer.from_file(tokenizer_path)
7
8# Model architecture is included in this repo
9from src.model.transformer import SLMForCausalLM
10from src.model.config import SLMConfig
11
12config = SLMConfig(vocab_size=16384)
13model = SLMForCausalLM(config)
14
15state_dict = torch.load(model_path, map_location="cpu")
16if "model_state_dict" in state_dict:
17 state_dict = state_dict["model_state_dict"]
18model.load_state_dict(state_dict)
19model.eval()
20
21# Generate text
22prompt = "The quick brown fox"
23input_ids = torch.tensor([tokenizer.encode(prompt).ids])
24
25with torch.no_grad():
26 for _ in range(50):
27 logits = model(input_ids).logits[:, -1, :]
28 next_token = torch.argmax(logits, dim=-1, keepdim=True)
29 input_ids = torch.cat([input_ids, next_token], dim=-1)
30
31output = tokenizer.decode(input_ids[0].tolist())
32print(output)
This base model is for language modeling only. For conversational Q&A, use the finetuned version:
PebbleLM-117M-Chat
For production-quality results, consider models with 1B+ parameters.
1@misc{pebblellm2026,
2 author = {Sakthivel},
3 title = {PebbleLM-117M: A Small Language Model for Edge Deployment},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/nameissakthi/PebbleLM-117M}}
7}