Alx-1-125M-C

A GPT-style language model (127M parameters) trained from scratch on C source code (The Stack v1, dedup, C subset).

  • Layers: 12 | Heads: 12 | Embedding: 768 | Context: 4000 tokens
  • Tokenizer: GPT-2 BPE (tiktoken), vocab padded to 50304
  • Training: about 320M tokens, mixed precision fp16, single T4 GPU
  • Final validation loss: 1.2399
  • Weights: model.safetensors (fp32) and model-fp16.safetensors

Usage

pip install torch safetensors tiktoken huggingface_hub
from huggingface_hub import snapshot_download
import sys
path = snapshot_download("ALEXJMATHEW/Alx-1-125M-C")
sys.path.insert(0, path)
from alx_model import load_alx1, complete

model = load_alx1(path, device="cuda", weights="model-fp16.safetensors")
prompt = "#include <stdio.h>\n\n/* Return 1 if n is prime. */\nint is_prime(int n) {\n"
print(complete(model, prompt, device="cuda"))

This is a completion model, not an instruction follower: give it a comment, includes or a function signature and it continues.

Limitations

This model saw far fewer tokens than a compute-optimal run for its size. Expect plausible-looking but often incorrect, incomplete or non-compiling C code. Training data comes from The Stack v1 (permissively licensed GitHub code); review the dataset terms and its opt-out policy before any commercial use.

Downloads last month
10
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train ALEXJMATHEW/Alx-1-125M-C