Skip to main content

A CLI tool to converse with any document locally using Ollama.

Project description

Banner

Python PyPI - Version PyPI 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:

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

  1. Typer and Rich: CLI library and terminal formatting.
  2. Ollama: On-device language model inference.
  3. Langchain: Pipeline for language model inference.
  4. FAISS: Similarity Search and Vector Store library from Meta AI.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lesa-0.1.0.7.tar.gz (554.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lesa-0.1.0.7-py3-none-any.whl (557.2 kB view details)

Uploaded Python 3

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

Hashes for lesa-0.1.0.7.tar.gz
Algorithm Hash digest
SHA256 9b6d2a5c06f593603e5c67cfb45e907866980a4dd575a045c7c994d9cb03fe34
MD5 acc9d4bf4d70ffb23e8be3791b73fe1a
BLAKE2b-256 275fa67eb2f43d0f39cbe647567630dc09dfc29721b9166851e7005c0337a3b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lesa-0.1.0.7.tar.gz:

Publisher: release.yml on shxntanu/lesa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for lesa-0.1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3856193113f3426681c82455d29ee00f32b91003dba3c6b1ebdd7e18d57de8a9
MD5 95bc08ab3c33d886f40f9e4bd1c9bf05
BLAKE2b-256 f26768f1b4ef8883847c99ea70fe7cfedd3ff5019835918f6fc2b58c48dc6515

See more details on using hashes here.

Provenance

The following attestation bundles were made for lesa-0.1.0.7-py3-none-any.whl:

Publisher: release.yml on shxntanu/lesa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page