Explore the docs »
*Report Bug
*Request Feature
*Discussion
Table of Contents
lairad is a local artificial intelligence research and development tool. Same input, same output is a goal. Enabling local independent research to better understand the possibilities of local run/deployed large language models. LLM Models that work well are the 13B vicuna series. More research and data collection is needed here. When ever possible docker containers are used.
- MariaDB for User / Project / Prompt storage
- whoogle-search to have better search control
- gogs to store files and have a commit history
Works will with the gpt4-x-vicuna-13B.ggml.q5_1.bin and WizardLM-30B-Uncensored.ggmlv3.q4_0.bin
Bug and issues are expected.
To get a local copy up and running follow these simple example steps.
Working python installation and pip.
-
pyhton pip install
- Clone the repo
git clone https://github.com/th-neu/lairad.git
- Install python3 virtual environment (if not installed)
sudo apt-get install python3-venv
- setup the virtual environment
cd lairad && python3 -m venv lairad
- activate the new virtual environment
source ~/venv/lairad/bin/activate
- Install pip packages
pip install -r requirements.txt
- Copy env.example to .env
cp env.example .env
- edit the .env file
<your favorite editor here> .env
- run app.py
python3 app.py
- Clone the repo
git clone https://github.com/th-neu/lairad.git
- setup the virtual environment
cd lairad && python -m venv lairad
- activate the new virtual environment
lairad\Scripts\activate.bat
- Install pip packages
pip install -r requirements.txt
- Copy env.example to .env
copy env.example .env
- edit the .env file
<your favorite editor here> .env
- run app.py
python app.py
Use the installation steps with a virtual environment. Remove # app.py line 224,225 and add # at line 223. Using --rm to remove the container for testing.
- Build the image
docker build -t your-name/image-name .
- Run the container
docker run --rm -p 5000:5000 your-name/image-name
For armv7 use the Dockerfile.armv7. Remove # app.py line 224,225 and add # at line 223. Using --rm to remove the container for testing.
- Pull the docker image
docker pull ghcr.io/th-neu/docker-py-mariadbc-armhf:latest
- Build the image
docker build -t your-name/image-name -f Dockerfile.armv7 .
- Run the container
docker run --rm -p 5000:5000 your-name/image-name
Settings for the database (sqlite3 or mariadb at the moment).
Settings for API Endpoint for llama-cpp-python.
## Secret App key
secret_key=<Secret_Key>
## Database connection
# sqlite3 configuration
DB_TYPE=sqlite
DATABASE=example.db
# mariadb configuration
# DB_TYPE=mariadb
# DB_USER=root
# DB_PASSWORD=
# DB_HOST=
# DB_PORT=3306
# DB_NAME=lairad
## Endpoint for llama-cpp-python Python API
# LLAMA_CCP_API_URL=http://localhost:8000/v1/completions
LLAMA_CCP_API_URL=http://localhost:8000/v1/completions
## LLAMA_CCP_API_Schema
LLAMA_TEMPERATURE=0.8
LLAMA_STOP=[}}}, ###]
LLAMA_MAX_TOKEN=300
LLAMA_ECHO=true
The Secret Key is not to be shared."It should be a long random string of bytes, although unicode is accepted too." One can use python (windows example):
python -c "import os; print(os.urandom(16))"
or a Password manager to generate a long random string.
This is my choice of container. You can build your own images or install the software directly onto a host system. Docker is recommenced.
whoogle-search docker installation
MariaDB knowledge base
gogs docker installation
Navigate your web browser to localhost:5000 (replace with IP for docker / none localhost installation) and use admin/admin to login.
- Deploy tests (flask web front end, db back end, python basic logic)
- Rewrite Code with proper python structure.
- Working task management (call LLM with goals and act on it [search, write file]).
- Localization Support
- English
- German
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/th-neu/lairad