TRiP: Transformer inference and training in plain C (Gemma, Llama2, PaliGemma)

RelevantShape3963 · reddit · 2026-08-21

Author released TRiP, a Transformer inference and training framework written in plain C (15k lines). It supports real checkpoints for Gemma1(.1), Llama2, PaliGemma1, and GPT2, including the multimodal path for PaliGemma. Designed for readability and debugging, it allows inspecting tensors anywhere in the forward/backward pass without hidden complexity. Includes training code (though PaliGemma encoder is not trainable).

Original post →

More from Infra

Infra channel →