lesa
[lee - saa] • Old Norse
(v.) to read, to study, to learn
lesa is a CLI tool built in Python that allows you to converse with your documents from the terminal, completely offline and on-device using Ollama. Open the terminal in the directory of your choice and start a conversation with any document!
To start a conversation with a document (.pdf and .docx for now), simply run:
lesa read path/to/your/document --page <page_number> (optional)Or start a conversation with an already-embedded directory, run:
lesa chatTo embed all files from your current working directory, run:
lesa embedThis creates a .lesa config folder in your current working directory that stores the embeddings of all the documents in the directory.
lesa uses Ollama under the hood to utilize the power of large language models.
To install and setup Ollama, run the setup script setup-ollama.sh.
curl -fsSL https://raw.githubusercontent.com/shxntanu/lesa/master/scripts/setup-ollama.sh | bashThis script automatically installs the Ollama CLI and pulls the default model (llama3.1:latest) for you. Then install the package using pip.
Simply install the package using pip:
pip install lesaTo upgrade to the latest version, run:
pip install -U lesaWe welcome contributions! If you'd like to improve lesa or have any feedback, feel free to open an issue or submit a pull request.
- Typer and Rich: CLI library and terminal formatting.
- Ollama: On-device language model inference.
- Langchain: Pipeline for language model inference.
- FAISS: Similarity Search and Vector Store library from Meta AI.
Apache-2.0
