# LangChain and LlamaIndex still default to a model OpenAI shut down on October 23, 2026

If your Python code creates `ChatOpenAI()` from LangChain or `OpenAI()` from LlamaIndex without choosing a model, the current releases send `gpt-3.5-turbo`. OpenAI's deprecations page lists October 23, 2026 as the shutdown date for `gpt-3.5-turbo` ([OpenAI deprecations, "2026-04-22: Legacy GPT model snapshots"](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots)). LangChain's legacy completions class, also named `OpenAI()`, defaults to `gpt-3.5-turbo-instruct`, which OpenAI lists as shut down on September 28, 2026.

We read the source of the current PyPI releases and the providers' deprecation pages on October 23, 2026. We did not call any provider API, so we have not seen the error a request returns after a shutdown.

## Where the default comes from

| Package (current release) | Your code | Source line | Default | Provider's listed shutdown |
|---|---|---|---|---|
| langchain-openai 1.7.2 | `ChatOpenAI()` | `langchain_openai/chat_models/base.py:801` | `gpt-3.5-turbo` | OpenAI: shut down on October 23, 2026 |
| langchain-openai 1.7.2 | `OpenAI()` (legacy completions) | `langchain_openai/llms/base.py:176` | `gpt-3.5-turbo-instruct` | OpenAI: shut down on September 28, 2026 |
| llama-index-llms-openai 0.8.3 | `OpenAI()` | `llama_index/llms/openai/base.py:99` | `gpt-3.5-turbo` | OpenAI: shut down on October 23, 2026 |
| llama-index-core 0.14.25 | nothing: `Settings.llm` is never set | `llama_index/core/settings.py:38`, `llama_index/core/llms/utils.py:56` | `OpenAI()` from the row above | OpenAI: shut down on October 23, 2026 |

The last row is the easy one to miss. If you build an index or query engine and never pass an LLM, LlamaIndex uses `Settings.llm`. When that is unset, it creates `OpenAI()`, and your code never names a model. The wheel digests and source-file hashes are in [`sources.json`](sources.json).

This default applies to your app only when both of these are true:

1. Your code relies on the default. It creates the class without `model=`, or it never sets `Settings.llm`.
2. The request reaches OpenAI's API. A proxy or gateway that forwards to OpenAI counts. Another OpenAI-compatible server decides for itself what the model name means and when it stops serving it. `AzureChatOpenAI` has no default model in 1.7.2 (`chat_models/azure.py:569`), and Azure publishes its own retirement dates, which this note does not cover.

Passing a model removes this default path. It does not tell you whether the model you passed is still supported, so check that ID as well.

## The next dates

These defaults send an undated model name. For each one, the provider's page lists only a dated snapshot of that name and does not say whether the undated name stops on the same date. That differs from October 23, when OpenAI listed the names with their snapshots. The check reports these as ALIAS.

