# langchain-ollama
This package contains the LangChain integration with Ollama
## Installation
```bash
pip install -U langchain-ollama
```
You will also need to run the Ollama server locally.
You can download it [here](https://ollama.com/download).
## Chat Models
`ChatOllama` class exposes chat models from Ollama.
```python
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.
```python
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.
```python
from langchain_ollama import OllamaLLM
llm = OllamaLLM(model="llama3")
llm.invoke("The meaning of life is")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/langchain-ai/langchain",
"name": "langchain-ollama",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/88/8e/21f1df6af0983cf1bc6d15c71f21bd17d968114bf6cce0fb40442f5ba81f/langchain_ollama-0.2.2.tar.gz",
"platform": null,
"description": "# langchain-ollama\n\nThis package contains the LangChain integration with Ollama\n\n## Installation\n\n```bash\npip install -U langchain-ollama\n```\n\nYou will also need to run the Ollama server locally. \nYou can download it [here](https://ollama.com/download).\n\n## Chat Models\n\n`ChatOllama` class exposes chat models from Ollama.\n\n```python\nfrom langchain_ollama import ChatOllama\n\nllm = ChatOllama(model=\"llama3-groq-tool-use\")\nllm.invoke(\"Sing a ballad of LangChain.\")\n```\n\n## Embeddings\n\n`OllamaEmbeddings` class exposes embeddings from Ollama.\n\n```python\nfrom langchain_ollama import OllamaEmbeddings\n\nembeddings = OllamaEmbeddings(model=\"llama3\")\nembeddings.embed_query(\"What is the meaning of life?\")\n```\n\n## LLMs\n`OllamaLLM` class exposes LLMs from Ollama.\n\n```python\nfrom langchain_ollama import OllamaLLM\n\nllm = OllamaLLM(model=\"llama3\")\nllm.invoke(\"The meaning of life is\")\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An integration package connecting Ollama and LangChain",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/langchain-ai/langchain",
"Release Notes": "https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain-ollama%3D%3D0%22&expanded=true",
"Repository": "https://github.com/langchain-ai/langchain",
"Source Code": "https://github.com/langchain-ai/langchain/tree/master/libs/partners/ollama"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7f77219fb2290c832e33af2731246ea3328bade50756288c1e97ae73c4ccc197",
"md5": "24809bfb9abff4894cda0302057a88a9",
"sha256": "8a1ee72dbb6ea3b3ace1d9dd317e472d667a8ed491328550da59f4893a6796f8"
},
"downloads": -1,
"filename": "langchain_ollama-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "24809bfb9abff4894cda0302057a88a9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 18362,
"upload_time": "2024-12-18T22:40:28",
"upload_time_iso_8601": "2024-12-18T22:40:28.018989Z",
"url": "https://files.pythonhosted.org/packages/7f/77/219fb2290c832e33af2731246ea3328bade50756288c1e97ae73c4ccc197/langchain_ollama-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "888e21f1df6af0983cf1bc6d15c71f21bd17d968114bf6cce0fb40442f5ba81f",
"md5": "4419be34e31746202f600c2cf78d6601",
"sha256": "2d9bcb06ffdbe43c7c6906c46e710d36d33b6b99cd4975cbf54060f13e51c875"
},
"downloads": -1,
"filename": "langchain_ollama-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "4419be34e31746202f600c2cf78d6601",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 16970,
"upload_time": "2024-12-18T22:40:30",
"upload_time_iso_8601": "2024-12-18T22:40:30.239447Z",
"url": "https://files.pythonhosted.org/packages/88/8e/21f1df6af0983cf1bc6d15c71f21bd17d968114bf6cce0fb40442f5ba81f/langchain_ollama-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-18 22:40:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "langchain-ai",
"github_project": "langchain",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "langchain-ollama"
}