2024-06-01 02:45:53 +00:00
# AIChat: All-in-one AI CLI Tool
2023-03-03 00:28:46 +00:00
2023-03-03 00:33:57 +00:00
[![CI ](https://github.com/sigoden/aichat/actions/workflows/ci.yaml/badge.svg )](https://github.com/sigoden/aichat/actions/workflows/ci.yaml)
[![Crates ](https://img.shields.io/crates/v/aichat.svg )](https://crates.io/crates/aichat)
2024-05-04 23:24:47 +00:00
[![Discord ](https://img.shields.io/discord/1226737085453701222?label=Discord )](https://discord.gg/mr3ZZUB9hG)
2023-03-03 00:33:57 +00:00
2024-07-04 06:57:13 +00:00
AIChat is an all-in-one AI CLI tool featuring Chat-REPL, Shell Assistant, RAG, Function Calling, AI Agents, and More.
2024-04-08 12:43:08 +00:00
2023-03-03 00:28:46 +00:00
## Install
2024-04-20 13:07:30 +00:00
### Package Managers
2023-03-03 00:28:46 +00:00
2024-04-20 13:07:30 +00:00
- **Rust Developers:** `cargo install aichat`
- **Homebrew/Linuxbrew Users:** `brew install aichat`
- **Pacman Users**: `yay -S aichat`
- **Windows Scoop Users:** `scoop install aichat`
- **Android Termux Users:** `pkg install aichat`
2023-11-27 10:02:38 +00:00
2024-04-20 13:07:30 +00:00
### Pre-built Binaries
2023-11-27 10:02:38 +00:00
2024-04-20 13:07:30 +00:00
Download pre-built binaries for macOS, Linux, and Windows from [GitHub Releases ](https://github.com/sigoden/aichat/releases ), extract them, and add the `aichat` binary to your `$PATH` .
2023-03-03 00:28:46 +00:00
2024-06-24 09:16:56 +00:00
## Get Started
2023-03-03 00:28:46 +00:00
2024-06-24 09:16:56 +00:00
Upon its first launch after installation, AIChat will guide you through the initialization of the configuration file.
2023-03-03 02:34:02 +00:00
2024-06-24 09:16:56 +00:00
![aichat-init-config ](https://github.com/sigoden/aichat/assets/4012553/d83c4ac0-1693-4d3c-8a56-a6eabff4ca82 )
2023-03-03 00:28:46 +00:00
2024-06-24 09:16:56 +00:00
You can tailor AIChat to your preferences by editing the configuration file.
2024-03-06 01:32:00 +00:00
2024-06-24 09:16:56 +00:00
The [config.example.yaml ](https://github.com/sigoden/aichat/blob/main/config.example.yaml ) file provides a comprehensive list of all configuration options with detailed explanations.
2024-03-06 01:32:00 +00:00
2024-06-24 09:16:56 +00:00
## Features
2024-03-06 01:32:00 +00:00
2024-06-24 09:16:56 +00:00
### 20+ Platforms
2024-03-06 01:32:00 +00:00
2024-06-24 09:16:56 +00:00
AIChat offers users a wide and diverse selection of Large Language Models (LLMs):
2024-03-06 01:32:00 +00:00
2024-07-03 23:13:29 +00:00
- **OpenAI:** GPT-4/GPT-3.5 (paid, chat, embedding, vision, function-calling)
- **Gemini:** Gemini-1.5/Gemini-1.0 (free, paid, chat, embedding, vision, function-calling)
- **Claude:** Claude-3.5/Claude-3 (paid, chat, vision, function-calling)
- **Ollama:** (free, local, chat, embedding)
- **Groq:** Llama-3/Mixtral/Gemma (free, chat, function-calling)
- **Azure-OpenAI:** GPT-4/GPT-3.5 (paid, chat, embedding, vision, function-calling)
- **VertexAI:** Gemini-1.5/Gemini-1.0 (paid, chat, embedding, vision, function-calling)
- **VertexAI-Claude:** Claude-3.5/Claude-3 (paid, chat, vision, function-calling)
- **Bedrock:** Llama-3/Claude-3.5/Claude-3/Mistral (paid)
- **Mistral:** (paid, chat, embedding)
- **Cohere:** Command-R/Command-R+ (paid, chat, embedding, reranker, function-calling)
2024-06-24 09:16:56 +00:00
- **Perplexity:** Llama-3/Mixtral (paid)
2024-07-03 23:13:29 +00:00
- **Cloudflare:** (free, chat, embedding)
- **OpenRouter:** (paid)
2024-06-24 09:16:56 +00:00
- **Replicate:** (paid)
2024-07-03 23:13:29 +00:00
- **Ernie:** (paid, chat, embedding, reranker, function-calling)
- **Qianwen:** Qwen (paid, chat, embedding, vision, function-calling)
- **Moonshot:** (paid, chat, function-calling)
- **Deepseek:** (paid, chat)
- **ZhipuAI:** GLM-4 (paid, chat, embedding, vision, function-calling)
- **LingYiWanWu:** Yi-* (paid, chat, vision)
- **Jina:** (free, paid, embedding, reranker)
- **VoyageAI:** (paid, embedding, reranker)
2024-06-24 09:16:56 +00:00
- **OpenAI-Compatible Platforms**
2024-04-11 00:14:08 +00:00
2024-06-24 09:16:56 +00:00
### Shell Assistant
2024-03-06 01:32:00 +00:00
Simply input what you want to do in natural language, and aichat will prompt and run the command that achieves your intent.
2023-07-10 03:17:42 +00:00
2024-06-24 09:16:56 +00:00
![aichat-execute ](https://github.com/sigoden/aichat/assets/4012553/f99bcd8f-26be-468f-a35e-197e65260f91 )
2023-03-10 02:27:24 +00:00
2024-06-24 09:16:56 +00:00
**AIChat is aware of OS and shell you are using, it will provide shell command for specific system you have.**
2023-07-10 03:17:42 +00:00
2024-06-24 09:16:56 +00:00
### Role
2023-03-08 13:35:21 +00:00
2024-06-24 09:16:56 +00:00
Customizable roles allow users to tailor the behavior of LLMs, enhancing productivity and ensuring the tool aligns with specific needs and workflows.
2023-07-10 03:17:42 +00:00
2024-06-24 09:16:56 +00:00
![aichat-role ](https://github.com/sigoden/aichat/assets/4012553/76004a01-3b29-4116-bbab-40b4978388f5 )
2023-03-10 02:27:24 +00:00
2024-06-24 09:16:56 +00:00
### Session
2023-03-08 13:35:21 +00:00
2024-06-24 09:16:56 +00:00
By default, AIChat behaves in a one-off request/response manner.
With sessions, AIChat conducts context-aware conversations.
2023-11-07 15:07:42 +00:00
2024-06-24 09:16:56 +00:00
![aichat-session ](https://github.com/sigoden/aichat/assets/4012553/1444c5c9-ea67-4ad2-80df-a76954e8cce0 )
2023-11-07 15:07:42 +00:00
2024-07-03 08:51:30 +00:00
### RAG
2023-03-06 02:33:13 +00:00
2024-06-24 09:16:56 +00:00
Seamlessly integrates document interactions into your chat experience.
2023-10-28 14:22:37 +00:00
2024-06-24 09:16:56 +00:00
![aichat-rag ](https://github.com/sigoden/aichat/assets/4012553/6f3e5908-9c95-4d7d-aa9c-7e973ecf9354 )
2023-03-06 02:33:13 +00:00
2024-06-24 09:16:56 +00:00
### Function Calling
2023-03-06 02:33:13 +00:00
2024-06-24 09:16:56 +00:00
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.
2024-04-20 13:07:30 +00:00
2024-06-24 09:16:56 +00:00
We have created a new repository [https://github.com/sigoden/llm-functions ](https://github.com/sigoden/llm-functions ) to help you make the most of this feature.
2024-04-20 13:07:30 +00:00
2024-07-04 06:57:13 +00:00
#### Tools
2023-11-27 06:04:50 +00:00
2024-06-24 09:16:56 +00:00
Here's a glimpse of How to use the tools.
2023-11-27 06:04:50 +00:00
2024-07-03 08:51:30 +00:00
![aichat-tool ](https://github.com/sigoden/aichat/assets/4012553/f9d7f827-9a2a-4ea1-8b8c-19e1c93178d4 )
2023-11-27 06:04:50 +00:00
2024-07-04 06:57:13 +00:00
#### Agents
2023-11-27 10:02:38 +00:00
2024-06-24 09:16:56 +00:00
Agent = Prompt (Role) + Tools (Function Callings) + Knowndge (RAG). It's also known as OpenAI's GPTs.
2024-06-05 01:02:23 +00:00
2024-06-24 09:16:56 +00:00
Here's a glimpse of how to use the agents.
2023-10-30 06:17:15 +00:00
2024-06-24 09:16:56 +00:00
![aichat-agent ](https://github.com/sigoden/aichat/assets/4012553/7308a423-2ee5-4847-be1b-a53538bc98dc )
2023-10-30 09:09:53 +00:00
2024-06-24 09:16:56 +00:00
### Local Server
2024-05-13 22:36:10 +00:00
2024-06-24 09:16:56 +00:00
AIChat comes with a built-in lightweight http server.
2024-05-13 22:36:10 +00:00
```
$ aichat --serve
Chat Completions API: http://127.0.0.1:8000/v1/chat/completions
2024-06-24 09:16:56 +00:00
Embeddings API: http://127.0.0.1:8000/v1/embeddings
2024-05-13 22:36:10 +00:00
LLM Playground: http://127.0.0.1:8000/playground
2024-06-24 09:16:56 +00:00
LLM Arena: http://127.0.0.1:8000/arena?num=2
2024-05-13 22:36:10 +00:00
```
2024-06-24 09:16:56 +00:00
#### Proxy LLM APIs
2024-05-13 22:36:10 +00:00
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:
```sh
curl -X POST -H "Content-Type: application/json" -d '{
"model":"claude:claude-3-opus-20240229",
"messages":[{"role":"user","content":"hello"}],
"stream":true
}' http://127.0.0.1:8000/v1/chat/completions
```
2024-06-24 09:16:56 +00:00
#### LLM Playground
2024-05-13 22:36:10 +00:00
The LLM Playground is a webapp that allows you to interact with any LLM supported by AIChat directly in your browser.
2024-06-24 09:16:56 +00:00
![aichat-llm-playground ](https://github.com/sigoden/aichat/assets/4012553/d2334c03-9a07-41a4-a326-e4ee37477ce3 )
2024-05-13 22:36:10 +00:00
2024-06-24 09:16:56 +00:00
#### LLM Arena
2023-10-30 09:09:53 +00:00
2024-05-13 22:36:10 +00:00
The LLM Arena is a web-based platform where you can compare different LLMs side-by-side.
2023-10-30 09:09:53 +00:00
2024-06-24 09:16:56 +00:00
![aichat-llm-arena ](https://github.com/sigoden/aichat/assets/4012553/eb1eab0c-4685-4142-89c6-089714b4822c )
2024-05-13 22:36:10 +00:00
2024-06-24 09:16:56 +00:00
## Custom Themes
2024-02-23 05:15:18 +00:00
2024-06-24 09:16:56 +00:00
AIChat supports custom dark and light themes, which highlight response text and code blocks.
2024-02-23 05:15:18 +00:00
2024-06-24 09:16:56 +00:00
![aichat-themes ](https://github.com/sigoden/aichat/assets/4012553/29fa8b79-031e-405d-9caa-70d24fa0acf8 )
2024-02-23 05:15:18 +00:00
2024-07-04 06:57:13 +00:00
## Documents
2024-05-13 22:36:10 +00:00
2024-06-24 09:16:56 +00:00
- [Command-Line Guide ](https://github.com/sigoden/aichat/wiki/Command-Line-Guide )
- [Chat-REPL Guide ](https://github.com/sigoden/aichat/wiki/Chat-REPL-Guide )
2024-05-13 22:36:10 +00:00
- [Role Guide ](https://github.com/sigoden/aichat/wiki/Role-Guide )
2024-07-03 23:13:29 +00:00
- [RAG Guide ](https://github.com/sigoden/aichat/wiki/RAG-Guide )
2024-05-13 22:36:10 +00:00
- [Environment Variables ](https://github.com/sigoden/aichat/wiki/Environment-Variables )
- [Custom Theme ](https://github.com/sigoden/aichat/wiki/Custom-Theme )
2024-06-24 09:16:56 +00:00
- [Custom REPL Prompt ](https://github.com/sigoden/aichat/wiki/Custom-REPL-Prompt )
2024-02-26 03:28:25 +00:00
2023-03-03 00:28:46 +00:00
## License
2024-02-24 11:13:48 +00:00
Copyright (c) 2023-2024 aichat-developers.
2023-03-03 00:28:46 +00:00
2024-05-13 22:36:10 +00:00
AIChat is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
2023-03-03 00:28:46 +00:00
2024-06-24 09:16:56 +00:00
See the LICENSE-APACHE and LICENSE-MIT files for license details.