Skip to content
forked from sigoden/aichat

AIChat is an all-in-one LLM platform featuring a powerful CLI tool with Shell Assistant, CMD & REPL modes, RAG, AI Tools & Agents, and a comprehensive web interface with Matrix theming, API marketplace, document processing, and cloud integrations.

License

Notifications You must be signed in to change notification settings

johnproblems/aichat

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AIChat: All-in-one LLM Platform

AIChat is an all-in-one LLM platform featuring a powerful CLI tool with Shell Assistant, CMD & REPL modes, RAG, AI Tools & Agents, and a comprehensive web interface with Matrix theming, API marketplace, document processing, and cloud integrations.

🌟 What's New

AIChat Web Platform Transformation - AIChat is evolving from a CLI-only tool into a full-featured web platform while maintaining all CLI capabilities. The transformation includes:

  • 🎨 Matrix-Themed Web Interface - Immersive cyberpunk UI with animated rain effects
  • πŸ” User Authentication & Sessions - JWT-based auth with persistent sessions
  • πŸͺ API Key Marketplace - Buy/sell API access with dynamic pricing & intelligent routing
  • πŸ’³ Integrated Billing System - Stripe payments, balance tracking, and automated payouts
  • πŸ–₯️ Web Terminal Emulator - Full CLI experience in browser via xterm.js
  • πŸ”„ Multi-Provider Chat - Side-by-side model comparison with real-time cost tracking
  • ☁️ Cloud Document Processing - Google Drive & OneDrive integration with RAG
  • πŸ” Web Search Integration - DuckDuckGo & Google Search API with citations
  • πŸ“Š Analytics Dashboard - Usage metrics, cost analysis, and PDF reports

Current Status: Foundation complete (13%) - Authentication system and Matrix theme operational. View Epic Progress β†’

πŸš€ Key Features

CLI Power User Features

  • 20+ LLM Providers - OpenAI, Claude, Gemini, Ollama, and more in one tool
  • Shell Assistant - Natural language to shell commands
  • Interactive REPL - Tab completion, history search, multi-line input
  • RAG Integration - Chat with your documents and codebase
  • AI Agents - Build custom GPT-like agents with tools and knowledge
  • Function Calling - Connect LLMs to external APIs and services
  • Session Management - Persistent conversations with context

Web Platform Exclusive Features

  • API Marketplace - Monetize your API keys or find cheaper alternatives

    • Dynamic pricing with real-time cost calculations
    • Intelligent routing with automatic failover
    • Capacity tracking and usage limits
    • Revenue sharing with automated payouts
  • Multi-Provider Arena - Compare LLMs side-by-side

    • Simultaneous queries to multiple providers
    • Real-time cost comparison per response
    • Response quality voting and analytics
    • Export conversation comparisons
  • Cloud Document Hub - Unified document processing

    • Google Drive and OneDrive integration
    • Automatic RAG processing for uploaded files
    • Citation-aware responses with source links
    • Collaborative document discussions
  • Analytics & Insights - Track everything

    • Usage metrics across all providers
    • Cost analysis and spending trends
    • Performance monitoring dashboards
    • PDF report generation and scheduling
  • Matrix-Themed Experience - Cyberpunk aesthetics

    • Animated code rain effects
    • Terminal-style interface design
    • Green phosphor text styling
    • Retro-futuristic UI elements

πŸ“¦ 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.

⚑ Quick Start

CLI Usage

# Set your API key (OpenAI example)
export OPENAI_API_KEY="sk-..."

# Ask a question
aichat "Explain Rust ownership"

# Start interactive REPL
aichat

# Use shell assistant
aichat --execute "find all rust files modified today"

# Chat with documents (RAG)
aichat --file docs/ "Summarize the architecture"

# Use a specific model
aichat --model claude:claude-3-5-sonnet "Write a poem"

Web Platform Usage

# Start the web server
aichat --serve

# Or on a specific port
aichat --serve 3000

# Access the platform
# 1. Open http://localhost:8000 in your browser
# 2. Create an account or log in
# 3. Explore the Matrix-themed interface
# 4. Try the marketplace, multi-provider chat, or terminal

First-Time Setup

# Configure your LLM providers
aichat --list-models        # View available models
aichat --model openai:gpt-4 # Set default model

