🤖 Self-hosted, community-driven, local OpenAI-compatible API with Keycloak Auth Flak app as frontend. 🏠
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
FlaskAI/examples/langchain
Dave 07c3aa1869
Dockerized Langchain / PY example (#175)
2 years ago
..
langchainjs-localai-example Dockerized Langchain / PY example (#175) 2 years ago
langchainpy-localai-example Dockerized Langchain / PY example (#175) 2 years ago
models Dockerized Langchain / PY example (#175) 2 years ago
.gitignore Add LangchainJS Examples (#146) 2 years ago
JS.Dockerfile Add LangchainJS Examples (#146) 2 years ago
PY.Dockerfile Dockerized Langchain / PY example (#175) 2 years ago
README.md Dockerized Langchain / PY example (#175) 2 years ago
docker-compose.yaml Dockerized Langchain / PY example (#175) 2 years ago

README.md

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 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.