A self-hosted AI chat application built in C++ with Qt, powered by llama.cpp. Runs entirely on your own hardware — no internet required, no data sent anywhere.
C++:
sudo dnf install cmake gcc-c++ boost-devel qt6-qtbase-devel gtest-devel
Python:
pip install huggingface-hub sentence-transformers chromadb PyPDF2 psutil --break-system-packages
llama.cpp (build from source):
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=OFF # add -DGGML_CUDA=ON if you have CUDA
cmake --build build --config Release -j$(nproc)
git clone https://github.com/yourusername/llm-bot
cd llm-bot
# Configure
cmake -B "out/build" -DGGML_CUDA=OFF
# Build
cmake --build "out/build" --config Release -j$(nproc)
Use the in-app model manager (Settings → Models → Download). So you can choose whatever models fits you.
The app automatically starts llama-server in the background and connects to it.
Supported formats: .pdf, .txt, .md, .hpp, .cpp, .h, .py
Once indexed, the AI will automatically reference relevant passages from your documents when answering questions.
llm-bot/
├── src/
│ ├── config/
│ │ ├── config_manager.hpp # Reads/writes config.json
│ │ └── model_config.hpp # Model registry and prompt formats
│ ├── net/
│ │ └── http_client.hpp # Boost.Beast HTTP client
│ ├── rag/
│ │ └── rag_context.hpp # RAG query interface
│ ├── server/
│ │ └── server_manager.hpp # llama-server process management
│ ├── session/
│ │ └── conversation.hpp # Message history and prompt formatting
│ ├── storage/
│ │ ├── history_store.hpp # Session save/load
│ │ └── sessions/ # Saved conversations (gitignored)
│ ├── ui/
│ │ ├── add_model_dialog.* # Download new models
│ │ ├── chat_bubble_delegate.* # Custom bubble renderer
│ │ ├── main_window.* # Main Qt window
│ │ ├── markdown_parser.hpp # Markdown to HTML converter
│ │ ├── message_item.hpp # Chat message data
│ │ ├── model_tab_widget.* # Per-model tab system
│ │ ├── session_sidebar.* # Conversation history sidebar
│ │ └── settings_dialog.* # Settings panel
│ ├── llm_worker.* # Background thread for inference
│ └── main.cpp
├── scripts/
│ ├── model_manager.py # Download, delete, list models
│ └── rag_manager.py # Index and query documents
├── tests/
│ ├── test_conversation.cpp # Prompt format tests
│ ├── test_markdown.cpp # Markdown parser tests
│ ├── test_model_registry.cpp # Model registry tests
│ └── test_history_store.cpp # Session storage tests
├── llama.cpp/ # Inference engine (submodule or clone)
├── config.json # User configuration
└── CMakeLists.txt
| Model | Size (Q4_K_M) | VRAM | Format |
|---|---|---|---|
| Qwen 2.5 7B | 4.5 GB | 5.0 GB | ChatML |
| Qwen 2.5 11B | 7.0 GB | 7.5 GB | ChatML |
| Qwen Coder 7B | 4.5 GB | 5.0 GB | ChatML |
| Qwen Coder 14B | 8.5 GB | 9.0 GB | ChatML |
| DeepSeek R1 7B | 4.5 GB | 5.0 GB | ChatML |
| DeepSeek R1 14B | 8.5 GB | 9.0 GB | ChatML |
| Mistral 7B | 4.1 GB | 4.5 GB | Mistral |
| Phi 3.5 Mini | 2.2 GB | 2.5 GB | Phi3 |
| MiMo 7B | 4.5 GB | 5.0 GB | ChatML |
Adding a new model requires two steps — add an entry to scripts/model_manager.py and src/config/model_config.hpp. See the existing entries for the pattern.
I will manually add models as the project grows.
The -ngl flag controls how many model layers run on the GPU:
-ngl 0 → CPU only (slowest, no VRAM used)
-ngl 16 → half on GPU, half on CPU
-ngl 32 → all layers on GPU (fastest, most VRAM)
Set gpu_layers in config.json. With 8GB VRAM and a 7B model, -ngl 32 fits comfortably. For 14B models use partial offloading (e.g. -ngl 20).
| Component | Technology |
|---|---|
| Language | C++23 |
| GUI | Qt 6 |
| Networking | Boost.Asio + Boost.Beast |
| JSON | Boost.JSON |
| Inference | llama.cpp |
| Embeddings | sentence-transformers (all-MiniLM-L6-v2) |
| Vector DB | ChromaDB |
| Model downloads | huggingface-hub |
| Build | CMake |
| Tests | Google Test |
The application is in early development, there can be a lot of bugs or not safe code, my basic goal was make my idea to live, not being perfect. Polishing will come around, I am welcome to any critics and advices!
1 commits
C++
85.0%
Python
13.3%
CMake
1.8%
A self-hosted AI chat application built in C++ with Qt, powered by llama.cpp. Runs entirely on your own hardware — no internet required, no data sent anywhere.
C++:
sudo dnf install cmake gcc-c++ boost-devel qt6-qtbase-devel gtest-devel
Python:
pip install huggingface-hub sentence-transformers chromadb PyPDF2 psutil --break-system-packages
llama.cpp (build from source):
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=OFF # add -DGGML_CUDA=ON if you have CUDA
cmake --build build --config Release -j$(nproc)
git clone https://github.com/yourusername/llm-bot
cd llm-bot
# Configure
cmake -B "out/build" -DGGML_CUDA=OFF
# Build
cmake --build "out/build" --config Release -j$(nproc)
Use the in-app model manager (Settings → Models → Download). So you can choose whatever models fits you.
The app automatically starts llama-server in the background and connects to it.
Supported formats: .pdf, .txt, .md, .hpp, .cpp, .h, .py
Once indexed, the AI will automatically reference relevant passages from your documents when answering questions.
llm-bot/
├── src/
│ ├── config/
│ │ ├── config_manager.hpp # Reads/writes config.json
│ │ └── model_config.hpp # Model registry and prompt formats
│ ├── net/
│ │ └── http_client.hpp # Boost.Beast HTTP client
│ ├── rag/
│ │ └── rag_context.hpp # RAG query interface
│ ├── server/
│ │ └── server_manager.hpp # llama-server process management
│ ├── session/
│ │ └── conversation.hpp # Message history and prompt formatting
│ ├── storage/
│ │ ├── history_store.hpp # Session save/load
│ │ └── sessions/ # Saved conversations (gitignored)
│ ├── ui/
│ │ ├── add_model_dialog.* # Download new models
│ │ ├── chat_bubble_delegate.* # Custom bubble renderer
│ │ ├── main_window.* # Main Qt window
│ │ ├── markdown_parser.hpp # Markdown to HTML converter
│ │ ├── message_item.hpp # Chat message data
│ │ ├── model_tab_widget.* # Per-model tab system
│ │ ├── session_sidebar.* # Conversation history sidebar
│ │ └── settings_dialog.* # Settings panel
│ ├── llm_worker.* # Background thread for inference
│ └── main.cpp
├── scripts/
│ ├── model_manager.py # Download, delete, list models
│ └── rag_manager.py # Index and query documents
├── tests/
│ ├── test_conversation.cpp # Prompt format tests
│ ├── test_markdown.cpp # Markdown parser tests
│ ├── test_model_registry.cpp # Model registry tests
│ └── test_history_store.cpp # Session storage tests
├── llama.cpp/ # Inference engine (submodule or clone)
├── config.json # User configuration
└── CMakeLists.txt
| Model | Size (Q4_K_M) | VRAM | Format |
|---|---|---|---|
| Qwen 2.5 7B | 4.5 GB | 5.0 GB | ChatML |
| Qwen 2.5 11B | 7.0 GB | 7.5 GB | ChatML |
| Qwen Coder 7B | 4.5 GB | 5.0 GB | ChatML |
| Qwen Coder 14B | 8.5 GB | 9.0 GB | ChatML |
| DeepSeek R1 7B | 4.5 GB | 5.0 GB | ChatML |
| DeepSeek R1 14B | 8.5 GB | 9.0 GB | ChatML |
| Mistral 7B | 4.1 GB | 4.5 GB | Mistral |
| Phi 3.5 Mini | 2.2 GB | 2.5 GB | Phi3 |
| MiMo 7B | 4.5 GB | 5.0 GB | ChatML |
Adding a new model requires two steps — add an entry to scripts/model_manager.py and src/config/model_config.hpp. See the existing entries for the pattern.
I will manually add models as the project grows.
The -ngl flag controls how many model layers run on the GPU:
-ngl 0 → CPU only (slowest, no VRAM used)
-ngl 16 → half on GPU, half on CPU
-ngl 32 → all layers on GPU (fastest, most VRAM)
Set gpu_layers in config.json. With 8GB VRAM and a 7B model, -ngl 32 fits comfortably. For 14B models use partial offloading (e.g. -ngl 20).
| Component | Technology |
|---|---|
| Language | C++23 |
| GUI | Qt 6 |
| Networking | Boost.Asio + Boost.Beast |
| JSON | Boost.JSON |
| Inference | llama.cpp |
| Embeddings | sentence-transformers (all-MiniLM-L6-v2) |
| Vector DB | ChromaDB |
| Model downloads | huggingface-hub |
| Build | CMake |
| Tests | Google Test |
The application is in early development, there can be a lot of bugs or not safe code, my basic goal was make my idea to live, not being perfect. Polishing will come around, I am welcome to any critics and advices!
1 commits
C++
85.0%
Python
13.3%
CMake
1.8%