# Create a custom role
aichat --role .edit         # Opens editor for new role

# Set up an AI agent
aichat --agent my-agent .edit   # Configure agent with tools & docs

🎯 Features

Multi-Providers

Integrate seamlessly with over 20 leading LLM providers through a unified interface. Supported providers include OpenAI, Claude, Gemini (Google AI Studio), Ollama, Groq, Azure-OpenAI, VertexAI, Bedrock, Github Models, Mistral, Deepseek, AI21, XAI Grok, Cohere, Perplexity, Cloudflare, OpenRouter, Ernie, Qianwen, Moonshot, ZhipuAI, MiniMax, Deepinfra, VoyageAI, any OpenAI-Compatible API provider.

CMD Mode

Explore powerful command-line functionalities with AIChat's CMD mode.

aichat-cmd

REPL Mode

Experience an interactive Chat-REPL with features like tab autocompletion, multi-line input support, history search, configurable keybindings, and custom REPL prompts.

aichat-repl

Shell Assistant

Elevate your command-line efficiency. Describe your tasks in natural language, and let AIChat transform them into precise shell commands. AIChat intelligently adjusts to your OS and shell environment.

aichat-execute

Multi-Form Input

Accept diverse input forms such as stdin, local files and directories, and remote URLs, allowing flexibility in data handling.

Input CMD REPL
CMD aichat hello
STDIN cat data.txt | aichat
Last Reply .file %%
Local files aichat -f image.png -f data.txt .file image.png data.txt
Local directories aichat -f dir/ .file dir/
Remote URLs aichat -f https://example.com .file https://example.com
External commands aichat -f '`git diff`' .file `git diff`
Combine Inputs aichat -f dir/ -f data.txt explain .file dir/ data.txt -- explain

Role

Customize roles to tailor LLM behavior, enhancing interaction efficiency and boosting productivity.

aichat-role

The role consists of a prompt and model configuration.

Session

Maintain context-aware conversations through sessions, ensuring continuity in interactions.

aichat-session

The left side uses a session, while the right side does not use a session.

Macro

Streamline repetitive tasks by combining a series of REPL commands into a custom macro.

aichat-macro

RAG

Integrate external documents into your LLM conversations for more accurate and contextually relevant responses.

aichat-rag

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 & MCP

Integrate external tools to automate tasks, retrieve information, and perform actions directly within your workflow.

aichat-tool

AI Agents (CLI version of OpenAI GPTs)

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

aichat-agent

Local Server & Web Platform

AIChat includes a powerful built-in HTTP server that serves both APIs and the web interface.

$ 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
Web Platform:         http://127.0.0.1:8000/           (Matrix GUI)

Web Platform Features:

  • Matrix Console Interface - Cyberpunk-themed UI with green code rain animation
  • Authentication Portal - Secure login/signup with JWT tokens
  • API Marketplace - Browse, purchase, and sell API key access
  • Web Terminal - Full-featured terminal emulator with xterm.js
  • Multi-Provider Chat - Compare responses from multiple LLMs side-by-side
  • Document Manager - Upload from cloud storage (Google Drive, OneDrive)
  • Analytics Dashboard - Track usage, costs, and performance metrics
  • Billing Portal - Manage payments, balance, and transactions

Proxy LLM APIs

The LLM Arena is a web-based platform where you can compare different LLMs side-by-side.

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

A web application to interact with supported LLMs directly from your browser.

aichat-llm-playground

LLM Arena

A web platform to compare different LLMs side-by-side.

aichat-llm-arena

Custom Themes

AIChat supports custom dark and light themes, which highlight response text and code blocks.

aichat-themes

Documentation

CLI Documentation

Web Platform Documentation

Architecture

AIChat is built in Rust with a modular architecture:

Core Components

  • CLI Interface (src/cli.rs) - Clap-based command parsing
  • Client System (src/client/) - Multi-provider LLM integration (20+ providers)
  • Server (src/serve.rs) - Hyper-based HTTP/WebSocket server
  • Configuration (src/config/) - Roles, sessions, agents management
  • RAG System (src/rag/) - Document processing and vector search
  • REPL (src/repl/) - Interactive chat with syntax highlighting
  • Function Calling (src/function.rs) - External tool integration

