Litigate leverages state-of-the-art large language models such as GPT-3.5, GPT-3.5 Turbo, GPT-4.0, and LLaMA 2 to provide expert legal advice on household and tenant law. This tool answers questions, offers advice, and references relevant case laws to help users navigate legal complexities effectively.
- Comprehensive answers and advice on household and tenant law.
- Integration with multiple advanced AI models for a broad perspective.
- Case law references to support legal advice.
Before setting up Litigate, ensure you have:
- An OpenAI API key or a LLAMA model downloaded on the device.
- Python 3.11 or newer installed.
- Conda as your environment manager.
- Clone the Repository
to your local machine using the following command:
git clone https://github.com/farandead/Litigate.git cd Litigate
- Create a virtual enovironment
on your local machine using the following command:
conda create --name litigat8 python=3.11
- Activate virtual enovironment
using the following command:
conda activate litigat8
- Install Dependencies
Install the required Python packages with:
pip install -r requirements.txt
- GPT Models Configuration
Set your OpenAI API key in 'app/nlp/nlp_engine.py':
import os os.environ["OPENAI_API_KEY"] = "your_openai_api_key_here"
- LLaMA 2 Configuration
Download the LLaMA model from the provided link 'https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/blob/main/llama-2-7b-chat.ggmlv3.q4_0.bin' or if your working with a different model then change the name of the model in nlp_engine.py
accordingly and place it in the same directory as nlp_engine.py. Replace the existing Q/A chain setup:llm=CTransformers(model="llama-2-7b-chat.ggmlv3.q4_0.bin", model_type="llama", config={'max_new_tokens':4096, 'temperature':0.8, 'context_length' : 2048}) qa_chain = make_chain(llm,retriver,chain_type_kwargs)
To set up the vector database necessary for the project, follow these steps:
-
Navigate to the Vector Database Setup Directory Change to the directory where the setup script is located:
cd app/nlp
-
Run the Setup Script Execute the setup script to configure the vector database:
python setup_vector_database.py
- If you need to add extra context or additional data files for the model to use, place them in the
data
folder located within theapp/nlp
directory.
To use Litigate, run the following command in your project directory:
flask run
We encourage community contributions. Please read our contributing guidelines for more information on how to contribute.
Litigate is available under the MIT License. See the LICENSE file for more details.
Faran Zafar - faranzafarcs@gmail.com
- OpenAI for the AI models.
- Contributors who have helped to improve this tool.