Fill in the npm and pip package names for LangChain's OpenAI provider integration
LangChain ships provider integrations as separate packages: `@langchain/openai` on npm, `langchain-openai` on pip; one prefix per ecosystem, 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 shipped every vendor's cable inside one giant box; you got a working OpenAI cable and 30 cables you would never plug in, plus the weight of all of them. New LangChain ships the core box (the phone) and you grab only the cables you actually need. The npm world labels its cable boxes with an organisation prefix and a slash; the pip world labels its boxes with a hyphen. Same idea, two stickers.
Detailed answer & concept explanation~6 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: the three-layer split + per-provider package shape + npm vs pip conventions + version-skew traps + JS/Python parity + langchain-community tier.
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.
- The LangChain v1 docs in 2026 use the per-provider package names exclusively in code samples; the umbrella package is mentioned only for migration.
- OpenInference and Langfuse integration guides assume the per-provider package shape; their callback handlers attach to `ChatOpenAI` imported from `@langchain/openai`.
- The langchain-community / @langchain/community packages are explicitly second-tier and intended for integrations that are not maintained by the core team.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhat is in `langchain-core` versus `langchain` versus `langchain-openai`?
QHow do you handle version skew across `langchain-core` and a provider package in CI?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Installing the umbrella `langchain` package and importing `ChatOpenAI` from it. That works through a re-export but pulls extra weight; modern code imports from the provider-specific package directly.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.