Web Platform Stack

  • Backend: Rust (Hyper, Tokio, Serde)
  • Database: PostgreSQL/Supabase
  • Frontend: Matrix-themed HTML/CSS/JS with WebSockets
  • Terminal: xterm.js with WebSocket backend
  • Payments: Stripe API integration
  • Cloud Storage: Google Drive & OneDrive APIs
  • Search: DuckDuckGo & Google Custom Search

Development Roadmap

Phase 1: Foundation βœ… (Complete)

  • Matrix-themed web interface with animated code rain
  • PostgreSQL database schema and migrations
  • JWT authentication and user management system

Phase 2: Marketplace & Payments 🚧 (In Progress)

  • API key marketplace with listing management
  • Dynamic pricing engine and capacity tracking
  • Intelligent request routing with failover
  • Stripe payment integration and billing system
  • Balance management and automated payouts

Phase 3: Enhanced UX πŸ“‹ (Planned)

  • xterm.js terminal emulator with WebSocket backend
  • Side-by-side multi-provider chat comparison
  • Real-time cost tracking and analysis
  • Google Drive & OneDrive cloud integration
  • Document processing pipeline with RAG

Phase 4: Intelligence & Insights πŸ“‹ (Planned)

  • DuckDuckGo & Google Search integration
  • Web search with citation extraction
  • Comprehensive analytics dashboard
  • Usage metrics and PDF report generation
  • System-wide performance monitoring

Current Development Status

Track progress in Epic Issue #1 and individual task issues:

  • βœ… Task 1: Matrix Console Theme Foundation (Complete)
  • βœ… Task 2: Database Schema & User Management (Complete)
  • 🚧 Task 3: API Key Marketplace Core (#2-6)
  • 🚧 Task 4: Terminal Emulator (#7-11)
  • 🚧 Task 5: Multi-Provider Chat (#12-16)
  • 🚧 Task 6: Document Processing (#17-21)
  • 🚧 Task 7: Web Search Integration (#22-26)
  • 🚧 Task 8: Billing & Payment System (#27-31)
  • 🚧 Task 9: Analytics & Reporting (#32-36)

Total Progress: 13% complete (2 of 9 core tasks) β€’ 35 subtasks planned β€’ ~15 weeks estimated

Contributing

We welcome contributions! See our Epic roadmap for areas where help is needed. Each feature has detailed subtasks with implementation guides.

Development Setup

# Clone repository
git clone https://github.com/johnproblems/aichat.git
cd aichat

# Build project
cargo build

# Run tests
cargo test

# Start local server
cargo run -- --serve

# Access web platform
open http://localhost:8000

Project Structure

aichat/
β”œβ”€β”€ src/                    # Rust source code
β”‚   β”œβ”€β”€ cli.rs             # CLI interface
β”‚   β”œβ”€β”€ serve.rs           # HTTP/WebSocket server
β”‚   β”œβ”€β”€ client/            # Multi-provider LLM clients
β”‚   β”œβ”€β”€ config/            # Configuration management
β”‚   β”œβ”€β”€ rag/               # Document processing
β”‚   └── repl/              # Interactive REPL
β”œβ”€β”€ assets/                # Web UI assets
β”‚   β”œβ”€β”€ index.html         # Matrix-themed interface
β”‚   β”œβ”€β”€ styles.css         # Cyberpunk styling
β”‚   └── app.js             # Frontend logic
β”œβ”€β”€ migrations/            # Database migrations
β”œβ”€β”€ .claude/               # Claude Code project management
β”‚   β”œβ”€β”€ epics/            # Epic and task tracking
β”‚   └── prds/             # Product requirements
└── Cargo.toml            # Rust dependencies

License

Copyright (c) 2023-2025 aichat-developers. Copyright (c) 2025 FormalHosting - Web Platform Transformation

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.

About

AIChat is an all-in-one LLM platform featuring a powerful CLI tool with Shell Assistant, CMD & REPL modes, RAG, AI Tools & Agents, and a comprehensive web interface with Matrix theming, API marketplace, document processing, and cloud integrations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 66.3%
  • HTML 19.0%
  • Shell 9.3%
  • JavaScript 1.8%
  • CSS 1.5%
  • PLpgSQL 0.9%
  • Other 1.2%