Skip to content

Commit

Permalink
docs, external: introduce langchain-localai (#28751)
Browse files Browse the repository at this point in the history
Thank you for contributing to LangChain!

Referring to https://github.com/mkhludnev/langchain-localai

---------

Co-authored-by: Erick Friis <[email protected]>
  • Loading branch information
mkhludnev and efriis authored Dec 16, 2024
1 parent d4b5e7e commit 00deacc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
37 changes: 25 additions & 12 deletions docs/docs/integrations/text_embedding/localai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,40 @@
"source": [
"# LocalAI\n",
"\n",
":::info\n",
"\n",
"`langchain-localai` is a 3rd party integration package for LocalAI. It provides a simple way to use LocalAI services in Langchain.\n",
"\n",
"The source code is available on [Github](https://github.com/mkhludnev/langchain-localai)\n",
"\n",
":::\n",
"\n",
"Let's load the LocalAI Embedding class. In order to use the LocalAI Embedding class, you need to have the LocalAI service hosted somewhere and configure the embedding models. See the documentation at https://localai.io/basics/getting_started/index.html and https://localai.io/features/embeddings/index.html."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "0be1af71",
"execution_count": null,
"id": "799d1f77",
"metadata": {},
"outputs": [],
"source": [
"from langchain_community.embeddings import LocalAIEmbeddings"
"%pip install -U langchain-localai"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "0be1af71",
"metadata": {},
"outputs": [],
"source": [
"from langchain_localai import LocalAIEmbeddings"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "2c66e5da",
"metadata": {},
"outputs": [],
Expand All @@ -35,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "01370375",
"metadata": {},
"outputs": [],
Expand All @@ -45,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "bfb6142c",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -140,7 +158,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -154,12 +172,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
},
"vscode": {
"interpreter": {
"hash": "e971737741ff4ec9aff7dc6155a1060a59a8a6d52c757dbbe66bf8ee389494b1"
}
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
3 changes: 3 additions & 0 deletions libs/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ packages:
- name: langchain-ibm
repo: langchain-ai/langchain-ibm
path: libs/ibm
- name: langchain-localai
repo: mkhludnev/langchain-localai
path: libs/localai
- name: langchain-milvus
repo: langchain-ai/langchain-milvus
path: libs/milvus
Expand Down

0 comments on commit 00deacc

Please sign in to comment.