Repository navigation
[Backport 3.9] Replace retired OpenAI models in tests and docs - #5130
Merged
ylwu-amzn merged 1 commit intoOct 13, 2026
Merged
Conversation
) Every OPENAI_KEY-gated test and every OpenAI doc example used a model that OpenAI has retired or is about to retire, so the tests fail against the live API and the docs no longer work as written: gpt-3.5-turbo-instruct shut down 2026-09-28 gpt-3.5-turbo-0613 shut down 2024-09-13 gpt-3.5-turbo shuts down 2026-10-23 (alias of gpt-3.5-turbo-0125) gpt-4 shuts down 2026-10-23 (alias of gpt-4-0613) See https://developers.openai.com/api/docs/deprecations. Move every model id that reaches OpenAI to gpt-4o-mini, which is not on any deprecation list and accepts the same max_tokens and temperature parameters. The connectors that targeted the legacy /v1/completions endpoint move to /v1/chat/completions, because gpt-3.5-turbo-instruct was the last model serving that endpoint: RestMLRemoteInferenceIT 5 connectors RestMLGuardrailsIT 2 connectors, plus response_filter RestMLConnectorReferenceGuardIT 1 connector TestHelper 1 connector RestGenerativeSearchResponseIT 1 connector and 2 llm_model values RestMLRAGSearchProcessorIT 1 connector and 1 model constant RestMLGrpcPredictStreamIT 1 connector RestMLGrpcExecuteAgentStreamIT 1 connector For the connectors moving to chat completions, the content assertions move from choices[0].text to choices[0].message.content, and the guardrail response_filter from $.choices[0].text to $.choices[0].message.content. llm_model has to change alongside the connector parameter because DefaultLlmImpl injects it as the model parameter for the OPENAI provider, overriding the value set in the connector. RestMLRAGSearchProcessorIT declared both OPENAI_MODEL and OPENAI_40_MODEL. Pointing the former at gpt-4o-mini would have left two differently named constants with the same value, so OPENAI_40_MODEL is removed and its usages consolidated onto OPENAI_MODEL. Also fix an error-masking bug in the RestMLRemoteInferenceIT predict harness. verifyResponse.accept(...) ran inside the same try block as predictRemoteModel(...), so an AssertionError raised by the verifier was caught and rerouted into the failure path, where it was reported as an unexpected exception instead of the assertion that actually failed. Only the predict call stays inside the try now. Docs: add a deprecation warning to the completion blueprint, whose legacy /v1/completions example has no live replacement model and is retained for reference only, and update the chat blueprint, the remote inference tutorial, the chatbot tutorial, and the search-processors README. Verified against the live OpenAI API with -Dgrpc=true: 58 tests, 0 failures, 7 skipped. Per-test durations confirm the OpenAI paths made real API calls rather than returning early on a missing key. Signed-off-by: Tony Piazza <tony.piazza@aiven.io> (cherry picked from commit 8b17b1b)
tonypiazza
requested review from
HenryL27,
Zhangxunmt,
akolarkunnu,
austintlee,
b4sjoo,
jiapingzeng,
mingshl,
model-collapse,
pyek-bot,
rbhavna,
rithinpullela,
sam-herman,
ylwu-amzn and
zane-neo
as code owners
October 10, 2026 01:01
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
tonypiazza
deployed
to
ml-commons-cicd-env-require-approval
October 10, 2026 01:02 — with
GitHub Actions
Active
tonypiazza
deployed
to
ml-commons-cicd-env-require-approval
October 10, 2026 01:02 — with
GitHub Actions
Active
tonypiazza
deployed
to
ml-commons-cicd-env-require-approval
October 10, 2026 01:02 — with
GitHub Actions
Active
tonypiazza
deployed
to
ml-commons-cicd-env-require-approval
October 10, 2026 01:02 — with
GitHub Actions
Active
Contributor
Author
|
That is a false positive. |
tonypiazza
deployed
to
ml-commons-cicd-env-require-approval
October 13, 2026 19:50 — with
GitHub Actions
Active
tonypiazza
deployed
to
ml-commons-cicd-env-require-approval
October 13, 2026 19:50 — with
GitHub Actions
Active
ylwu-amzn
approved these changes
Oct 13, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Manual backport of #5110 to 3.9. That PR merged to
mainon 2026-10-05 without abackport 3.9label, so the automation never ran and 3.9 still references models OpenAI has retired.On 3.9 today,
plugin/src/testhas 7 references togpt-3.5-turbo-instruct, which shut down on 2026-09-28, and 8 togpt-3.5-turbo, which shuts down on 2026-10-23. TheOPENAI_KEY-gated integration tests fail with:This is a clean
git cherry-pick -xof8b17b1ba4with no conflicts and no adaptation needed.Why it is worth doing now
It unblocks #5128, the automatic backport of #5103. That PR's four
Build and Testjobs are currently waiting for workflow approval, and when they run they will fail on these same retired models rather than on anything in that PR. Merging this first means #5128 can go green on its own merits.Independently of that, 3.9's OpenAI integration tests are failing today and the
gpt-3.5-turbohalf breaks in two weeks.Testing
cherry-pick -xapplied with no conflicts; diff is identical to the original (13 files, +118/-79):opensearch-ml-plugin:testand:opensearch-ml-common:teston this branch: 6977 tests, 0 failurescompileTestJavaandspotlessCheck: cleangpt-3.5-turbo-instruct,gpt-3.5-turbo-0613or baregpt-3.5-turboremains at any live-call site. The only remaining mentions are the deprecation warning and the retained reference example inopen_ai_connector_completion_blueprint.md.The
OPENAI_KEY-gated integration tests are not run locally here, since they need a key and a cluster. They were verified onmainbefore #5110 merged (58 tests, 0 failures, 7 skipped against the live API) and CI will exercise them on this branch.Related Issues
Backport of #5110. Unblocks #5128.
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.