https://github.com/shxntanu/lesa
📚 Turn your terminal into a File Interpreter
https://github.com/shxntanu/lesa
document-chat ollama python
Last synced: 3 months ago
JSON representation
📚 Turn your terminal into a File Interpreter
- Host: GitHub
- URL: https://github.com/shxntanu/lesa
- Owner: shxntanu
- License: apache-2.0
- Created: 2024-12-03T08:46:37.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-01-05T15:35:35.000Z (4 months ago)
- Last Synced: 2025-01-08T02:06:39.678Z (4 months ago)
- Topics: document-chat, ollama, python
- Language: Python
- Homepage: https://pypi.org/project/lesa/
- Size: 1.72 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://www.python.org/downloads/)

**_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!
## Usage
To start a conversation with a document (`.pdf` and `.docx` for now), simply run:
```bash
lesa read path/to/your/document --page (optional)
```Or start a conversation with an already-embedded directory, run:
```bash
lesa chat
```### Embed
To embed all files from your current working directory, run:
```bash
lesa embed
```This creates a `.lesa` config folder in your current working directory that stores the embeddings of all the documents in the directory.
## Setup
`lesa` uses [Ollama](https://ollama.com/) under the hood to utilize the power of large language models.
To install and setup Ollama, run the setup script [`setup-ollama.sh`](scripts/setup-ollama.sh).```bash
curl -fsSL https://raw.githubusercontent.com/shxntanu/lesa/master/scripts/setup-ollama.sh | bash
```This script automatically installs the Ollama CLI and pulls the default model (llama3.1:latest) for you. Then install the package using pip.
## Installation
Simply install the package using pip:
```bash
pip install lesa
```To upgrade to the latest version, run:
```bash
pip install -U lesa
```## Contribute
We welcome contributions! If you'd like to improve `lesa` or have any feedback, feel free to open an issue or submit a pull request.
## Credits
1. [Typer](https://typer.tiangolo.com/) and [Rich](https://github.com/Textualize/rich): CLI library and terminal formatting.
2. [Ollama](https://ollama.com/): On-device language model inference.
3. [Langchain](https://langchain.com/): Pipeline for language model inference.
4. [FAISS](https://github.com/facebookresearch/faiss): Similarity Search and Vector Store library from Meta AI.## License
Apache-2.0