22 breaking releases
0.23.0 | Oct 24, 2024 |
---|---|
0.21.1 | Sep 4, 2024 |
0.19.0 | Jul 3, 2024 |
0.14.0 | Mar 7, 2024 |
0.8.0 | Mar 21, 2023 |
#52 in Command line utilities
713 downloads per month
1.5MB
15K
SLoC
AIChat: All-in-one AI CLI Tool
AIChat is an all-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, and More.
Install
Package Managers
- Rust Developers:
cargo install aichat
- Homebrew/Linuxbrew Users:
brew install aichat
- Pacman Users:
pacman -S aichat
- Windows Scoop Users:
scoop install aichat
- Android Termux Users:
pkg install aichat
Pre-built Binaries
Download pre-built binaries for macOS, Linux, and Windows from GitHub Releases, extract them, and add the aichat
binary to your $PATH
.
Features
Multi-Platform Support
Seamlessly integrate with over 20 leading LLM platforms via a unified interface, including OpenAI, Azure-OpenAI, Gemini (Google AI Studio), VertexAI, Claude, Ollama, Groq, VertexAI, Bedrock, Mistral, AI21, Grok, Cohere, Perplexity, Cloudflare, OpenRouter, Ernie, Qianwen, Moonshot, Deepseek, ZhipuAI, Yi, Jina, VoyageAI, and any OpenAI-Compatible platforms.
Shell Assistant
Supercharge your command line experience. Simply describe your desired actions in natural language, and let AIChat translate your requests into precise shell commands.
OS-Aware Intelligence: AIChat tailors commands to your specific operating system and shell environment.
Chat-REPL
Bring a powerful Chat-REPL with features such as tab autocompletion, multi-line support, history search, configurable keybindings, and custom REPL prompt.
Multi-Form Input
Accept various forms of input, such as stdin, local files & dirs, and remote URLs.
# Use stdin
cat data.txt | aichat
# Use local file
aichat -f data.txt
# Use image file
aichat -f image.png ocr
# Use multi files
aichat -f file1 -f file2 explain
# Use local dirs
aichat -f dir/ summarize
# Use remote URLs
aichat -f https://example.com/page summarize
Role
Define custom roles to tailor LLM behaviors, enhancing interactions and boosting productivity.
The role consists of a prompt and model configuration.
Session
Maintain context-aware conversations through sessions, ensuring continuity in interactions.
The left side uses a session, while the right side does not use a session.
RAG (Chat with your documents)
Integrate external documents into your LLM conversations for more accurate and contextually relevant responses.
Supports local files and directories, as well as remote URLs, including entry websites.
Function Calling
Function calling supercharges LLMs by connecting them to external tools and data sources. This unlocks a world of possibilities, enabling LLMs to go beyond their core capabilities and tackle a wider range of tasks.
We have created a new repository https://github.com/sigoden/llm-functions to help you make the most of this feature.
AI Tools
Integrate external tools to automate tasks, retrieve information, and perform actions directly within your workflow.
AI Agents (CLI version of OpenAI GPTs)
AI Agent = Instructions (Prompt) + Tools (Function Callings) + Documents (RAG).
Local Server
AIChat comes with a built-in lightweight http server.
$ aichat --serve
Chat Completions API: http://127.0.0.1:8000/v1/chat/completions
Embeddings API: http://127.0.0.1:8000/v1/embeddings
Rerank API: http://127.0.0.1:8000/v1/rerank
LLM Playground: http://127.0.0.1:8000/playground
LLM Arena: http://127.0.0.1:8000/arena?num=2
Proxy LLM APIs
AIChat offers the ability to function as a proxy server for all LLMs. This allows you to interact with different LLMs using the familiar OpenAI API format, simplifying the process of accessing and utilizing these LLMs.
Test with curl:
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
LLM Playground
The LLM Playground is a webapp that allows you to interact with any LLM supported by AIChat directly in your browser.
LLM Arena
The LLM Arena is a web-based platform where you can compare different LLMs side-by-side.
Custom Themes
AIChat supports custom dark and light themes, which highlight response text and code blocks.
Documentation
- Configuration Guide
- Command-Line Guide
- Chat-REPL Guide
- Role Guide
- RAG Guide
- Environment Variables
- Custom Theme
- Custom REPL Prompt
- FAQ
License
Copyright (c) 2023-2024 aichat-developers.
AIChat is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
See the LICENSE-APACHE and LICENSE-MIT files for license details.
Dependencies
~41–78MB
~1.5M SLoC