Local chess trainer and opponent-prep tool powered by Go, Stockfish, and Ollama.
A local chess trainer built with Go and Stockfish
On Windows open start.cmd
On Linux and macOS run ./start.sh
For a fresh clone install Go 1.26 or newer first
Use Settings to install Stockfish or choose an existing executable
To build and run by hand use the project directory
go build -trimpath -ldflags="-s -w" -o bin/stockllama .
./bin/stockllama
The app prints its local address
It accepts connections only from your own device
Set STOCKLLAMA_ADDR to use another local address such as localhost:8765 or [::1]:8765
Enter a username and fetch recent games The app recommends up to three games based on the sample You can reduce that number before analysis The percentage shows completed analysis work
Recent imports are cached for one day and can be reused offline Saved profiles remain available until you remove them Exports contain chess data without local paths or API keys
PGN files need matching White or Black player names CSV files need a pgn column with quoted full game text JSON accepts a game array or an exported StockLlama profile The import screen samples up to eight games and recommends a smaller analysis
Use the synthetic demo game with the name PracticePartner
Stockfish provides offline move recommendations without a language model The right panel gives a short reply based on the current position Saved mistakes are cited when the position matches A single mistake is described as one example rather than a proven weakness
Ollama and compatible API services are optional Detect models in Settings or enter a model name Ask uses the selected model while automatic hints stay with Stockfish An API request sends the position summary to your chosen provider Keys remain in memory and disappear when the app stops
The Ollama folder is detected on each device It appears only in the local settings screen Paths are absent from shared defaults and profile exports
Use GPU allows Ollama to choose GPU offloading Turning it off requests CPU inference A checkmark confirms detected hardware GPU active appears only when Ollama reports video memory for the selected model Stockfish uses the CPU API inference runs on the provider hardware
Stockfish uses one thread and a 16 MB hash table Quick analysis studies the first 24 player moves in each selected game All observed moves still enter the player model Repeated positions share cached analysis The play engine is reused until its path changes or the app stops Progress polling sends a small status object
Local model replies have a short output budget and a 2048 token context Models are kept loaded for 30 seconds after a request Move modeling uses observed frequencies rather than neural network training Short searches are approximate and other replies may also be good
go test -cover ./...
go vet ./...
Set STOCKLLAMA_TEST_ENGINE to your engine executable for real engine checks
Browser checks need a running app and a Chromium browser
npm ci
npm run test:gui
Set CHROME_PATH if Chrome is installed somewhere else
Set STOCKLLAMA_LIVE_TEST=1 to include a live username import
Read the contributing guide Source uses GPLv3 or later The chess library is notnil chess under MIT Downloaded Stockfish binaries retain their GPL license Engines and model weights are stored locally and ignored by Git
Wait briefly for a running background job before stopping Ollama and the engine
https://github.com/fukubie/StockLlama/issues/137
Labels: enhancement, good first issue, go, area: server, priority: low
Stop background jobs cleanly on shutdown
https://github.com/fukubie/StockLlama/issues/133
Labels: enhancement, go, area: server, priority: low
Upgrade relative engine paths that are already saved in settings
https://github.com/fukubie/StockLlama/issues/132
Labels: bug, go, area: engine, priority: low
Store absolute Stockfish paths so saved settings don't depend on the start folder
https://github.com/fukubie/StockLlama/issues/120
Labels: bug, go, area: engine, priority: low
Refactor: typed response for POST /api/drill
https://github.com/fukubie/StockLlama/issues/115
Labels: good first issue, refactor, go, area: server, priority: low
Finish replacing map[string]any HTTP responses with typed structs
https://github.com/fukubie/StockLlama/issues/112
Labels: refactor, go, area: server, priority: low
Save a drill when a move makes a forced mate 3+ moves longer
https://github.com/fukubie/StockLlama/issues/111
Labels: enhancement, good first issue, go, area: profile, priority: low
Delayed forced mates are still not saved as drills
https://github.com/fukubie/StockLlama/issues/108
Labels: enhancement, go, area: profile, priority: low
README: add CI badges, a screenshot, and a quick start for each OS
https://github.com/fukubie/StockLlama/issues/58
Labels: documentation, good first issue, priority: low
Keep the app small and easy to run Discuss large changes before writing them
Install Go and create a focused branch Add regression tests for changes in behavior Use synthetic games and mocked network responses Run the checks before opening a pull request
gofmt -l .
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@v0.8.2 ./...
go run golang.org/x/vuln/cmd/govulncheck@v1.10.0 ./...
go test -race -cover ./...
CI runs the same checks on every pull request and they must pass before merge Pull requests to main need passing CI, CodeQL, govulncheck, and dependency review Pick an issue labelled good first issue and comment before you start
For interface changes also run the browser checks in the README Explain what changed and how you tested it
Use standard Go formatting and prefer the standard library Keep the interface free of build tools Cache repeated work and bound expensive searches Do not load models or poll hardware when they are not needed Measure performance before making speed claims Keep coaching short and supported by saved positions
Never commit keys or personal directory paths Keep settings and player data in the ignored data directory Keep engines and weights outside tracked source API keys must stay out of files and logs Profile exports must contain chess data only Review Git status before committing
Use plain labels and short explanations Avoid decorative punctuation in interface copy and documentation Preserve required syntax in commands and links
Contributions use GPLv3 or later Be respectful in issues and reviews