sigoden/aichat

AIChat is a Rust-based all-in-one LLM CLI with a shell assistant, chat REPL, RAG, function-calling agents, and a built-in HTTP server across 20+ providers.

  • 10.5k GitHub stars
  • Rust
cargo install aichat
sigoden/aichat preview image

What it is

AIChat is an all-in-one LLM command-line tool offering CMD and REPL modes, a Shell Assistant, RAG, AI Tools and Agents. It connects to over 20 LLM providers, including OpenAI, Claude, Gemini, Ollama and Groq, through a unified interface. It also ships a lightweight built-in HTTP server with an LLM Playground and LLM Arena.

Who it's for

  • Developers who want to talk to multiple LLM providers from a single terminal tool
  • Users who want natural-language descriptions turned into shell commands
  • Teams wanting a local OpenAI-style proxy server over several LLM backends
  • Users building agents that combine prompts, tools and RAG documents

Setup

  1. Install with Cargo

    Rust developers can install from crates.io.

    bash
    cargo install aichat
  2. Install with Homebrew/Linuxbrew

    Install via Homebrew or Linuxbrew.

    bash
    brew install aichat
  3. Install with Pacman

    Install on systems that use Pacman.

    bash
    pacman -S aichat
  4. Install with Scoop

    Install on Windows via Scoop.

    bash
    scoop install aichat
  5. Install with Termux

    Install on Android via Termux.

    bash
    pkg install aichat
  6. Pre-built binaries

    Download binaries for macOS, Linux, and Windows from GitHub Releases, extract them, and add the aichat binary to your $PATH.

Examples

Pipe stdin into AIChat

bash
bash
cat data.txt | aichat

What it does: Sends the contents of a file via STDIN as input.

Combine directory and file inputs

bash
bash
aichat -f dir/ -f data.txt explain

What it does: Passes a local directory and a file as input, together with the prompt word 'explain'.

Start the built-in server

bash
bash
aichat --serve

What it does: Launches the local HTTP server exposing Chat Completions, Embeddings and Rerank APIs, plus the LLM Playground and LLM Arena.

Call the proxy with curl

sh
sh
curl -X POST -H "Content-Type: application/json" -d '{
  "model":"claude:claude-3-5-sonnet-20240620",
  "messages":[{"role":"user","content":"hello"}], 
  "stream":true
}' http://127.0.0.1:8000/v1/chat/completions

What it does: Tests the chat completions endpoint of the local server using a Claude model.

Pros & cons

Pros

  • Pro:Unified interface to over 20 LLM providers plus any OpenAI-compatible API
  • Pro:Flexible input: stdin, local files and directories, remote URLs, and external command output
  • Pro:Built-in HTTP server with Playground and Arena for comparing models
  • Pro:Many install options including Cargo, Homebrew, Pacman, Scoop, Termux and pre-built binaries

Cons

  • Con:Function calling relies on a separate repository (llm-functions) for the best experience
  • Con:The README defers detailed configuration to wiki pages and does not include provider setup steps

Images