Skip to content

Commit

Permalink
Update default MaxToken from 512 to 4096 for modern model support.
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho committed Sep 17, 2024
1 parent 8a71d37 commit 87182fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/chat_model_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ func (h *ChatModelHandler) DeleteChatModel(w http.ResponseWriter, r *http.Reques

func (h *ChatModelHandler) GetDefaultChatModel(w http.ResponseWriter, r *http.Request) {
ChatModel, err := h.db.GetDefaultChatModel(r.Context())
// default 512 is for history reasaon, now most model support 4096 and token is cheap
if ChatModel.MaxToken == 512 {
ChatModel.MaxToken = 4096
}
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(fmt.Sprintf("Error retrieving default chat API: %s", err.Error())))
Expand Down

0 comments on commit 87182fe

Please sign in to comment.