LangChain ships provider integrations as separate packages: @langchain/openai on npm, langchain-openai on pip. Each ecosystem has its own prefix, and the vendor name is the suffix.
Think of the way a phone comes with a charging cable in the box but the cable for the next phone you buy lives in a different box. Old LangChain kept every vendor's cable in one giant catalogue. You still had to buy each plug separately, and a change to one cable meant reprinting the whole catalogue. New LangChain ships the core box (the phone), and each vendor's cable comes in its own box with the right plug inside. You grab only the cables you need. The npm world labels its cable boxes with an organisation prefix and a slash. The pip world labels its boxes with a hyphen. The idea is the same, with two different stickers.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
LangChain's packaging sounds like trivia until a production install breaks on a version mismatch between two LangChain packages. The packaging split that landed with LangChain 0.1 in early 2024 turned one large package of integrations into a layered architecture. The per-provider package shape is the visible result.
The layers, the npm and pip naming conventions, and the version-compatibility matrix explain how to name the package for any provider in either ecosystem. They also explain why mixing versions across the layers can break things. The same shape also lowers the cost of switching providers or removing LangChain.
The pre-split history and why the split happened
Pre-0.1 LangChain (through late 2023) shipped as a single Python package and a single JS package. Inside that package, every vendor integration was an inline module: langchain.chat_models.ChatOpenAI, langchain.chat_models.ChatAnthropic, langchain.embeddings.CohereEmbeddings, and so on. Each module imported its vendor SDK lazily, and the SDKs were optional extras (langchain[openai], langchain[all]) that you installed yourself.
That design had costs. Because every dependency was optional, langchain could not pin vendor SDK versions tightly, and installing a working combination of versions was often hard. A breaking change in one vendor SDK needed a release of all of LangChain. The single package also grew large and unstable as it tried to maintain every integration at once.
The LangChain team's response in early 2024 was a hard split into layered packages. The langchain package stayed, but the canonical install path became 'one package per provider' plus a small core. The v0.1.0 announcement names the reasons: better dependency management, per-integration versioning of breaking changes, and a stable core. The migration was disruptive (many import paths changed), but the resulting architecture let each integration evolve on its own schedule.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Production Next.js apps using @langchain/openai typically also install @langchain/core directly to pin the Runnable protocol version.
- Python serverless deploys on AWS Lambda or Cloud Run use langchain-openai instead of the umbrella langchain to keep cold-start install size under the runtime limits.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhat is in langchain-core versus langchain versus langchain-openai?
langchain-core holds the abstract base classes (BaseChatModel, Runnable, callback protocol). langchain-openai implements ChatOpenAI and OpenAIEmbeddings against core. langchain (v1) is a slim package for building agents (create_agent, init_chat_model), mostly re-exported from core; legacy chains moved to langchain-classic.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Installing only the langchain package and expecting ChatOpenAI to be in it. In LangChain v1, ChatOpenAI comes only from the provider package langchain-openai (or the langchain[openai] extra that installs it).
60 second bullets to scan on the way to the call.
The three-layer split: core, per-provider, langchain
Why the split happened (dependency management, per-integration versioning, core stability)
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.