aichat Tools README

Background

  • aichat tool is the most advanced cli interface for AI
  • Has support for most models, RAG, session management, serves webapp
  • Poor man alternative for openwebui
  • Source code should be real source of knowledge
  • Advertised as supporting agents, but it does not work.

Synopsis

    aichat --model name
           --file file_or_url 
           --role %code%            # %shell% or custom role.
           --info                   # Print config
           --macro my_macro
           --rag aichat-wiki        # Start or use RAG
           --list-models            # List models, roles, sessions, rags, macros

# query in command line args

aichat 4 * 6   # gives output as 24

# Read stdin or file as input
cat data.json | aichat convert json to yaml

aichat -f https://example.com explain
aichat -f "input-guide.pdf" explain

For use with in REPL :
.file  dir1/ data.txt -- explain

# Generate code
aichat -c  echo server in node.js

# Use roles (built-in roles and define your own)

aichat --role %code%  Hello World

# REPL Mode
aichat

> .model  openai:gpt-4o
> .role %code%
%code%> print "hello world" in js

# Shell assistant

aichat -e list ts files
find . -type '*.ts' 
> execute | revise | cancel

# Use Predefined functions as role

aichat -r %functions% what is weather today in India ?
aichat -r %code%  Hello world

# Sessions

> .session
temp) list 1 to 5, odd only

# Macro -- Alias for sequence of REPL commands
> .macro get-weather-in-India-USA
>> .role %fuctions% what is the weather in Paris and Sanfrancisco?

# Define Your own Custom RAG

>.rag aichat-wiki
> Select embedding model: openai:...
> Set chunk size: 3000
> Set chunk overlay: 150
> Add documents: https://github.com/sigodeon/aichat/wiki/**
...
Saved Rag to ~/.config/aichat/args/aichat-wiki.yaml

# Allow predefined functions to search web or execute local command or such ..

aichat -r %functions% what is latest version of node.js 

Agent Support (Incomplete and not supported)

  
AI Agent = Instructions (Prompt) + Tools (Function Callings) + Documents (RAG).
> .agent todo 
....

Local 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