AI written Readme. Update this more as needed.
Rewrite of the LCZero training server using gRPC. It interacts with https://dev.lczero.org and removes all website components from the legacy HTTP server, adding richer tasking (training, match, SPRT, tuning).
- Language: Go 1.23
- RPC: gRPC + Protocol Buffers (see
api/v1/lczero.proto) - DB: PostgreSQL (schema in
schema.sql; human guide inschema.md) - Entry point:
cmd/main.go
Our old training setup was a pain: starting a new run meant hand-editing the database, fiddling with YAML, and clobbering whatever was in "Run 0." We also had a separate OpenBench instance for SPRT and tuning hyperparameters was done individually via Chess Tuning Tools (let’s be real, it was mostly devs running this and posting results on Discord).
This rewrite aims to fix all that—bringing everything (training, matches, tuning, and SPRT) into one unified, distributed system that’s actually flexible and easy to experiment with. It is taking heavy inspiration from OpenBench, just expanded to fit our need.
- Services:
AuthService(token issuance),TaskService(task assignment + data collection) - Packages:
internal/config: loadsserverconfig.jsoninternal/db: Postgres connectioninternal/server: gRPC services (auth_service.go,task_service.go)internal/models,internal/db/queries: model structs and SQL helpersapi/v1: protobuf (.proto+ generated.pb.go)
- Go 1.23.x
- PostgreSQL 13+ (14+ recommended)
- protoc (only if re-generating protobuf code)
Copy and edit serverconfig.json.
Relevant fields (mapped by internal/config/config.go):
database.host|user|dbname|passwordwebserver.address(e.g.,":9830")- Client/engine version gates and URLs for artifacts
Theoretically, the database should be setup from the https://dev.lczero.org/ but here is a basic setup instructions.
- Create DB and user, then apply schema:
# Example (adjust to your environment)
psql -h localhost -U postgres -c "CREATE ROLE lc0 WITH LOGIN PASSWORD 'lc0pass';"
psql -h localhost -U postgres -c "CREATE DATABASE lc0 OWNER lc0;"
psql -h localhost -U lc0 -d lc0 -f .\schema.sql- Optional: read
schema.mdfor a human-friendly schema guide and improvement notes.
# Requires protoc and the Go plugins installed
protoc --go_out=. --go-grpc_out=. api/v1/lczero.proto- Legacy
users/clientsare read-only (migration only). Seeschema.md. - Several FKs and NOT NULLs are intentionally loose while iterating; see improvement list in
schema.md. - Task assignment logic is evolving (see TODOs in
internal/server/task_service.go).