Skip to main content

An integration package connecting Ollama and LangChain

Reason this release was yanked:

incorrect core dep - use 0.1.3

Project description

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")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_ollama-0.1.2.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

langchain_ollama-0.1.2-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file langchain_ollama-0.1.2.tar.gz.

File metadata

  • Download URL: langchain_ollama-0.1.2.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for langchain_ollama-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d8f374a52cd572b5eb21b2447589b6357ec7d37991369043b4155b026bf2cb42
MD5 9eb1abc582b3155e2e5623ff305f735b
BLAKE2b-256 19e055f2c4aa0a6dfcfd5d91ebbfe818a66fedd9f51c0d89428239eba692197d

See more details on using hashes here.

File details

Details for the file langchain_ollama-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_ollama-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1a70cc893515f29b12ad48f3913ee863517c3ac475cba82375d116bc85afb1
MD5 eac297ad1f10255c13c63d08c1fc023a
BLAKE2b-256 675bba7fb1d023c288457e88fcad06f6bd6318064885665b362876709ddbb916

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page