skillfed

langchain-ollama

An integration package connecting Ollama and LangChain

langchain-ollama v1.1.0 3.1M downloads/30d#2,743 on PyPI144,266
Permissive license MIT Active released

What it is and what it does

This package is a LangChain integration that bridges your Python application to Ollama, a tool for running large language models locally. Instead of calling a remote API, you use LangChain's standard interfaces to interact with models running on your own machine or network via Ollama. It depends on langchain-core for the framework abstractions and ollama for the underlying model communication.

The integration lets you build LangChain applications—chains, agents, RAG systems—that use locally-hosted models rather than cloud-based APIs. This is useful when you need privacy, want to avoid API costs, or prefer to run models on your own hardware. The package is actively maintained, supports Python 3.10 through 3.14, and carries no known security vulnerabilities.

Use it for:

  • Build a RAG pipeline that retrieves documents and generates answers using a locally-run model without cloud API calls.
  • Create a chatbot or agent that uses Ollama models through LangChain's standard chat and tool-calling interfaces.
  • Prototype LangChain applications offline or in air-gapped environments where cloud API access is unavailable.
  • Run inference on sensitive data using local models to avoid sending data to external services.
  • Experiment with different open-source models through Ollama while keeping the same LangChain application code.

Worth the install?

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

Connects LangChain applications to Ollama, enabling use of locally-run language models through a unified LangChain interface.

Yes. This is a lightweight, actively maintained integration with no security issues, permissive licensing, and strong community backing. Install it if you want to use Ollama models within LangChain applications. The only prerequisite is having Ollama itself installed and running separately.

Install

langchain-ollama on PyPI

pip

pip install langchain-ollama

uv

uv add langchain-ollama

poetry

poetry add langchain-ollama

Installing langchain-ollama

Before you install

Low friction install with just two runtime dependencies. Actively maintained with recent releases; repo shows strong community engagement and no archived status.

License in practice

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

Quickstart

pip install langchain-ollama

from langchain_ollama import OllamaLLM

llm = OllamaLLM(model="llama2")
response = llm.invoke("What is machine learning?")

Ollama must be installed and running as a service on your system or network before the integration can connect to it.

Verify before relying

  • Whether Ollama must be installed and running separately as a system service or daemon
  • Specific Ollama versions or model formats supported by this integration
  • Performance characteristics or latency overhead of the LangChain-Ollama bridge

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, ollama
Maintenance actively maintained — 129 days since the last release
Last repo commit
First released
Downloads 3,121,125/month — #2,743 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: langchain_ollama-1.1.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 ollama integrationlocal llm with langchainollama language model wrapperlangchain local model providerrun ollama in langchainlangchain ollama connector
langchain-integrationlocal-llmollama

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

langchain-huggingface

Connects Hugging Face models and embeddings to…

permissive · top 5,000 on PyPI

langchain-mistralai

Connects Mistral AI language models to…

permissive · top 5,000 on PyPI

langchain-perplexity

Integrates Perplexity AI models into LangChain…

permissive · top 15,000 on PyPI

langchain-aws

Connects LangChain applications to AWS services…

permissive · top 5,000 on PyPI

langchain-xai

Connects xAI's language models to LangChain…

permissive · top 5,000 on PyPI

langchain-openai

Provides LangChain integrations for OpenAI's…

permissive · top 1,000 on PyPI

langchain-community

Provides third-party integrations for LangChain…

permissive · top 1,000 on PyPI

langchain-deepseek

Integrates DeepSeek language models into…

permissive · top 5,000 on PyPI

langchain-groq

Connects Groq's inference API to LangChain,…

permissive · top 5,000 on PyPI

langchain-text-splitters

Splits text documents into chunks using a…

permissive · top 1,000 on PyPI