一个快捷、以键盘为中心的终端用户界面,用于与大型语言模型进行交互。与 ChatGPT、Claude、LLaMA 3、Phi 3、Mistral、Gemma 等进行聊天
A snappy, keyboard-centric terminal user interface for interacting with large language models.
Chat with Claude 3, ChatGPT, and local models like Llama 3, Phi 3, Mistral and Gemma.
## Introduction
`elia` is an application for interacting with LLMs which runs entirely in your terminal, and is designed to be keyboard-focused, efficient, and fun to use!
It stores your conversations in a local SQLite database, and allows you to interact with a variety of models.
Speak with proprietary models such as ChatGPT and Claude, or with local models running through `ollama` or LocalAI.
## Installation
Install Elia with [pipx](https://github.com/pypa/pipx):
```bash
pipx install --python 3.11 elia-chat
```
Depending on the model you wish to use, you may need to set one or more environment variables (e.g. `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY` etc).
## Quickstart
Launch Elia from the command line:
```bash
elia
```
Launch a new chat inline (under your prompt) with `-i`/`--inline`:
```bash
elia -i "What is the Zen of Python?"
```
Launch a new chat in full-screen mode:
```bash
elia "Tell me a cool fact about lizards!"
```
Specify a model via the command line using `-m`/`--model`:
```bash
elia -m gpt-4o
```
Options can be combined - here's how you launch a chat with Gemini 1.5 Flash in inline mode (requires `GEMINI_API_KEY` environment variable).
```bash
elia -i -m gemini/gemini-1.5-flash-latest "How do I call Rust code from Python?"
```
## Running local models
1. Install [`ollama`](https://github.com/ollama/ollama).
2. Pull the model you require, e.g. `ollama pull llama3`.
3. Run the local ollama server: `ollama serve`.
4. Add the model to the config file (see below).
## Configuration
The location of the configuration file is noted at the bottom of
the options window (`ctrl+o`).
The example file below shows the available options, as well as examples of how to add new models.
```
…
```
## Custom themes
Add a custom theme YAML file to the themes directory.
You can find the themes directory location by pressing `ctrl+o` on the home screen and looking for the `Themes directory` line.
Here's an example of a theme YAML file:
```yaml
name: example # use this name in your config file
primary: '#4e78c4'
secondary: '#f39c12'
accent: '#e74c3c'
background: '#0e1726'
surface: '#17202a'
error: '#e74c3c' # error messages
success: '#2ecc71' # success messages
warning: '#f1c40f' # warning messages
```
## Changing keybindings
Right now, keybinds cannot be changed. Terminals are also rather limited in what keybinds they support.
For example, pressing Cmd+Enter to send a message is not possible (although we may support a protocol to allow this in some terminals in the future).
For now, I recommend you map whatever key combo you want at the terminal emulator level to send `\n`.
Here's an example using iTerm:
With this mapping in place, pressing Cmd+Enter will send a message to the LLM, and pressing Enter alone will create a new line.
## Import from ChatGPT
Export your conversations to a JSON file using the ChatGPT UI, then import them using the `import` command.
```bash
elia import 'path/to/conversations.json'
```
## Wiping the database
```bash
elia reset
```
## Uninstalling
```bash
pipx uninstall elia-chat
```