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.

See IMPLEMENTED_FEATURES.md for the current feature guide based on the code that is actually implemented in this repository.

💡 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
    
  • Include the last terminal command/output blocks from the current tmux pane

    llm-cli chat --pane-history 1 "Why did this command fail?"
    
  • Target a different tmux pane explicitly

    llm-cli chat --pane-history 3 --pane-target %12 "Summarize what just happened"
    

Interactive Chat UI

  • Start an interactive chat session:

    llm-cli chatui
    
  • Start with recent tmux pane history as context:

    llm-cli chatui --pane-history 2
    
  • During chat, add pane history on demand:

    /pane 3
    /pane 2 %12
    

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.

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.2.0.tar.gz (21.2 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.2.0-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_to_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.11.15 Linux/6.17.0-1010-azure

File hashes

Hashes for llm_to_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7d7f4cc953360e7318b75aeb3beb75b28edf2805781b350e153dbb2340172fc3
MD5 db9535e2edd7a47edac9c48d93263d38
BLAKE2b-256 987d461b4d10d82a8776e28ab95ece167f35043c89bd4c61f360d3f755d08e5a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llm_to_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.11.15 Linux/6.17.0-1010-azure

File hashes

Hashes for llm_to_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42a0cb47e8d0324140747a87d8a3b0da403f066e0074e23b66b3a80fbba63d84
MD5 a4512b28dc1921d140170bc7498524dd
BLAKE2b-256 68eac7f2984b0944dd74e02018c4bcbdcf32b6b58cd3c7f2ccc8787582b6f28a

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