Skip to main content

simple llm based tools to access from cli

Project description

LLM-cli

A lightweight Command Line Interface (CLI) for interacting with Large Language Models (LLMs) using LiteLLM.

💡 Why This Project?

Sometimes network constraints or data limitations make it difficult to access large language models via web interfaces. This CLI provides a lightweight, flexible solution for LLM interactions directly from the terminal.

🚀 Features

  • Simple CLI Interface: Easily chat with different LLMs from your terminal
  • Input: Pipe inputs or redirect file text.
  • Multiple Chat Modes:
    • Direct single-message chat
    • Interactive chat UI with markdown rendering
    • Image support for vision-capable models
  • Flexible Configuration: Customize model, temperature, and system prompts
  • Easy Configuration Management: Update settings with a simple command
  • Sessions : Logs chat sessions, can be resumed saved chat later.

🔧 Prerequisites

  • Api keys to the llms, set api keys as environment variables

💾 Installation

  1. Via Pip
pip install llm-to-cli

Or

  1. From Repo
# Clone the repository
git clone https://github.com/tikendraw/llm-cli.git
cd llm-cli

# Install 
pip install .

🖥️ Usage

Basic Chat

  • Send a single message to an LLM:

    llm-cli chat "Hello, how are you?"
    
  • Pipe input

    echo "what is 34th prime number" | llm-cli chat
    
  • File redirection

    llm-chat chat < some_file_with_question.txt
    

Interactive Chat UI

  • Start an interactive chat session:

    llm-cli chatui
    

Image Support

  • Add image
    llm-cli chat --image path/to/image/or/url
    

Configuration

  • View current configuration:

    llm-cli config
    
  • Update configuration:

    llm-cli config model "anthropic/claude-3-haiku"
    llm-cli config temperature 0.7
    

🛠️ Commands

  • chat: Send a single message
  • chatui: Interactive chat
  • config: Manage CLI configuration
  • history: See and manage history

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

🖹 License

The MIT one.

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

llm_to_cli-0.1.8.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

llm_to_cli-0.1.8-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_to_cli-0.1.8.tar.gz.

File metadata

  • Download URL: llm_to_cli-0.1.8.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.11 Linux/6.8.0-1021-azure

File hashes

Hashes for llm_to_cli-0.1.8.tar.gz
Algorithm Hash digest
SHA256 e4ac7e590b3856d04a441d261e0c9b9194ebf308aaa04ba6c84bdb543a030056
MD5 47bf4745e1c64f68b9f8d9af1dbe63b3
BLAKE2b-256 c300c3c0e8a36fad5aa98877728e64148692c54a5f348336be183c877cbff338

See more details on using hashes here.

File details

Details for the file llm_to_cli-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: llm_to_cli-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.11 Linux/6.8.0-1021-azure

File hashes

Hashes for llm_to_cli-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c46b48e82b36bcb9a2840b6c03cd94098a7bafa3e70cdac0f25a7c1c12dccfc1
MD5 0b77aeafaa5f05c64b8528d83c63498b
BLAKE2b-256 8e74c989fe1fd33d7a798271590e63e7809a2c27eb8a7f91ec2bbcf2c5acc2f1

See more details on using hashes here.

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