skillfed

langchain-perplexity

An integration package connecting Perplexity and LangChain

langchain-perplexity v1.4.0 363.7K downloads/30d#7,218 on PyPI144,266
Permissive license MIT Active released

What it is and what it does

langchain-perplexity is a bridge package that connects Perplexity AI models to the LangChain framework. It wraps Perplexity's API behind LangChain's standard model interface, allowing you to use Perplexity as a language model provider in chains, agents, and other LangChain constructs without writing custom API integration code.

The package depends on langchain-core (LangChain's base abstractions) and perplexityai (the Perplexity client library). It's designed for developers building AI applications with LangChain who want to leverage Perplexity's models as one option among many supported providers. The package is actively maintained, supports Python 3.10 through 3.14, and carries a permissive MIT license.

Use it for:

  • Use it to swap Perplexity models into an existing LangChain application without rewriting integration code.
  • Use it to build multi-model LangChain agents that can route queries to Perplexity or other providers.
  • Use it to prototype AI workflows with Perplexity models before committing to a specific provider.
  • Use it to add Perplexity's search-augmented capabilities to LangChain RAG or question-answering pipelines.
  • Use it in LangChain-based chatbots or assistants that need to call Perplexity as a reasoning or generation step.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Integrates Perplexity AI models into LangChain applications, enabling you to use Perplexity's language models as a component in LangChain workflows.

Yes. The package is actively maintained, carries no known vulnerabilities, has low install friction, and integrates cleanly into LangChain workflows. Install it if you're already using LangChain and want to add Perplexity as a model provider—it's the standard way to do so. No concerns about maintenance or licensing.

Install

langchain-perplexity on PyPI

pip

pip install langchain-perplexity

uv

uv add langchain-perplexity

poetry

poetry add langchain-perplexity

Installing langchain-perplexity

Before you install

Low friction install with just two runtime dependencies. Actively maintained with a recent release 66 days ago and an active repository.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install langchain-perplexity

from langchain_perplexity import ChatPerplexity

model = ChatPerplexity()
response = model.invoke("What is the capital of France?")

Requires Python 3.10 or later and a Perplexity API key or account to authenticate requests.

Verify before relying

  • Whether Perplexity API credentials or account setup is required before the package can be used
  • What specific Perplexity models are supported and whether model selection is configurable
  • Whether the package handles rate limiting or quota management for Perplexity API calls

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0.0,>=3.10.0)
Install friction low — pure-Python wheel
Runtime dependencies 2 — langchain-core, perplexityai
Maintenance actively maintained — 66 days since the last release
Last repo commit
First released
Downloads 363,655/month — #7,218 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: langchain_perplexity-1.4.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

langchain perplexity integrationperplexity ai langchainperplexity llm providerlangchain model integrationperplexity language modelai model integration langchainperplexity api wrapper
langchain-integrationai-model-provider

More Artificial Intelligence packages