LocalAI/examples/langchain
dependabot[bot] fbef2aa984
chore(deps): Bump the pip group across 1 directory with 2 updates (#2848)
Bumps the pip group with 2 updates in the /examples/langchain/langchainpy-localai-example directory: [langchain-community](https://github.com/langchain-ai/langchain) and [urllib3](https://github.com/urllib3/urllib3).


Updates `langchain-community` from 0.2.4 to 0.2.5
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-community==0.2.4...langchain-community==0.2.5)

Updates `urllib3` from 2.2.1 to 2.2.2
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.1...2.2.2)

---
updated-dependencies:
- dependency-name: langchain-community
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: urllib3
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-13 14:44:26 +00:00
..
langchainjs-localai-example fix: update langchainjs (#2136) 2024-04-26 00:47:35 +02:00
langchainpy-localai-example chore(deps): Bump the pip group across 1 directory with 2 updates (#2848) 2024-07-13 14:44:26 +00:00
.gitignore Add LangchainJS Examples (#146) 2023-05-01 23:18:14 +02:00
docker-compose.yaml images: cleanup, drop .dev Dockerfile (#437) 2023-05-30 15:58:10 +02:00
JS.Dockerfile chore(deps): Update Dependencies (#2538) 2024-07-12 19:54:08 +00:00
models Cleaning up examples/ models and starter .env files (#1124) 2023-10-02 18:14:10 +02:00
PY.Dockerfile chore(deps): Update Dependencies (#2538) 2024-07-12 19:54:08 +00:00
README.md Langchain Example Updates (#199) 2023-05-06 00:21:06 +02:00

langchain

Example of using langchain, with the standard OpenAI llm module, and LocalAI. Has docker compose profiles for both the Typescript and Python versions.

Please Note - This is a tech demo example at this time. ggml-gpt4all-j has pretty terrible results for most langchain applications with the settings used in this example.

Setup

# Clone LocalAI
git clone https://github.com/go-skynet/LocalAI

cd LocalAI/examples/langchain

# (optional) - Edit the example code in typescript.
# vi ./langchainjs-localai-example/index.ts

# Download gpt4all-j to models/
wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j

# start with docker-compose for typescript!
docker-compose --profile ts up --build

# or start with docker-compose for python!
docker-compose --profile py up --build

Some of the example code in index.mts and full_demo.py is adapted from the langchainjs project and is Copyright (c) Harrison Chase. Used under the terms of the MIT license, as is the remainder of this code.