[0] https://jaykmody.com/blog/gpt-from-scratch/
If you really didn't want PyTorch/Transformers, you could consider exporting your models to ONNX (https://github.com/microsoft/onnxruntime).