A CLI tool to converse with any document locally using Ollama.
Project description
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:
lesa read path/to/your/document --page <page_number> (optional)
Or start a conversation with an already-embedded directory, run:
lesa chat
Embed
To embed all files from your current working directory, run:
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 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 | 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:
pip install lesa
To upgrade to the latest version, run:
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
- 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.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lesa-0.1.0.7.tar.gz.
File metadata
- Download URL: lesa-0.1.0.7.tar.gz
- Upload date:
- Size: 554.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b6d2a5c06f593603e5c67cfb45e907866980a4dd575a045c7c994d9cb03fe34
|
|
| MD5 |
acc9d4bf4d70ffb23e8be3791b73fe1a
|
|
| BLAKE2b-256 |
275fa67eb2f43d0f39cbe647567630dc09dfc29721b9166851e7005c0337a3b4
|
Provenance
The following attestation bundles were made for lesa-0.1.0.7.tar.gz:
Publisher:
release.yml on shxntanu/lesa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lesa-0.1.0.7.tar.gz -
Subject digest:
9b6d2a5c06f593603e5c67cfb45e907866980a4dd575a045c7c994d9cb03fe34 - Sigstore transparency entry: 159220891
- Sigstore integration time:
-
Permalink:
shxntanu/lesa@8c7124163166b6fe5d81a7526952aadfa6fe75d6 -
Branch / Tag:
refs/tags/0.1.0.7 - Owner: https://github.com/shxntanu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8c7124163166b6fe5d81a7526952aadfa6fe75d6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lesa-0.1.0.7-py3-none-any.whl.
File metadata
- Download URL: lesa-0.1.0.7-py3-none-any.whl
- Upload date:
- Size: 557.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3856193113f3426681c82455d29ee00f32b91003dba3c6b1ebdd7e18d57de8a9
|
|
| MD5 |
95bc08ab3c33d886f40f9e4bd1c9bf05
|
|
| BLAKE2b-256 |
f26768f1b4ef8883847c99ea70fe7cfedd3ff5019835918f6fc2b58c48dc6515
|
Provenance
The following attestation bundles were made for lesa-0.1.0.7-py3-none-any.whl:
Publisher:
release.yml on shxntanu/lesa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lesa-0.1.0.7-py3-none-any.whl -
Subject digest:
3856193113f3426681c82455d29ee00f32b91003dba3c6b1ebdd7e18d57de8a9 - Sigstore transparency entry: 159220892
- Sigstore integration time:
-
Permalink:
shxntanu/lesa@8c7124163166b6fe5d81a7526952aadfa6fe75d6 -
Branch / Tag:
refs/tags/0.1.0.7 - Owner: https://github.com/shxntanu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8c7124163166b6fe5d81a7526952aadfa6fe75d6 -
Trigger Event:
push
-
Statement type: