fix(llm): make API URL configurable for Kubernetes internal service
ci / test (push) Successful in 1m51s
ci / test (push) Successful in 1m51s
Issue: Orchestrator pods failing with 'api.riotpiao.com is unreachable' - URL was hardcoded to external hostname - Inside Kubernetes cluster, needs to use internal service DNS Changes: - Make LocalLLMBaseURL read from LOCAL_LLM_BASE_URL env var - Default to 'https://api.riotpiao.com' for external deployments - Update orchestrator-job.yaml to pass internal service: http://api-gateway.api:8080 - Update worker-deployment.yaml to use same internal service URL This allows pods to reach the LLM API via Kubernetes DNS without external network access.
This commit is contained in:
+12
-3
@@ -7,16 +7,25 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/rockliang/poimen/workflows/statemachine"
|
||||
)
|
||||
|
||||
const (
|
||||
var (
|
||||
// LocalLLMBaseURL is the base URL for the local LLM API (OpenAI-compatible)
|
||||
// Points to homelab-frontend gateway
|
||||
LocalLLMBaseURL = "https://api.riotpiao.com"
|
||||
// Can be overridden via LOCAL_LLM_BASE_URL env var (for Kubernetes internal service)
|
||||
LocalLLMBaseURL string
|
||||
)
|
||||
|
||||
func init() {
|
||||
LocalLLMBaseURL = os.Getenv("LOCAL_LLM_BASE_URL")
|
||||
if LocalLLMBaseURL == "" {
|
||||
// Default: external hostname (for local dev)
|
||||
LocalLLMBaseURL = "https://api.riotpiao.com"
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
// SupportedModels maps local model names to verify they exist
|
||||
SupportedModels = map[string]bool{
|
||||
|
||||
Reference in New Issue
Block a user