Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llamago

llamago is a small Go project that starts the journey toward a llama.cpp-style runtime in Go full engine.

The first version is intentionally tiny:

  • a whitespace tokenizer
  • a bigram language model
  • JSON model save/load
  • a CLI for training, sampling, and inspection
  • no external dependencies beyond the Go standard library

This gives us a working baseline for the pieces every larger inference runtime needs: tokenization, model loading, sampling, testing, and a clean CLI.

Quick Start

A generated demo checkpoint is already included at ./models/demo.json, so you can jump straight to inspection or sampling if you want.

Train a demo model from the included corpus:

go run ./cmd/llamago train -input ./testdata/demo.txt -output ./models/demo.json -name demo

Inspect the saved model:

go run ./cmd/llamago inspect -model ./models/demo.json

Generate a deterministic sample:

go run ./cmd/llamago sample -model ./models/demo.json -prompt "go" -steps 6 -temperature 0

Expected output:

go builds reliable tools

Run the tests:

go test ./...

Project Layout

  • cmd/llamago: CLI entrypoint
  • internal/tokenizer: starter tokenizer implementation
  • internal/model: model training, persistence, and inspection
  • internal/generate: generation loop
  • internal/sampler: greedy and temperature sampling
  • docs/roadmap.md: gap analysis and next milestones toward a fuller llama.cpp-in-Go port

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages