Skip to content

Move the AI Answer default off gpt-3.5-turbo before its 23 October shutdown - #403

Open
Lakshya-0910 wants to merge 1 commit into
appbaseio:devfrom
Lakshya-0910:fix/ai-answer-default-model
Open

Lakshya-0910 wants to merge 1 commit into
appbaseio:devfrom
Lakshya-0910:fix/ai-answer-default-model

Conversation

@Lakshya-0910

Copy link
Copy Markdown

Closes #402.

  • Default model: gpt-3.5-turbo → gpt-4.1-mini in plugins/pipelines/ai_answer.go and plugins/openai/util.go. OpenAI shuts gpt-3.5-turbo down on 23 October 2026; gpt-4.1-mini is not retiring and accepts max_tokens as sent today.
  • GPT-5 models: BuildChatGPTBody sends the limit as max_completion_tokens when the model starts with gpt-5 (they reject max_tokens). Every other model gets exactly the body it gets now.
  • Tests: body_test.go covers both (and fails on the current code). TestTrimContextAsPerLimits was sized for gpt-3.5-turbo's 4,096-token window and picked up the default model implicitly, so it now sets that model explicitly; its cases are unchanged. go test ./plugins/openai/ ./plugins/pipelines/ passes; go build ./... and gofmt are clean.

Tested live today with the default system prompt and a 300-token limit:

  • gpt-4.1-mini with max_tokens: 300: answered normally.
  • gpt-5.6-terra with max_completion_tokens: 300 (the new body): answered normally.
  • gpt-5.6-terra with max_tokens: 300 (the current body): 400 Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.

…utdown

OpenAI shuts gpt-3.5-turbo down on 23 October 2026. The default becomes
gpt-4.1-mini, which is not retiring and accepts max_tokens. GPT-5 models
reject max_tokens, so BuildChatGPTBody sends the limit as
max_completion_tokens for them; other models are unchanged.

TestTrimContextAsPerLimits was sized for gpt-3.5-turbo's 4,096-token window
and relied on the default model; it now names that model explicitly.

Closes appbaseio#402
Comment thread plugins/openai/util.go
@Lakshya-0910

Lakshya-0910 commented Oct 6, 2026 •

Copy link
Copy Markdown
Author

Thanks for the review, @nisatsama! I think that comment landed on the removed line (the red side of the diff). In this branch, max_tokens is only set in the else branch, so a gpt-5* body carries max_completion_tokens alone (plugins/openai/util.go:1268-1272). TestBuildChatGPTBodyTokenLimitField passes on this commit (36fb85b) and checks exactly that. Happy to change anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI Answer stops working on 23 October: the gpt-3.5-turbo default shuts down, and its replacement rejects max_tokens

2 participants