Skip to main content

A CLI tool for prompting an LLM

Project description

cli_lm

Switch context less by using a really cheap LLM at the command line.

Installation

# Install from source
git clone https://github.com/davenpi/clm.git
cd clm
pip install -e .

# Install from PyPI
# pip install cli_lm

Quick Start

The first run will prompt for your Open AI API key. Just paste the key in. Note you'll have to pay Open AI to get yourself an API key and start using their models. For now this package sets gpt-4o-mini as the model of choice. It costs 0.15¢/0.60¢ per 1 million input/output tokens. 1 token ~ 1 word!

# Directly ask a question
clm "How do I amend a commit in git?"

# Interactive mode (input in python interpreter)
clm
> How do I list the processes listening on a given port?

There is multiturn chat. Just hit Ctrl+c or Ctrl+d to exit.

Configuration

The package looks for your Open AI API key in ~/.clm/.env.

To quickly update your API key run:

echo "OPENAI_API_KEY=your_new_key" > ~/.clm/.env

It works on a Mac, but I haven't tried it on any other system.

Ongoing Improvements

  • Multi turn chat capability.
  • Can't arrow backward on input! Fix.
  • Improved multiline input
  • System prompting for really concise, helpful answers
  • Make set up easier
  • Add token/cost accounting
  • Make it faster (imports can be slow)
  • Add color

License

MIT

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

cli_lm-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

cli_lm-0.1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file cli_lm-0.1.1.tar.gz.

File metadata

  • Download URL: cli_lm-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for cli_lm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c46edc5c4813f390f9a4fd86fc1523244892370727008e27158c7db76916ccc2
MD5 5b5049d4e70ee1a4e790affe1979bf10
BLAKE2b-256 53b9d3db83b5ad8c2dc6b07fb2ce5ef86d9d6ec0c51d01c92f34fa0d66fc123f

See more details on using hashes here.

File details

Details for the file cli_lm-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cli_lm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for cli_lm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84ec4fc1fe5e99bcb88e90f3380e043038bb37b3fa2b48600c5fd8f279594c34
MD5 ccc3381ad6a2a45e95b5461b7a906795
BLAKE2b-256 c9db39846cd11790d380dfae8fd36a3e30569b7b4e082860964d3dadc0b6388d

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