feat(phase2): complete openai api surfaces 2.3-2.7

- 2.3: unknown model errors (400 + RFC 9457 problem+json with valid_models)
- 2.5: GET /v1/models endpoint (derived from config, not hardcoded)
- 2.6: POST /v1/embeddings passthrough (body-based dispatch, no rewrite)
- 2.7: POST /v1/rerank with path rewrite (/v1/rerank → /rerank)
- wire proxy.Handler in main.go (was using dummy handler)
- 140+ tests passing, race detector clean
- all requests: client → nginx → gateway → upstreams
- ready for config deployment to go live
This commit is contained in:
Story Crater Bot
2026-08-19 23:49:11 -07:00
parent fd45c2c0d3
commit a8dfd5b2f0
8 changed files with 1596 additions and 26 deletions
+3 -5
View File
@@ -10,6 +10,7 @@ import (
"syscall"
"github.com/Riotpiaole/homelab-frontend/internal/config"
"github.com/Riotpiaole/homelab-frontend/internal/proxy"
"github.com/Riotpiaole/homelab-frontend/internal/server"
)
@@ -30,11 +31,8 @@ func main() {
}
}
// Create a basic handler (will be replaced with real routing later)
upstreamHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
fmt.Fprintf(w, "not found")
})
// Create the reverse proxy handler that routes requests based on configuration
upstreamHandler := proxy.New(cfg)
// Create server with health checker
srv := server.New(cfg.ListenAddr, cfg.ShutdownTimeout, nil)