2026-02-06 16:13:50 +08:00
<p align="center">
2026-02-06 16:39:52 +08:00
<img src="assets/img/logo.png" alt="aha logo" width="120"/>
2026-02-06 16:13:50 +08:00
</p>
<p align="center">
<a href="https://github.com/jhqxxx/aha/stargazers">
<img src="https://img.shields.io/github/stars/jhqxxx/aha" alt="GitHub Stars">
</a>
<a href="https://github.com/jhqxxx/aha/issues">
<img src="https://img.shields.io/github/issues/jhqxxx/aha" alt="GitHub Issues">
</a>
2026-02-06 16:42:23 +08:00
<a href="https://github.com/jhqxxx/aha/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/jhqxxx/aha" alt="GitHub License">
</a>
2026-02-06 16:13:50 +08:00
</p>
<p align="center">
2026-02-06 16:39:52 +08:00
<a href="README.zh-CN.md">简体中文</a> | <strong>English</strong>
2026-02-06 16:13:50 +08:00
</p>
# aha
2026-02-06 16:39:52 +08:00
**Lightweight AI Inference Engine — All-in-one Solution for Text, Vision, Speech, and OCR **
2026-02-06 16:13:50 +08:00
2026-02-06 16:39:52 +08:00
aha is a high-performance, cross-platform AI inference engine built with Rust and the Candle framework. It brings state-of-the-art AI models to your local machine—no API keys, no cloud dependencies, just pure, fast AI running directly on your hardware.
2025-10-10 23:25:25 +08:00
2026-03-31 12:30:12 +08:00
2026-03-31 18:59:57 +08:00
### Supported Models
2026-03-17 15:39:34 +08:00
2026-03-31 18:59:57 +08:00
| Category | Models |
|----------|--------|
2026-04-02 22:22:52 +08:00
| **Text ** | Qwen3, MiniCPM4, LFM2, LFM2.5 |
2026-03-31 18:59:57 +08:00
| **Vision ** | Qwen2.5-VL, Qwen3-VL, Qwen3.5, <br> LFM2.5-VL, LFM2-VL |
2026-04-02 22:22:52 +08:00
| **OCR ** | DeepSeek-OCR, DeepSeek-OCR-2 , PaddleOCR-VL <br> PaddleOCR-VL1.5, Hunyuan-OCR, GLM-OCR |
2026-03-31 18:59:57 +08:00
| **ASR ** | GLM-ASR-Nano, Fun-ASR-Nano, Qwen3-ASR |
2026-04-08 18:55:03 +08:00
| **TTS ** | VoxCPM, VoxCPM1.5, VoxCPM2 |
2026-03-31 18:59:57 +08:00
| **Image ** | RMBG-2.0 (background removal) |
2026-04-06 19:32:25 +08:00
| **Embedding ** | Qwen3-Embedding, all-MiniLM-L6-v2 |
| **Reranker ** | Qwen3-Reranker |
2026-03-16 14:50:59 +08:00
2026-03-31 18:59:57 +08:00
## Why aha?
- **🚀 High-Performance Inference** - Powered by Candle framework for efficient tensor computation and model inference
- **🔧 Unified Interface** — One tool for text, vision, speech, and OCR
- **📦 Local-First** — All processing runs locally, no data leaves your machine
- **🎯 Cross-Platform** — Works on Linux, macOS, and Windows
- **⚡ GPU Accelerated** — Optional CUDA support for faster inference
- **🛡️ Memory Safe** — Built with Rust for reliability
- **🧠 Attention Optimization** - Optional Flash Attention support for optimized long sequence processing
2026-02-06 16:13:50 +08:00
2026-03-31 21:22:07 +08:00
## Changelog
2026-04-17 13:21:51 +08:00
### 2026-04-17
- Qwen3ASR add vad data recognition
### 2026-04-16
- fix FireRedVAD fsmn cache bug
2026-04-15 17:42:41 +08:00
### 2026-04-15
- add FireRedVAD
2026-04-10 23:06:09 +08:00
### 2026-04-10
- fix LiquidAI/LFM2.5-VL-450M chat_template load bug
2026-04-08 18:55:03 +08:00
### 2026-04-08
- add VoxCPM2
2026-04-06 19:32:25 +08:00
### 0.2.5 (2026-04-06)
- add qwen3-embedding/qwen3-reranker/all-minilm-l6-v2
2026-04-03 14:15:10 +08:00
### 2026-04-03
2026-04-03 20:43:51 +08:00
- CLI update: subcommand must be specified
2026-04-03 14:15:10 +08:00
- ChatCompletionParameters add repeat_penalty and repeat_last_n
2026-04-03 20:43:51 +08:00
- generate add penalty repeat
2026-04-03 14:15:10 +08:00
2026-04-02 22:22:52 +08:00
### 2026-04-02
- refactor generate code
- \<think\>...\</think\> The content of the thought chain is returned using the reasoning_content field.
- chat response add time info
2026-03-31 21:22:07 +08:00
* * [View full changelog ](docs/changelog.md )** →
2026-02-06 16:39:52 +08:00
## Quick Start
2026-02-06 16:13:50 +08:00
2026-02-06 16:39:52 +08:00
### Installation
2026-02-05 01:18:53 +08:00
2025-12-09 15:52:26 +08:00
``` bash
2026-02-06 16:13:50 +08:00
git clone https://github.com/jhqxxx/aha.git
cd aha
cargo build --release
2025-12-09 15:52:26 +08:00
```
2026-02-06 16:13:50 +08:00
2026-02-06 16:39:52 +08:00
**Optional Features: **
2025-12-09 15:52:26 +08:00
``` bash
2026-02-06 16:39:52 +08:00
# CUDA (NVIDIA GPU acceleration)
2026-02-06 16:13:50 +08:00
cargo build --release --features cuda
2026-02-06 16:39:52 +08:00
# Metal (Apple GPU acceleration for macOS)
2026-02-06 16:13:50 +08:00
cargo build --release --features metal
2026-02-06 16:39:52 +08:00
# Flash Attention (faster inference)
2026-02-07 13:28:13 +08:00
cargo build --release --features cuda,flash-attn
2026-02-06 16:13:50 +08:00
2026-02-06 16:39:52 +08:00
# FFmpeg (multimedia processing)
2026-02-06 16:13:50 +08:00
cargo build --release --features ffmpeg
2026-02-05 01:18:53 +08:00
```
2025-12-09 15:52:26 +08:00
2026-02-06 16:39:52 +08:00
### CLI Quick Reference
2026-02-06 16:13:50 +08:00
2026-02-05 01:18:53 +08:00
``` bash
2026-02-06 16:13:50 +08:00
2026-02-06 16:39:52 +08:00
# List all supported models
2026-02-06 16:13:50 +08:00
aha list
2026-02-06 16:39:52 +08:00
# Download model only
2026-03-31 18:45:01 +08:00
aha download -m Qwen/Qwen3-ASR-0.6B
2026-02-06 16:13:50 +08:00
2026-02-06 16:39:52 +08:00
# Download model and start service
2026-04-03 20:43:51 +08:00
aha cli -m Qwen/Qwen3-ASR-0.6B
2026-02-05 01:18:53 +08:00
2026-02-06 16:39:52 +08:00
# Run inference directly (without starting service)
2026-03-31 18:45:01 +08:00
aha run -m Qwen/Qwen3-ASR-0.6B -i "audio.wav"
2026-02-05 01:18:53 +08:00
2026-03-26 13:40:24 +08:00
# Run local all-MiniLM-L6-v2 embedding (native safetensors)
aha run -m all-minilm-l6-v2 -i "Rust embedding test" --weight-path D:\m odel_download\a ll-MiniLM-L6-v2
2026-02-06 16:39:52 +08:00
# Start service only (model already downloaded)
2026-03-31 18:45:01 +08:00
aha serv -m Qwen/Qwen3-ASR-0.6B -p 10100
2026-02-05 01:18:53 +08:00
2026-02-06 16:13:50 +08:00
```
2025-10-27 13:13:47 +08:00
2026-02-06 16:39:52 +08:00
### Chat
2025-11-05 14:46:03 +08:00
``` bash
2026-03-31 18:45:01 +08:00
aha serv -m Qwen/Qwen3-0.6B -p 10100
2025-11-05 14:46:03 +08:00
```
2026-02-06 16:39:52 +08:00
Then use the unified (OpenAI-compatible) API:
2026-02-06 16:13:50 +08:00
2025-11-05 14:46:03 +08:00
``` bash
2026-03-31 18:59:57 +08:00
curl http://localhost:10100/v1/chat/completions \
2026-02-06 16:13:50 +08:00
-H "Content-Type: application/json" \
-d '{
2026-03-31 18:45:01 +08:00
"model": "Qwen/Qwen3-0.6B",
2026-02-07 13:28:13 +08:00
"messages": [{"role": "user", "content": "Hello!"}],
"stream": false
2026-02-06 16:39:52 +08:00
}
'
2025-12-09 00:41:30 +08:00
```
2026-02-06 16:13:50 +08:00
2026-02-06 16:39:52 +08:00
## Documentation
| Document | Description |
|----------|-------------|
| [Getting Started ](docs/getting-started.md ) | First steps with aha |
| [Installation ](docs/installation.md ) | Detailed installation guide |
| [CLI Reference ](docs/cli.md ) | Command-line interface |
| [API Documentation ](docs/api.md ) | Library & REST API |
| [Supported Models ](docs/supported-models.md ) | Available AI models |
| [Concepts ](docs/concepts.md ) | Architecture & design |
| [Development ](docs/development.md ) | Contributing guide |
| [Changelog ](docs/changelog.md ) | Version history |
## Development
### Using aha as a Library
2026-02-06 16:13:50 +08:00
> cargo add aha
2026-02-07 13:28:13 +08:00
``` rust
2026-02-06 16:39:52 +08:00
# VoxCPM example
2025-12-09 00:41:30 +08:00
use aha ::models ::voxcpm ::generate ::VoxCPMGenerate ;
use aha ::utils ::audio_utils ::save_wav ;
use anyhow ::Result ;
fn main ( ) -> Result < ( ) > {
let model_path = " xxx/openbmb/VoxCPM-0.5B/ " ;
2026-02-06 16:39:52 +08:00
2025-12-09 00:41:30 +08:00
let mut voxcpm_generate = VoxCPMGenerate ::init ( model_path , None , None ) ? ;
2026-02-06 16:39:52 +08:00
2025-12-09 00:41:30 +08:00
let generate = voxcpm_generate . generate (
2026-02-06 16:39:52 +08:00
" The sun is shining bright, flowers smile at me, birds say early early early " . to_string ( ) ,
2025-12-09 00:41:30 +08:00
None ,
None ,
2 ,
100 ,
10 ,
2.0 ,
false ,
6.0 ,
) ? ;
let _ = save_wav ( & generate , " voxcpm.wav " ) ? ;
Ok ( ( ) )
}
```
2026-02-06 16:39:52 +08:00
### Extending New Models
2025-12-09 00:41:30 +08:00
2026-02-06 16:39:52 +08:00
- Create new model file in src/models/
- Export in src/models/mod.rs
- Add support for CLI model inference in src/exec/
- Add tests and examples in tests/
2025-12-09 00:41:30 +08:00
2026-02-06 16:39:52 +08:00
## Features
2025-12-09 00:41:30 +08:00
2026-02-06 16:39:52 +08:00
- High-performance inference via Candle framework
- Multi-modal model support (vision, language, speech)
- Clean, easy-to-use API design
- Minimal dependencies, compact binaries
- Flash Attention support for long sequences
- FFmpeg support for multimedia processing
2025-12-09 00:41:30 +08:00
2026-02-06 16:39:52 +08:00
## License
2025-10-10 23:25:25 +08:00
2026-02-06 16:39:52 +08:00
Apache-2.0 — See [LICENSE ](LICENSE ) for details.
2025-10-10 23:25:25 +08:00
2026-02-06 16:39:52 +08:00
## Acknowledgments
2025-10-10 23:25:25 +08:00
2026-02-06 16:39:52 +08:00
- [Candle ](https://github.com/huggingface/candle ) - Excellent Rust ML framework
- All model authors and contributors
2025-11-23 19:41:56 +08:00
2026-04-07 12:08:23 +08:00
## Wechat & Donate
<div align="center">
| Wechat Group | Donate |
|--------------|--------|
2026-04-18 13:36:16 +08:00
|  |  |
2026-04-07 12:08:23 +08:00
</div>
2026-02-06 16:13:50 +08:00
---
2025-10-26 21:39:23 +08:00
2026-02-06 16:13:50 +08:00
<p align="center">
2026-02-06 16:39:52 +08:00
<sub>Built with ❤️ by the aha team</sub>
2026-02-06 16:13:50 +08:00
</p>
2025-10-10 23:25:25 +08:00
2026-02-06 16:13:50 +08:00
<p align="center">
2026-02-06 16:39:52 +08:00
<sub>We're continuously expanding our model support. Contributions are welcome!</sub>
2026-02-06 16:13:50 +08:00
</p>
<p align="center">
2026-02-06 16:39:52 +08:00
<sub>If this project helps you, please consider giving us a ⭐ Star!</sub>
2026-02-06 16:13:50 +08:00
</p>