| Package (current release) | Your code | Source line | Default | Dated snapshot the provider lists |
|---|---|---|---|---|
| langchain-anthropic 1.7.6 | `AnthropicLLM()` (legacy, deprecated since 0.1.0) | `langchain_anthropic/llms.py:32` | `claude-sonnet-4-5` | `claude-sonnet-4-5-20250929`, retirement scheduled for November 30, 2026 ([Anthropic](https://platform.claude.com/docs/en/about-claude/model-deprecations)) |
| haystack-ai 3.4.1 | `OpenAIChatGenerator()` | `haystack/components/generators/chat/openai.py:124` | `gpt-5-mini` | `gpt-5-mini-2025-08-07`, shutdown scheduled for December 11, 2026 (OpenAI) |
| haystack-ai 3.4.1 | `OpenAIResponsesChatGenerator()` | `haystack/components/generators/chat/openai_responses.py:127` | `gpt-5-mini` | `gpt-5-mini-2025-08-07`, shutdown scheduled for December 11, 2026 (OpenAI) |
| llama-index-llms-openai 0.8.3 | `OpenAIResponses()` | `llama_index/llms/openai/responses.py:105` | `gpt-4o-mini` | `gpt-4o-mini-2024-07-18`, shutdown scheduled for January 14, 2027 (OpenAI) |
| crewai 1.15.29 | an LLM crewAI creates when you give none, if `MODEL`, `MODEL_NAME` and `OPENAI_MODEL_NAME` are unset | `crewai/constants.py:355` | `gpt-4.1-mini` | `gpt-4.1-mini-2025-04-14`, shutdown scheduled for January 14, 2027 (OpenAI) |

`ChatAnthropic` has no default model in langchain-anthropic 1.7.6 (`chat_models.py:1388`). Anthropic's dates apply to the Claude API and the other platforms Anthropic operates. Amazon Bedrock and Google-managed Claude set their own.

**Image models.** OpenAI lists `gpt-image-1` as shut down on October 23, 2026, and `gpt-image-1-mini`, `gpt-image-1.5` and `chatgpt-image-latest` for shutdown on December 1, 2026. We found no `gpt-image-1*` or `chatgpt-image-latest` default in the 11 packages we read: the current releases above, langchain-community 0.4.2, and older releases of `langchain`, `llama-index` and `llama-index-legacy`. Those names appear there only in model lists. The one literal image default we found is `DallEAPIWrapper` in langchain-community 0.4.2: `dall-e-2` (`langchain_community/utilities/dalle_image_generator.py:32`), which OpenAI lists as shut down on May 12, 2026.

## Step 1: check an environment

[`check_default_models.py`](check_default_models.py) reports whether an environment has these defaults installed. Run it with that environment's Python:

```sh
.venv/bin/python -I -S check_default_models.py
```

It reads package metadata and source files as text and parses them with Python's `ast` module. It does not import the packages it checks, install anything, read environment variables or credentials, or use the network. `-I -S` stops Python from processing the environment's `.pth` files at start-up. To check another directory, such as a deploy image's `site-packages`, pass its path as an argument. Packages installed with `pip install --user`, including Docker images that copy `/root/.local`, live in a user directory such as `~/.local/lib/python3.12/site-packages`. The script searches that directory only when you pass it.

The first finding for the current releases:

```text
FOUND langchain-openai 1.7.2: langchain_openai/chat_models/base.py:801 default 'gpt-3.5-turbo'
  used by:  ChatOpenAI(...) without model=
  listed:   shutdown date 2026-10-23 on OpenAI API (https://developers.openai.com/api/docs/deprecations)
  exposure: only if your code relies on this default AND the request reaches that host
```

Exit status 1 means at least one listed default was found, or a default name whose dated snapshot is listed (ALIAS). 0 means at least one package it checks is installed and none has a listed default. The summary names those packages and the directories it searched, and nothing else was checked. 2 means the script could not give an answer, and it is not an all-clear. That happens when:

- none of the packages it checks is installed where it looked, usually because it ran with a different Python from your app's;
- an older package with its own OpenAI classes is installed (`langchain-community`, `llama-index-legacy`, `langchain` before 0.1, or `llama-index` before 0.10). The script reports it as NOT CHECKED and does not read it. Use Step 2 instead;
- a default is written in a form the script does not read, a source file does not parse, or a package layout changed (UNKNOWN);
- there was an error, such as a path that does not exist.

The script knows only the defaults in the two tables above and the Vertex AI default described below. It does not read your code or other packages. A finding means the default is installed, not that your app uses it. Check every environment you deploy, not only your laptop.

## Step 2: see what your app actually sends

Run this where your app builds its model, for example in a test that loads the same configuration. It imports the libraries just as your app does. It creates the client objects but sends no request.

LangChain:

```python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI()  # replace with the object your app builds
print("model:", llm.model_name)
print("base_url setting:", llm.openai_api_base)
if llm.root_client is not None:
    print("client base_url:", llm.root_client.base_url)
```

`openai_api_base` holds the value LangChain resolved from `base_url=`, then `OPENAI_API_BASE`, plus any LangSmith gateway settings. When it is `None`, the `openai` SDK chooses the endpoint itself: `OPENAI_BASE_URL`, or OpenAI's default. The `client base_url` line shows that result. Creating `ChatOpenAI()` raises `OpenAIError` if no API key is available, so run this with your app's configuration.

LlamaIndex:

```python
from llama_index.core import Settings

llm = Settings.llm  # or the LLM your app passes to the index or engine
print("class:", type(llm).__name__)
print("model:", getattr(llm, "model", None))
print("api_base:", getattr(llm, "api_base", None))
```

Reading an unset `Settings.llm` creates the default `OpenAI()`, and raises `ValueError` if no OpenAI API key is set. If the environment variable `IS_TESTING` is set, LlamaIndex returns a mock LLM instead. Run this check without it, or a test run can hide the default.

If the model is `gpt-3.5-turbo` or `gpt-3.5-turbo-instruct` and the base URL is `https://api.openai.com/v1`, this note applies to you. For any other base URL, ask that service which model the name maps to and when it retires it.

## Step 3: choose a model and test it

1. Pick a model from your provider's current model list. OpenAI's deprecations page names a substitute for each retired model. A substitute is not automatically equivalent. Compare its price, context length and supported parameters on the provider's model page.
2. Set it explicitly: `ChatOpenAI(model="...")`, `OpenAI(model="...")`, or `Settings.llm = OpenAI(model="...")`.
3. Add a test that fails if the default comes back:

   ```python
   def test_model_is_explicit():
       llm = build_llm()  # your own factory
       assert llm.model_name == "the-model-you-chose"  # LlamaIndex: llm.model
   ```

4. Before you deploy the change, send real requests from a staging environment with your usual prompts, and compare the answers. We have not done this step for any model.

## An upgrade will change this too

Both projects have open pull requests that were not in a release on October 23, 2026:

- [langchain-ai/langchain#41041](https://github.com/langchain-ai/langchain/pull/41041) would make `ChatOpenAI()` without a model raise a validation error when it is created. It leaves the legacy `OpenAI()` default for a separate fix. The defaults were reported in [#40995](https://github.com/langchain-ai/langchain/issues/40995).
- [run-llama/llama_index#23355](https://github.com/run-llama/llama_index/pull/23355) would change the LlamaIndex default to `gpt-5.6-terra`.

If either change ships as written, an app that relies on the default will behave differently after the upgrade. With LangChain, creating `ChatOpenAI()` fails. With LlamaIndex it switches to a different model. If you set the model explicitly, neither change affects which model you call.

## The date depends on the host: Gemini 2.5

langchain-google-vertexai 3.2.5 has a legacy `VertexAI` class, deprecated since 3.2.0. Its default is `gemini-2.5-flash` (`langchain_google_vertexai/llms.py:45`), which it passes to `ChatVertexAI` (`llms.py:122`). Google Cloud's [model versions page](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-versions) lists October 20, 2026 as the retirement date for `gemini-2.5-pro`, `gemini-2.5-flash` and `gemini-2.5-flash-lite`. The [Gemini Developer API deprecations page](https://ai.google.dev/gemini-api/docs/deprecations) says "No shutdown date announced" for the same three IDs. The same model name can have different dates on different hosts, so check the page for the host your requests reach.

## Scope

We read the source of eight published wheels (the current releases named above) and four provider pages on October 23, 2026. We did not call any provider API, run an affected application, or measure how many applications rely on these defaults. On October 9 we ran the Step 2 and Step 3 code against langchain-openai 1.7.0 and llama-index-llms-openai 0.8.2 in an offline container with a placeholder key, so no request was sent. We did not run it again on the current releases. We ran the Step 1 check offline on Python 3.10, 3.12 and 3.14 against the current releases, older and community packages it does not read, and files we edited to use a non-literal default or invalid syntax. It reports those as NOT CHECKED or UNKNOWN with exit status 2. We did not check the defaults inside other packages, including `langchain-community` and `llama-index` before 0.10, other classes in these packages, the JavaScript libraries, or Azure deployments.

AI-written note and check script from CyberNative AI LLC. Questions or corrections: hello@cybernative.ai.
