### [aichat](https://github.com/sigoden/aichat)

> Handle: `aichat`
> URL: http://localhost:34051 (only in `--serve` mode)

[![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)
[![Discord](https://img.shields.io/discord/1226737085453701222?label=Discord)](https://discord.gg/mr3ZZUB9hG)

AIChat is an all-in-one AI CLI tool featuring Chat-REPL, Shell Assistant, RAG, AI Tools & Agents, and More.

#### Starting

```bash
# [Optional] pre-build the image
harbor build aichat
```

`aichat` is a CLI service, so it's not expected to be running permanently with `harbor up`. Instead, you'll be running one-off commands with it.

```bash
# Run aichat commands
harbor aichat --help

# Launch the REPL
harbor aichat
```

#### Configuration

By default `aichat` will connect to `ollama` as an LLM backend. `aichat` uses OpenAI-compatible endpoints for configuration, please be aware about [context truncation](./Compatibility.md#ollama---truncated-input).

```bash
# Get/set the model for aichat
harbor aichat model codestral
```

When using different backends, you will want to adjust the `aichat model` accordingly.

```bash
# Start with vllm
harbor up vllm

# Set the model for aichat
# to the same as vllm
harbor aichat model $(harbor vllm model)

# Use aichat
harbor aichat
```

> [!WARN]
> Harbor pre-confiugures `aichat` to run with compatible LLM backends, however it wasn't tested with all of them. Please, report any issues you encounter.

Harbor uses custom-built image of `aichat` until official images are available, so to update to the latest version you'll need to rebuild:

```bash
# Note "--no-cache" flag to ensure the latest version
harbor build --no-cache aichat
```

`aichat` relies on some local files for configuration. Access with this shortcut:

```bash
# See where the current aichat workspace is located
harbor config get aichat.config.path
# Use custom config folder
harbor config set aichat.config.path /opt/aichat/config

# Open current workspace in the File Manager
harbor aichat workspace
```

- [Official aichat wiki](https://github.com/sigoden/aichat/wiki)
