SolQuant is a three-tier AI edge stack for low-VRAM systems, combining:
- a Python FastAPI inference engine (llama-cpp + GGUF),
- a MongoDB Atlas Local vector store for RAG,
- and a Java Spring Boot agent orchestrator (LangChain4j). The project is tuned for constrained NVIDIA hardware (tested on MX550-class GPUs) and is designed for system monitoring and alert-driven agent workflows.
┌──────────────────────────────────────────────────────────────┐
│ Orchestrator (Spring Boot, Java 21) │
│ - POST /api/agent/chat │
│ - GET /api/agent/health │
│ Uses LangChain4j + tools for metrics and alerting │
└───────────────┬──────────────────────────────────────────────┘
│ HTTP
▼
┌──────────────────────────────────────────────────────────────┐
│ Inference Engine (FastAPI, Python) │
│ - POST /generate │
│ - GET /health │
│ - GET /vram │
│ Loads quantized GGUF model via llama-cpp-python │
└───────────────┬──────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────┐
│ Vector DB (MongoDB Atlas Local) │
│ Stores embeddings and supports vector search for RAG │
└──────────────────────────────────────────────────────────────┘
.
├── agent-controller/ # Spring Boot orchestrator
├── rag/ # RAG ingestion, embeddings, retrieval, DB helpers
├── server.py # FastAPI app and endpoints
├── model_loader.py # Model download/load lifecycle
├── vram_monitor.py # NVML-based VRAM monitoring
├── schemas.py # API schemas
├── config.py # Inference config (SQ_*)
├── docker-compose.yml # Full stack orchestration
├── deploy.sh # Guided deployment script
└── .env.example # Environment template
- FastAPI API for text generation and VRAM observability.
- Automatic GGUF model download from Hugging Face.
- Concurrency protection to avoid multi-request GPU OOM.
- Tuned defaults for low-VRAM operation. Endpoints:
POST /generateGET /healthGET /vram
- Exposes an AI monitoring agent over HTTP.
- Bridges to the Python inference engine through a custom chat model.
- Includes tool-enabled workflows:
readSystemMetrics(CPU/RAM/disk/temp report)writeAlert(INFO/WARNING/CRITICAL alert logging) Endpoints:
POST /api/agent/chatGET /api/agent/health
- Log ingestion and chunking.
- Embedding generation (all-MiniLM-L6-v2).
- MongoDB vector index creation and retrieval utilities.
- Docker Engine + Docker Compose v2
- NVIDIA drivers installed
- NVIDIA Container Toolkit configured
nvidia-smiworking
chmod +x deploy.sh
./deploy.shUseful commands:
./deploy.sh --status # service status + endpoints
./deploy.sh --logs # stream logs
./deploy.sh --build # rebuild images without cache
./deploy.sh --down # stop stackpython -m venv .venv
source .venv/bin/activate
CMAKE_ARGS="-DGGML_CUDA=on" pip install -r requirements.txt
cp .env.example .env
python main.pycurl http://localhost:8000/healthcurl -X POST http://localhost:8000/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "Summarize current edge system status.",
"max_tokens": 256,
"temperature": 0.3
}'curl -X POST http://localhost:8081/api/agent/chat \
-H "Content-Type: application/json" \
-d '{"query":"How healthy is the system right now?"}'Copy .env.example to .env and adjust values as needed.
Key groups:
SQ_*— inference model/runtime settingsRAG_*— MongoDB + embedding + retrieval settingsSOLQUANT_*— orchestrator-to-inference integration settings (Docker/env)
- Java module targets Java 21 (
agent-controller/pom.xml). - Maven tests/build for
agent-controllerrequire a Java 21 toolchain. - Inference defaults are optimized for low-VRAM cards; reduce
SQ_N_GPU_LAYERS,SQ_N_CTX, orSQ_N_BATCHif you encounter OOM.
Internal use — SolQuant project.