Skip to main content

langchain-ollama

This package contains the LangChain integration with Ollama

Installation

pip install -U langchain-ollama

You will also need to run the Ollama server locally. You can download it here.

Chat Models

ChatOllama class exposes chat models from Ollama.

from langchain_ollama import ChatOllama

llm = ChatOllama(model="llama3-groq-tool-use")
llm.invoke("Sing a ballad of LangChain.")

Embeddings

OllamaEmbeddings class exposes embeddings from Ollama.

from langchain_ollama import OllamaEmbeddings

embeddings = OllamaEmbeddings(model="llama3")
embeddings.embed_query("What is the meaning of life?")

LLMs

OllamaLLM class exposes LLMs from Ollama.

from langchain_ollama import OllamaLLM

llm = OllamaLLM(model="llama3")
llm.invoke("The meaning of life is")

Metadata

Release files for gigachain-ollama 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gigachain-ollama 0.1.1
File Size Uploaded
gigachain_ollama-0.1.1.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gigachain-ollama 0.1.1
File Interpreter ABI Platform
gigachain_ollama-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / gigachain_ollama-0.1.1.tar.gz

Download URL gigachain_ollama-0.1.1.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
22014c1000564b7d6f24b63b35d26e3d355e9134053ed682f847e971ff2d234a
BLAKE2b-256 checksum
How to use checksums
71a65dd52a1d522049e34b0ba47189e3c75a7daa90bd7cf4a5fd3d192a1d5233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.6 Darwin/23.5.0

Release files / gigachain_ollama-0.1.1-py3-none-any.whl

Download URL gigachain_ollama-0.1.1-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1917f41670828c54adf86a32769746d836c97e22c3dc96daa8b5d1acb96d98c
BLAKE2b-256 checksum
How to use checksums
95ea2ec7ee0cdf80280608cca01980b9f6eaf59dcb2cfdd594d36d2f6aaa4a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.6 Darwin/23.5.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page