Skip to content

langchain-openai: OpenAI() defaults to gpt-3.5-turbo-instruct (shut down Sep 28) and ChatOpenAI() to gpt-3.5-turbo (shuts down Oct 23) #40995

Description

@23821

Submission checklist

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-typesafe
  • langchain-xai
  • Other / not sure / general

Related Issues / PRs

No response

Reproduction Steps / Example Code (Python)

from langchain_openai import ChatOpenAI, OpenAI

# No model given, so the class defaults are used.
OpenAI().invoke("Say hi")      # default "gpt-3.5-turbo-instruct": OpenAI shut it down on September 28, 2026
ChatOpenAI().invoke("Say hi")  # default "gpt-3.5-turbo": OpenAI shuts it down on October 23, 2026

Error Message and Stack Trace (if applicable)

Description

Both classes default to models OpenAI is retiring, so anyone who doesn't pass model gets an error:

  • OpenAI (completions): model_name: str = Field(default="gpt-3.5-turbo-instruct", alias="model"), llms/base.py:176. OpenAI shut gpt-3.5-turbo-instruct down on September 28, 2026.
  • ChatOpenAI: model_name: str = Field(default="gpt-3.5-turbo", alias="model"), chat_models/base.py:801. OpenAI shuts gpt-3.5-turbo down on October 23, 2026.

Source: https://developers.openai.com/api/docs/deprecations ("To improve reliability and make it easier for developers to choose the right models, we are deprecating a set of older OpenAI models"). OpenAI names gpt-5.6-terra as the replacement for both.

No error output is included: this was found by reading the code, not from a local run. OpenAI's deprecations page says access to these models is shut down on those dates.

Two things make this more than a one-line swap, which is why I'm asking before a pull request:

  1. OpenAI uses the legacy Completions endpoint, and OpenAI's model page for gpt-5.6-terra lists the legacy Completions endpoint as "Not supported". So there may be no completions model to default to anymore; the choice is yours (a different default, no default, or a clear error).
  2. gpt-5.6-terra is a reasoning model (OpenAI's model page: "Reasoning.effort supports: none, low, medium (default), high, xhigh, and max"). If ChatOpenAI's default moves to it, anything that relies on the default's behaviour with temperature or max_tokens may need care; OpenAI's API reference says max_tokens "is deprecated in favor of max_completion_tokens, and is not compatible with o-series models".

Happy to send the pull request once you've decided on the default and assigned it.

Found with YakBarber, a tool I'm building that tracks API retirements; both lines were checked on master on October 2, 2026 before filing.

System Info

Found by reading langchain-openai on master (October 2, 2026), not from a local install; happy to add python -m langchain_core.sys_info output if that helps.

Social handles (optional)

linkedin:https://www.linkedin.com/in/omar-shalaby-545726256
Website: yakbarber.com

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing featureexternalopenai`langchain-openai` package issues & PRs

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions