Open-Source Wikis

/

LangChain

/

Partners

langchain-ai/langchain

Partners

15 first-party provider integrations live in this monorepo under libs/partners/. Each one is an independently versioned Python package that wraps a vendor's SDK and exposes it through the LangChain interfaces (BaseChatModel, BaseLLM, Embeddings, BaseTool, VectorStore, …).

Partners not in this monorepo (Google, AWS, Cohere, NVIDIA, IBM, …) live in sibling repositories under the langchain-ai/ GitHub org. They follow the same conventions and inherit from the same standard tests.

Partner Path Surface Page
OpenAI libs/partners/openai/ ChatOpenAI, OpenAIEmbeddings, OpenAI (LLM), Azure variants openai
Anthropic libs/partners/anthropic/ ChatAnthropic, AnthropicLLM anthropic
Ollama libs/partners/ollama/ ChatOllama, OllamaLLM, OllamaEmbeddings other-providers
Groq libs/partners/groq/ ChatGroq other-providers
Mistral AI libs/partners/mistralai/ ChatMistralAI, MistralAIEmbeddings other-providers
Hugging Face libs/partners/huggingface/ ChatHuggingFace, HuggingFaceEmbeddings, pipelines other-providers
DeepSeek libs/partners/deepseek/ ChatDeepSeek other-providers
Fireworks libs/partners/fireworks/ ChatFireworks, FireworksEmbeddings other-providers
OpenRouter libs/partners/openrouter/ ChatOpenRouter other-providers
Perplexity libs/partners/perplexity/ ChatPerplexity other-providers
xAI libs/partners/xai/ ChatXAI other-providers
Exa libs/partners/exa/ ExaSearchRetriever, ExaSearchResults other-providers
Nomic libs/partners/nomic/ NomicEmbeddings other-providers
Chroma libs/partners/chroma/ Chroma (vector store) other-providers
Qdrant libs/partners/qdrant/ QdrantVectorStore, FastEmbedEmbeddings other-providers

What every partner has

  • langchain_<provider>/__init__.py — re-exports the public classes.
  • langchain_<provider>/chat_models.py (or chat_models/ directory for the larger ones) — BaseChatModel / BaseChatModelV1 implementation.
  • langchain_<provider>/embeddings.py (when applicable).
  • langchain_<provider>/llms.py (when applicable; many partners are chat-only now).
  • langchain_<provider>/tools.py or tools/ — provider-specific tools (e.g. custom_tool for OpenAI).
  • langchain_<provider>/data/ — model capability profiles in JSON, with an optional profile_augmentations.toml for human overrides.
  • tests/unit_tests/ and tests/integration_tests/ — standard tests inherited from libs/standard-tests/.

Lazy provider dispatch

The top-level langchain package never imports any partner directly. Users get a partner via init_chat_model:

from langchain.chat_models import init_chat_model
model = init_chat_model("openai:gpt-5")
model = init_chat_model("anthropic:claude-sonnet-4")
model = init_chat_model("ollama:llama3.2")

The provider registry _BUILTIN_PROVIDERS in libs/langchain_v1/langchain/chat_models/base.py maps a provider key to a (module_path, class_name, ctor) tuple. The partner SDK is imported via importlib.import_module only when first requested.

Partner CI

Every partner has the same CI shape:

  • _lint.yml runs ruff + mypy.
  • _test.yml runs unit tests across Python 3.10–3.14 with pytest-socket blocking network.
  • _test_pydantic.yml runs the matrix against multiple Pydantic minor versions.
  • _test_vcr.yml replays VCR cassettes.
  • integration_tests.yml runs the standard-tests integration suite gated on API keys in CI secrets.
  • _release.yml ships a new version when a maintainer triggers it.
  • _refresh_model_profiles.yml keeps the data/ directory current.

Adding a new partner

When adding a new libs/partners/<provider>/, the maintainers also update:

  • .github/ISSUE_TEMPLATE/*.yml — add to the package dropdown
  • .github/dependabot.yml — dependency update entry
  • .github/scripts/pr-labeler-config.json — label rules
  • .github/workflows/_release.yml — API key secrets if required
  • .github/workflows/auto-label-by-package.yml
  • .github/workflows/check_diffs.yml
  • .github/workflows/integration_tests.yml
  • .github/workflows/pr_lint.yml — allowed scope

The full list lives in CLAUDE.md under "Adding a new partner to CI".

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Partners – LangChain wiki | Factory