Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ui/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (api *ApiServer) runIlabChatCommand(question, context string) (string, erro
cmd = exec.Command("echo", cmdArgs...)
api.logger.Infof("Running in test mode: %s", commandStr)
} else {
modelName, err := api.fetchModelName(true)
modelName, err := api.fetchModelName(true, api.preCheckEndpointURL)
if err != nil {
api.logger.Errorf("Failed to fetch model name: %v", err)
return "failed to retrieve the model name", err
Expand Down Expand Up @@ -382,9 +382,8 @@ func setupLogger(debugMode bool) *zap.SugaredLogger {

// fetchModelName hits the defined precheck endpoint with "/models" appended to extract the model name.
// If fullName is true, it returns the entire ID value; if false, it returns the parsed out name after the double hyphens.
func (api *ApiServer) fetchModelName(fullName bool) (string, error) {
func (api *ApiServer) fetchModelName(fullName bool, endpoint string) (string, error) {
// Ensure the endpoint URL ends with "/models"
endpoint := api.preCheckEndpointURL
if !strings.HasSuffix(endpoint, "/") {
endpoint += "/"
}
Expand Down
Loading