Skip to main content

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 (without having to activate your python environment or cd to the project folder), 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)

You can also build an executable and place it in a central location using pyinstaller. I am using build_exe.sh to do this on my mac. It installs the az command

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

Metadata

Release files for azc 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azc 1.4.0
File Size Uploaded
azc-1.4.0.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for azc 1.4.0
File Interpreter ABI Platform
azc-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.2 kB

Release files / azc-1.4.0.tar.gz

Download URL azc-1.4.0.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5d6110acacabdf2b850239653deed62ca036ce255c1bcec7f82182f3335eb5e1
BLAKE2b-256 checksum
How to use checksums
56fa8ddf4e44e6d0768653f46243fc35f8b1f2a64976338045b7b54209e6c05f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / azc-1.4.0-py3-none-any.whl

Download URL azc-1.4.0-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3edc3dfca6a3d5dac59b29519539e836b6783d37d1a2a36f2efb864752b76eb
BLAKE2b-256 checksum
How to use checksums
3ba74b242ee4f8eea1914d42c3e93a4ec16a6d9c65389981edde9333b1038b53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page