Registry / llm-agents / langchain-classic

langchain-classic

JSON →
library1.0.8pypypi✓ verified 25d ago

LangChain Classic is a legacy Python package providing the original API for building applications with Large Language Models (LLMs) through composability. It represents the state of the `langchain` library prior to its major architectural refactor (pre-0.1.0/0.2.0, before v1.0), which split the project into `langchain-core`, `langchain-community`, and partner packages. This package is in maintenance mode for backward compatibility and does not receive new features; it is not recommended for new projects.

pip install langchain-classic
INSTALL
IMPORT
SIG · LANGCHAIN-CLASSIC
L
langchain-classic
llm-agentspythonv1.0.8
Install
9.4s avg
Import
2685ms
Disk
114MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 11.1s
py 3.11
✓ —
✓ 9.6s
py 3.12
✓ —
✓ 8.5s
py 3.13
✓ —
✓ 8.3s
py 3.9
✕ build_error
✕ build_error
114MB installed
● package 114MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LLMChain
from langchain_classic.chains import LLMChain
from langchain.chains import LLMChain

This quickstart demonstrates a basic LLM interaction using an `LLMChain` with an OpenAI model and a `PromptTemplate`, typical of `langchain-classic` usage. Ensure `OPENAI_API_KEY` is set in your environment variables.

import os from langchain.llms import OpenAI from langchain.prompts import PromptTemplate from langchain.chains import LLMChain # Set your OpenAI API key as an environment variable (e.g., export OPENAI_API_KEY="sk-...") # For this example, we use os.environ.get to prevent errors if the key is not set. openai_api_key = os.environ.get('OPENAI_API_KEY', '') if not openai_api_key: print("Warning: OPENAI_API_KEY environment variable not set. Please set it to run the example.") print("Skipping LLM interaction.") else: llm = OpenAI(openai_api_key=openai_api_key, temperature=0.7) prompt = PromptTemplate( input_variables=["topic"], template="Tell me a short, funny joke about {topic}." ) chain = LLMChain(llm=llm, prompt=prompt) try: response = chain.run("developers") print(f"Joke about developers:\n{response}") except Exception as e: print(f"An error occurred during LLM interaction: {e}") print("Please ensure your OPENAI_API_KEY is valid and has access to the OpenAI API.")
Debug
Known issues
breakingLangChain Classic's API is fundamentally incompatible with the modern LangChain (v1.0+) ecosystem, including `langchain-core`, `langchain-community`, and partner packages. Direct migration requires significant code changes.
fix
For new projects, use `langchain` (v1.0+) and its modular components (`langchain-core`, `langchain-openai`, etc.). For existing projects, consider a full migration to the new API or continue using `langchain-classic` in isolation.
affects: All versions
deprecatedThe `langchain-classic` package is explicitly for backward compatibility with pre-v1.0 LangChain and is not actively developed for new features.
fix
New development should target the latest `langchain` package (v1.0+) and its structured approach to agents, models, and tools. Refer to the official LangChain migration guides.
affects: All versions
gotchaAttempting to mix `langchain-classic` with newer `langchain` packages (e.g., `langchain-core`, `langchain-community`, `langchain-openai`) will likely lead to dependency conflicts, import errors, and runtime issues due to incompatible APIs and overlapping namespaces.
fix
Maintain strict separation. If using `langchain-classic`, avoid installing or using any other `langchain-*` packages that are part of the v1.0+ ecosystem, unless explicitly stated in `langchain-classic` documentation as compatible dependencies. Check `pip freeze` for installed `langchain` related packages.
affects: All versions
gotchaLangChain Classic will not receive new features, performance optimizations, or regular bug fixes available in the ongoing development of the main `langchain` library. This includes updates for new LLM capabilities or provider integrations.
fix
To access the latest advancements in LLM technology and LangChain's framework, a migration to the modern `langchain` architecture is necessary.
affects: All versions
gotchaThe package `langchain-classic` does not exist on PyPI as an installable package name. To install versions of LangChain prior to v1.0 (which is conceptually referred to as 'LangChain Classic'), you must specify a version constraint on the `langchain` package itself.
fix
To install versions of LangChain corresponding to 'LangChain Classic' (pre-v1.0), use `pip install langchain<1.0`. For example, `pip install 'langchain==0.1.20'` for a specific pre-v1.0 version. Refer to other warnings for details on migrating to LangChain v1.0+ or continuing with classic versions.
affects: All versions
Upgrade
Version history
1.0.8latest on PyPI · released Jun 10, 2026
Audit
Dependencies
pythonrequiredRequired Python version for the package.
openaioptionalCommonly used LLM provider for quickstart examples.
langchain-corerequiredRequired peer dependency for some functionalities within langchain-classic, as it re-exports components from langchain-core.
pyyamlrequiredGeneral dependency often used in LangChain for configuration and loading.
pydanticrequiredUsed for data validation and settings management.
requestsrequiredHTTP client for making API calls.
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
langchain-classic — pip install langchain-classic · libregistry