Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

fix(cmd): show info may have nil ModelInfo (#6579)

Vimal Kumar5f7b4a5e3056
diff --git a/cmd/cmd.go b/cmd/cmd.go
index b75c0b5ec..f6d31f5bb 100644
--- a/cmd/cmd.go
+++ b/cmd/cmd.go
@@ -726,14 +726,17 @@ func ShowHandler(cmd *cobra.Command, args []string) error {
}
func showInfo(resp *api.ShowResponse) {
- arch := resp.ModelInfo["general.architecture"].(string)
-
modelData := [][]string{
- {"arch", arch},
{"parameters", resp.Details.ParameterSize},
{"quantization", resp.Details.QuantizationLevel},
- {"context length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.context_length", arch)].(float64))},
- {"embedding length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.embedding_length", arch)].(float64))},
+ }
+ if resp.ModelInfo != nil {
+ arch := resp.ModelInfo["general.architecture"].(string)
+ modelData = append(modelData,
+ []string{"arch", arch},
+ []string{"context length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.context_length", arch)].(float64))},
+ []string{"embedding length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.embedding_length", arch)].(float64))},
+ )
}
mainTableData := [][]string{