mirror of
https://github.com/prosolis/gogobee.git
synced 2026-09-14 10:51:09 +00:00
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:
@@ -856,9 +856,7 @@ func (p *HangmanPlugin) handleSubmit(ctx MessageContext, phrase string) error {
|
||||
}
|
||||
|
||||
// LLM screening
|
||||
ollamaHost := os.Getenv("OLLAMA_HOST")
|
||||
ollamaModel := os.Getenv("OLLAMA_MODEL")
|
||||
if ollamaHost == "" || ollamaModel == "" {
|
||||
if !llmConfigured() {
|
||||
// No LLM available — add directly
|
||||
if err := p.addPhrase(phrase); err != nil {
|
||||
if err.Error() == "duplicate phrase" {
|
||||
@@ -879,7 +877,7 @@ or
|
||||
|
||||
Phrase: %s`, phrase)
|
||||
|
||||
result, err := callOllama(ollamaHost, ollamaModel, prompt)
|
||||
result, err := callLLM(prompt)
|
||||
if err != nil {
|
||||
slog.Error("hangman: LLM screening failed", "err", err)
|
||||
// Fail open — add it
|
||||
|
||||
Reference in New Issue
Block a user