Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
fix model name returned by `/api/generate` being different than the model name provided
Jeffrey Morganfa2f095bd9f0
diff --git a/llm/llama.go b/llm/llama.goindex 25e03284c..6ccac861f 100644--- a/llm/llama.go+++ b/llm/llama.go@@ -545,7 +545,6 @@ type prediction struct {const maxBufferSize = 512 * format.KiloBytetype PredictOpts struct {- Model stringPrompt stringFormat stringCheckpointStart time.Time@@ -553,7 +552,6 @@ type PredictOpts struct {}type PredictResult struct {- Model stringCreatedAt time.TimeTotalDuration time.DurationLoadDuration time.Duration@@ -651,7 +649,6 @@ func (llm *llama) Predict(ctx context.Context, predict PredictOpts, fn func(Predif p.Content != "" {fn(PredictResult{- Model: predict.Model,CreatedAt: time.Now().UTC(),Content: p.Content,})@@ -659,7 +656,6 @@ func (llm *llama) Predict(ctx context.Context, predict PredictOpts, fn func(Predif p.Stop {fn(PredictResult{- Model: predict.Model,CreatedAt: time.Now().UTC(),TotalDuration: time.Since(predict.CheckpointStart),diff --git a/server/routes.go b/server/routes.goindex 8821d9cf6..f2214b324 100644--- a/server/routes.go+++ b/server/routes.go@@ -260,7 +260,7 @@ func GenerateHandler(c *gin.Context) {}resp := api.GenerateResponse{- Model: r.Model,+ Model: req.Model,CreatedAt: r.CreatedAt,Done: r.Done,Response: r.Content,@@ -288,7 +288,6 @@ func GenerateHandler(c *gin.Context) {// Start predictionpredictReq := llm.PredictOpts{- Model: model.Name,Prompt: prompt,Format: req.Format,CheckpointStart: checkpointStart,@@ -985,7 +984,7 @@ func ChatHandler(c *gin.Context) {loaded.expireTimer.Reset(sessionDuration)resp := api.ChatResponse{- Model: r.Model,+ Model: req.Model,CreatedAt: r.CreatedAt,Done: r.Done,Metrics: api.Metrics{@@ -1007,7 +1006,6 @@ func ChatHandler(c *gin.Context) {// Start predictionpredictReq := llm.PredictOpts{- Model: model.Name,Prompt: prompt,Format: req.Format,CheckpointStart: checkpointStart,