An AI-powered tool that generates human-readable summaries of git changes using tool calling with a self-hosted LLM
at main 754 B view raw
1package main 2 3import ( 4 "log/slog" 5 "net/http" 6 "os" 7 8 "git-summarizer/internal/api" 9 "git-summarizer/internal/summarizer" 10 "git-summarizer/pkg/cache" 11 "git-summarizer/pkg/config" 12) 13 14func main() { 15 cfg := config.LoadConfig() 16 17 s := summarizer.New(cfg) 18 repoCache := cache.New(cfg.CacheDir, cfg.MaxCachedRepos) 19 h := api.NewHandler(s, repoCache) 20 21 http.HandleFunc("/summarize", h.HandleSummarize) 22 http.HandleFunc("/health", h.HandleHealth) 23 24 slog.Info("starting git-summarizer", 25 "addr", cfg.ListenAddr, 26 "llm_url", cfg.LlamaURL, 27 "model", cfg.Model, 28 "cache_dir", cfg.CacheDir, 29 "max_cached_repos", cfg.MaxCachedRepos) 30 31 if err := http.ListenAndServe(cfg.ListenAddr, nil); err != nil { 32 slog.Error("server failed", "error", err) 33 os.Exit(1) 34 } 35}