llm: route every LLM caller through a shared backend client

Replaces the per-plugin Ollama HTTP calls with internal/llm, which picks a
backend from the environment (vLLM or Ollama) behind one Chat interface, plus
internal/plugin/llm_client.go as the plugin-facing wrapper.

Startup now logs llm_backend/llm_endpoint/llm_model instead of the two
OLLAMA_* vars, which no longer describe where inference actually goes.

These files were already running in prod from the vLLM migration but had never
been committed; this is that live state, byte-for-byte.
This commit is contained in:
prosolis
2026-07-26 10:16:33 -07:00
parent 3f9c338e67
commit 583616f9d0
17 changed files with 603 additions and 434 deletions
+5 -2
View File
@@ -13,6 +13,7 @@ import (
"gogobee/internal/bot"
"gogobee/internal/db"
"gogobee/internal/dreamclient"
"gogobee/internal/llm"
"gogobee/internal/peteclient"
"gogobee/internal/plugin"
"gogobee/internal/util"
@@ -37,9 +38,11 @@ func main() {
logLevel = "info"
}
util.InitLogger(logLevel)
llmCfg := llm.ConfigFromEnv()
slog.Info(version.Full(), "level", logLevel,
"ollama_host", os.Getenv("OLLAMA_HOST"),
"ollama_model", os.Getenv("OLLAMA_MODEL"))
"llm_backend", llmCfg.Backend,
"llm_endpoint", llmCfg.Endpoint,
"llm_model", llmCfg.Model)
dataDir := os.Getenv("DATA_DIR")
if dataDir == "" {