Model list is always fetched live from the gateway model-info endpoint, so the static fallback list was dead config with stale IDs (GLM-4.7 vs zhanlu/glm-4.7). Default to zhanlu/auto when the request omits model.
This commit is contained in:
@@ -525,7 +525,7 @@ func (s *Server) exchangeSSOCode(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *Server) models(w http.ResponseWriter, r *http.Request) {
|
||||
modelIDs := s.cfg.Models
|
||||
modelIDs := []string{}
|
||||
if creds, err := s.currentCredentials(); err == nil && creds.HasAPIKey() {
|
||||
if client, cerr := s.zhanluClient(); cerr == nil {
|
||||
if fetched, merr := client.Models(r.Context(), creds.APIKey); merr == nil && len(fetched) > 0 {
|
||||
@@ -552,7 +552,7 @@ func (s *Server) chatCompletions(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if req.Model == "" {
|
||||
req.Model = s.cfg.DefaultModel
|
||||
req.Model = "zhanlu/auto"
|
||||
}
|
||||
clientWantsStream := req.Stream
|
||||
req.Stream = true
|
||||
|
||||
Reference in New Issue
Block a user