sigoden/aichat
Rust CLI unifying multi-provider LLM chat, retrieval and tool workflows
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
AIChat is a Rust 2021 application with three entry points: one-shot CMD invocations, an interactive REPL and a built-in HTTP server. The manifest includes clap for CLI parsing, reedline for terminal editing, tokio for async execution and serde_json/serde_yaml for structured data. config.example.yaml, config.agent.example.yaml and models.yaml are concrete starting points for reviewing configuration and model setup.
The CLI assembles a prompt from user input and optional resources, then sends it to a configured model backend through a common provider interface. Roles bind prompts to model settings, sessions retain conversational context, and macros compose REPL commands. Agents combine instructions, function calls and retrieval documents; function calling and MCP connect the application to external tools. The built-in HTTP server is another way to use configured models, not an inference engine.
Key Capabilities & Differentiators
AIChat connects to more than 20 providers, including OpenAI, Claude, Gemini, Groq, Ollama, and OpenAI-compatible APIs. The terminal accepts stdin, files, directories, URLs and external command output as context. The REPL adds completion, multiline editing and history search. The Shell Assistant generates commands for the current OS and shell; RAG adds document context to conversations.
Running aichat --serve starts the local HTTP surface at 127.0.0.1:8000 by default. It exposes /v1/chat/completions, /v1/embeddings and /v1/rerank. The proxy example uses "stream": true for chat completions. The browser playground provides interactive access to configured models, and the arena supports side-by-side comparison. Test the operations you need against the chosen backend rather than assuming that every provider supports all three endpoints.
Trade-offs & Limitations
Compared with a provider-specific CLI, AIChat reduces the work of switching models and reusing terminal workflows across providers. Compared with direct SDK integration, its local HTTP surface gives clients a common endpoint, but model IDs, streaming behavior and support for embeddings or reranking still need testing for each backend. If an application depends on one provider's native options or error semantics, its SDK may be the simpler path.
Self-hosting the CLI or proxy does not make inference local: selecting a hosted backend can send prompts and supplied context outside the host. Treat fetched URLs and tool output as untrusted, review generated shell commands before running them, and scope external tool credentials to the task. The application is dual-licensed under MIT or Apache-2.0; that choice does not cover provider terms, model licenses or rights to indexed documents.
Hardware & Deployment Guide
Install with Cargo, Homebrew, Pacman, Scoop or Termux, or put a prebuilt macOS, Linux or Windows binary on PATH. The binary does not bundle a model: configure access to a hosted provider or provision a backend such as Ollama separately. For local inference, size RAM and VRAM for the model and inference workload; for hosted APIs, plan around network latency, provider limits and cost. To run offline, keep the model, required retrieval components and tools local and avoid workflows that fetch remote resources.
Start with the default loopback listener for local clients. Before sharing it, verify access controls, provider credential handling and behavior under concurrent load. Upgrades also warrant configuration checks: v0.29.0 replaced prelude with cmd_prelude, and v0.30.0 dropped the Lingyiwanwu client while adding OSC52 clipboard support and automatic light/dark theme detection.
aichat --serve exposes three /v1 endpoints plus a browser playground and side-by-side model arena.Terminal-first teams that want to switch model providers, feed shell output and files into chats, and reuse retrieval or tool workflows through a CLI and local HTTP endpoint.
You need a production inference engine, a turnkey multi-tenant gateway, or direct access to provider-native features through a single SDK.
Quick Start & Installation
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
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| aichat ★ | 10.6k | +25 | Rust | Apache-2.0 | Rust CLI unifying multi-provider LLM chat, retrieval and tool workflows |
| OpenHands | 94.7k | +415 | TypeScript | MIT | Self-hosted control plane for coding agents across local, remote, and cloud back |
| n8n | 212.7k | +824 | TypeScript | — | Visual Node.js platform for self-hosted workflows and multi-step AI agents |
| opensre | 17.2k | +1.9k | Python | Apache-2.0 | Self-hosted CLI agent for diagnosing CI failures and proposing reviewable fixes |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/sigoden/aichat.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about aichat
How should an existing application integrate AIChat?
aichat directly for shell pipelines or run aichat --serve for HTTP clients. The server exposes chat completions, embeddings and reranking; test the specific operations, model IDs and streaming behavior your client needs before treating it as a drop-in replacement for another API.Does AIChat need a GPU, and what should I size for?
Can we use it commercially and self-host it for sensitive data?
Cargo.toml declares MIT OR Apache-2.0, and the root contains both license files. Choose one of those licenses and follow its terms, including applicable notice and redistribution obligations. Review provider terms, model licenses, external tool dependencies and document-handling requirements separately. A self-hosted API does not guarantee that inputs stay on premises.When is AIChat a better fit than a provider CLI or SDK?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy