Skip to main content

Interact with any LLM from your terminal

Project description

Lhammai CLI logo

License Tests

✨ Interact with any LLM from your terminal


Lhammai CLI allows you to interact with any LLM directly from your terminal using a simple, intuitive interface. Powered by the any-llm library, it seamlessly connects to various LLM providers, including OpenAI, Anthropic, and local servers such as Ollama, llamafile, and others. For a full list of supported providers, see the official any-llm documentation.

The name Lhammai comes from "Lhammas," Noldorin for "account of tongues", a work of fictional sociolinguistics, written by J. R. R. Tolkien in 1937.

Getting Started

Prerequisites

Installation

  1. Clone the repository and navigate to the source directory:

    git clone https://github.com/dpoulopoulos/lhammai-cli.git && cd lhammai-cli
    
  2. Install the dependencies using uv:

    uv sync --group ollama
    
  3. Activate the virtual environment:

    source .venv/bin/activate
    

This installs the necessary dependencies to communicate with a local model via Ollama.

Usage

To begin, you'll need to run the Ollama server. For this example, you can use Docker for a quick setup.

This approach has some limitations, especially on a Mac. Since Docker Desktop doesn't support GPUs, it's better to run Ollama as a standalone application if you're using a Mac. For more detailed instructions, check the official Ollama documentation.

  1. Run the following command to start the Ollama server in a Docker container:

    a. CPU only:

    docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
    

    b. Nvidia GPU:

    docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
    
  2. Run a model:

    docker exec -it ollama ollama run gemma3:4b
    
  3. Interact with the model:

    lhammai Hello!
    

Configure your application by creating a .env file in the root directory and adding your options: cp .default.env .env

You can also pipe content to lhammai from standard input. This is useful for analyzing logs, summarizing files, etc.:

cat dev.log | lhammai -p "explain:"

License

See the LICENSE file for details.

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

lhammai_cli-0.1.0a7.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

lhammai_cli-0.1.0a7-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file lhammai_cli-0.1.0a7.tar.gz.

File metadata

  • Download URL: lhammai_cli-0.1.0a7.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lhammai_cli-0.1.0a7.tar.gz
Algorithm Hash digest
SHA256 2c9522323830c52f6b168849e44b26fc2347cf6d43344f39ac6e1f7c9025a0c0
MD5 17b579ed238983880c2b0fe29e7cfeb4
BLAKE2b-256 56d467447abff4e420a115d2338d4531a80f26907a0ca7f4ad01d3170ad85b35

See more details on using hashes here.

Provenance

The following attestation bundles were made for lhammai_cli-0.1.0a7.tar.gz:

Publisher: release.yml on dpoulopoulos/lhammai-cli

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

File details

Details for the file lhammai_cli-0.1.0a7-py3-none-any.whl.

File metadata

  • Download URL: lhammai_cli-0.1.0a7-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lhammai_cli-0.1.0a7-py3-none-any.whl
Algorithm Hash digest
SHA256 04b3f59c9a964a72cbb513047754df37f032cf342ad6daf70c4a920e3c49e9e7
MD5 88f76faec7e32cb782ccec34c5c0ec2f
BLAKE2b-256 61a1139739c2c4640c55783cbfa5cda288dab7dc6456c6af025f332116b588a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lhammai_cli-0.1.0a7-py3-none-any.whl:

Publisher: release.yml on dpoulopoulos/lhammai-cli

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