Skip to main content

Command-line tool for interacting with LLMs

Project description

azc - LLM Chat from the command-line

A command-line tool for interacting with LLMs.

Why should you use this?

  • If you're a command-line junkie, you don't need to switch to another tool to chat with your LLM
  • One tool, multiple LLMs (OpenAI, Anthropic, Ollama, Gemini...) - Why settle for one when you can have them all?
  • Pay-as-you-go pricing for LLM providers (Cheaper in many cases)

Features

  • Multi-provider support
    • Ollama
    • OpenAI
    • Anthropic
    • Gemini
    • Grok
  • Streaming responses (see response as it is being generated)
  • Persistent command-line history (use up and down arrows to navigate)
  • Chat history & reset (full discussion, start new chat)
  • Switch provider and model (compare models and providers)
  • Markdown output (nicely formatted headings, lists, tables, etc.)
  • Command-line parameters (first prompt)

Possible future features

  • Support more LLM providers (Perplexity, Groq...)
  • Support RTL languages
  • Save output to file
  • Patterns library (a-la fabric)
  • Upload files
  • Aggregate responses from multiple providers
  • Support more modes (image generation, transcription, etc.)
  • Track total cost of API calls
  • Add to homebrew

Installation

pip install azc

if you want to make it available system-wide (any folder, without having to activate your python environment), you can install it system-wide:

echo 'alias azc="$HOME/projects/azc/env/bin/azc"' >> ~/.bashrc
  • Replace ~/.bashrc with the shell you are using (zsh, bash, etc.)
  • Replace $HOME/projects/azc/env/bin/azc with the path to the azc executable
  • On Windows, you can add the path to your PATH environment variable (ask your nearest LLM for more details)

Running

% azc
azc> how tall is the eiffel tower?
                                  ollama:llama3.1:latest (1st message)
  The Eiffel Tower stands at an impressive height of:

  • 324 meters (1,063 feet) tall, including its antenna.
  • 302.9 meters (994.7 feet) tall, excluding its antenna.

  It was the world's tallest man-made structure when it was first built for the 1889 World's Fair in
  Paris.

azc> q
👋 Bye
%

You can specify the first prompt as a command-line argument:

% azc -b "What is the capital of Panama?"
The capital of Panama is Panama City.
%

Command-line parameters

Parameter Description
(default) First prompt
-d / --double-enter Press enter twice to submit - This is useful for those who want to use multi-line prompts without pressing ctrl-j to add new line.
-b / --batch Exit after the first response
-v / --verbose Print verbose output
-p / --provider The provider to use (e.g. openai or ollama). Abbreviations allowed, like op for openai
-m /--model The model to use. Abbreviations allowed, like tu for gpt-3.5-turbo

Commands

Command Description
q or exit Exit the program
h or ? Show help
l List models
n Start new chat
p Change provider. p - (p followed by a space) trigger auto-completion menu
m Change model
ctrl-n New line

Setup

You will need to configure at least one LLM API.

You should create a .env file which contains your API Key/s. The .env file should be located in home directory, either directly under $HOME or under $HOME/.config/, the latter taking precedence. See .env.sample for a sample .env file, with the expected environment variables' names. Remove those that are not relevant to you.

Here are the links to the API sign-up pages (or download in case of Ollama):

You can configure the default models you want to use in azc_config.json. This file is expected to be found under ~/.config/azc_config.json or ~/.azc_config.json if you don't have a ~/.config folder.

Limitations

  • Streaming updates are limited to screen height (after that it displays ellipsis and will update the display only when the response is complete)
  • No support for RTL languages

Contributing

Contributions are welcome! Please feel free to submit a PR.

To run in development:

% python -m az.az

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

azc-1.2.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

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

azc-1.2.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file azc-1.2.0.tar.gz.

File metadata

  • Download URL: azc-1.2.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for azc-1.2.0.tar.gz
Algorithm Hash digest
SHA256 71016f55a02f592634449a4e23f08f4839f7b94e352d5cb96384e8aafffd4eea
MD5 9846be39e506294db8b8808d3f9804dd
BLAKE2b-256 cff96b1f481c09b00f04a9a8698287de8ef2c2b5392507e9ace0f8fbd2aa0fba

See more details on using hashes here.

File details

Details for the file azc-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: azc-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for azc-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df7806a77b5700f5ae0ab5243403b27038ce777527de8e886a89bb2079b5bfaf
MD5 fd94c07ca09bc67cc8a0e9b7e9a6be1d
BLAKE2b-256 872533fbf8efe2bbaabe75768e437eb1bc7889e1062c6f897e1665cf24de7a27

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