IT Specialist AI for Cloud, DevOps, Deployment, Support, and Computer Skills
An open-source, production-grade AI specialist model for IT operations, cloud engineering, DevOps, deployments, infrastructure support, troubleshooting, networking, security, and technical customer service. VA LLM Specialist Model is grounded in your organization's IT datasets and operational knowledge so it answers as an IT specialist instead of a generalist healthcare or finance model.
Author: Joel Otepa Wembo - joelwembo.com
- Use Cases
- Architecture
- Quick Start
- Step-by-Step Guide
- Configuration
- Project Structure
- Data Management
- Troubleshooting
VA LLM Specialist Model uses a hybrid RAG (Retrieval-Augmented Generation) + Deterministic Reasoning architecture.
┌─────────────────────────────────────────────────────────────┐
│ User / Application │
└────────────────────────┬────────────────────────────────────┘
│ HTTP Request
▼
┌─────────────────────────────────────────────────────────────┐
│ FastAPI Gateway (app.py) │
│ ├─ Rate Limiting ├─ Metrics Collection │
│ ├─ Request Logging └─ Circuit Breaker │
└────────────────────────┬────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌──────────┐
│ /search │ │ /api/v1 │ │ /api/v2 │
└────┬────┘ └────┬─────┘ └────┬─────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────┐
│ VectorStore (FAISS) │
│ ├─ Embedding Model: all-MiniLM-L6-v2 (384-dim) │
│ ├─ L1 Cache: Embeddings (TTL 1h) │
│ └─ L2 Cache: Search Results (TTL 30m) │
└────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ ReasoningEngine (reasoning.py) │
│ Search → Analyze → Synthesize → Decide │
└─────────────────────────────────────────────────────────────┘
| Component | Description |
|---|---|
| VectorStore | FAISS-based semantic search with sentence-transformers embeddings |
| ReasoningEngine | Multi-step chain-of-thought reasoning for cloud operations |
| Cache | Multi-level TTL caching (embeddings L1, search results L2) |
| Metrics | Prometheus metrics for observability |
| Health | Kubernetes-compatible readiness/liveness probes |
- Semantic Search: Query infrastructure knowledge using natural language
- Chain-of-Thought Reasoning: Multi-step analysis with confidence scoring
- Multi-Cloud Support: AWS, Azure, GCP, and Kubernetes intelligence
- 100% Offline: No external API calls required - full data sovereignty
- Production Ready: Rate limiting, circuit breaker, structured logging
- Observable: Prometheus metrics, Grafana dashboards, health probes
- Scalable: Docker Compose, Kubernetes (AKS), horizontal scaling
- Python 3.11+
- Docker and Docker Compose (recommended)
- 4GB+ RAM
# Clone and navigate to project
cd va_llm_v1
# Start full stack (API + Redis + Prometheus + Grafana)
docker-compose up -d
# Check status
docker-compose psServices will be available at:
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000
# Clone the repository
git clone https://github.com/valtunox/va_llm_specialist_model.git
cd va_llm_specialist_model
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Copy environment template
cp .env.example .env # Edit with your API keysKey environment variables:
# Specialist Scope
ACTIVE_INDUSTRY=cloud # legacy env; runtime scope is IT-specialist only
# LLM Provider (for reasoning API)
MODEL_PROVIDER=gemini # ollama | openai | gemini | anthropic | huggingface
GOOGLE_API_KEY=your-key-here # Or OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.
# Optional live web search enrichment
VALLM_ENABLE_WEB_SEARCH=true
VALLM_WEB_SEARCH_PROVIDER=auto # auto | tavily | serpapi | duckduckgo
TAVILY_API_KEY=your-key-here
# Database (optional)
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/vallm
# Redis (optional, for caching)
REDIS_URL=redis://localhost:6379/0This repository is now intentionally IT-only. The default training and indexing pipeline loads only these dataset folders:
app/data/datasets/cloud/app/data/datasets/automation/app/data/datasets/customer_service/app/data/datasets/skills/app/data/datasets/uploaded/
Healthcare, finance, and generic business datasets are excluded from the specialist pipeline by default.
Typical commands:
# Precompute IT-only retrieval data
python -m app.services.ai.ml.precompute
# Train the IT specialist model
python -m app.services.ai.ml.train
# Query the IT specialist API with optional web enrichment
curl -X POST http://localhost:8000/api/models/v1/query \
-H "Content-Type: application/json" \
-d '{
"query": "Why are IAM access keys not rotated in 90 days?",
"use_web_search": true,
"web_search_max_results": 5
}'The service will:
- Download embedding model (first run only, ~80MB)
- Auto-build FAISS index if not present (when
VALLM_AUTO_PRECOMPUTE=true) - Start API server on http://localhost:8000
# Health check
curl http://localhost:8000/health
# Query endpoint
curl -X POST http://localhost:8000/api/models/v1/query \
-H "Content-Type: application/json" \
-d '{
"query": "Why are IAM access keys not rotated in 90 days?",
"top_k": 5,
"include_reasoning": true
}'
# Developer endpoint (Terraform generation)
curl -X POST http://localhost:8000/api/models/v1/developer \
-H "Content-Type: application/json" \
-d '{
"query": "Create Terraform config for EKS cluster",
"include_code": true
}'Build a FAISS vector index from your datasets for semantic search:
# Precompute the IT specialist corpus
python -m app.services.ai.ml.precompute
# CSV-only precompute
python -m app.services.ai.ml.precompute --no-documents
# Output:
# app/data/vectorstore/index.faiss
# app/data/vectorstore/documents.pklWhat happens:
- Loads only the curated IT dataset folders under
app/data/datasets/ - Converts rows to text for cloud, DevOps, deployment, support, and skills retrieval
- Generates embeddings with sentence-transformers
- Builds FAISS IndexFlatIP (cosine similarity)
- Saves index + documents to
app/data/vectorstore/
Fine-tune a causal language model on your IT specialist data:
# Build image
docker build -t vallm:latest .
# Run container
docker run -p 8000:8000 -v $(pwd)/app/data:/app/data vallm:latest# Start the FastAPI server
python -m app.app
# Or with uvicorn directly
uvicorn app.app:app --host 0.0.0.0 --port 8000 --reload
# Or with Docker
docker-compose up -d
# View logs
docker-compose logs -f vallm
# Stop all services
docker-compose downIncluded Services:
vallm: FastAPI application (port 8000)redis: Caching layer (port 6379)prometheus: Metrics collection (port 9090)grafana: Metrics visualization (port 3000)
Manifests are in deployment/kubernetes/:
# Apply manifests
kubectl apply -f deployment/kubernetes/
# Check deployment
kubectl get pods -l app=vallmSee deployment.md for detailed instructions.
GitHub Actions (.github/workflows/data-pipeline.yml):
- Linting and testing
- Docker build and push
- Deploy to VM or Kubernetes
Azure Pipelines (azure-pipelines.yml):
- Build and push to Azure Container Registry
- Deploy to VM via SSH
- Deploy to AKS
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
HTML status page |
| GET | /health |
Basic health check |
| GET | /health/ready |
Readiness probe (K8s) |
| GET | /health/live |
Liveness probe (K8s) |
| GET | /metrics |
Prometheus metrics |
| GET | /docs |
OpenAPI documentation |
| POST | /search |
Vector similarity search |
| POST | /generate |
Text generation (if model loaded) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/model/v1/query |
Main RAG query with reasoning |
| POST | /api/model/v1/developer |
Developer/Terraform assistance |
| POST | /api/model/v1/terminal |
CLI command assistance |
Example Request:
{
"query": "How do I provision an EC2 instance?",
"top_k": 5,
"include_reasoning": true,
"filter_type": "resource"
}| Method | Endpoint | Description |
|---|---|---|
| POST | /api/model/v2/query |
NLP-enhanced query with entity extraction |
| POST | /api/model/v2/upload |
Document/image upload for analysis |
| POST | /api/model/v2/extract |
Entity extraction from text |
| GET | /api/model/v2/status |
NLP capability status |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/model/v3/query |
Incident pattern detection |
| Variable | Default | Description |
|---|---|---|
VALLM_AUTO_PRECOMPUTE |
true |
Auto-build FAISS index if missing |
VALLM_AUTO_TRAIN |
false |
Auto-train LLM model if missing |
USE_CUDA |
false |
Enable GPU acceleration |
VALLM_JSON_LOGGING |
false |
Enable structured JSON logging |
VALLM_RATE_LIMIT_ENABLED |
false |
Enable rate limiting |
VALLM_RATE_LIMIT_PER_MINUTE |
60 |
Max requests per minute per client |
VALLM_CACHE_EMBEDDINGS |
true |
Enable embedding cache (L1) |
VALLM_CACHE_SEARCH |
true |
Enable search result cache (L2) |
ENVIRONMENT |
production |
Deployment environment |
PORT |
8000 |
API server port |
REDIS_HOST |
redis |
Redis hostname |
REDIS_PORT |
6379 |
Redis port |
# Enable CUDA
export USE_CUDA=true
# Install GPU-enabled FAISS
pip uninstall faiss-cpu
pip install faiss-gpuEdit app/embeddings.py:
vector_store = VectorStore(
data_dir=data_dir,
model_name="all-mpnet-base-v2" # Higher quality, larger model
)Available at /metrics:
http_requests_total- Request count by method/endpoint/statushttp_request_duration_seconds- Request latency histogramvector_search_requests_total- Vector search operationsvector_search_duration_seconds- Search latencycache_hits_total/cache_misses_total- Cache effectivenessllm_generation_requests_total- LLM generation operations
Pre-configured dashboards in monitoring/grafana/dashboards/:
- VA LLM Specialist Model Overview
- API Performance
- Cache Metrics
- System Health
Access Grafana at http://localhost:3000 (default: admin/admin)
# Basic health
curl http://localhost:8000/health
# Readiness (checks vector store, FAISS, memory)
curl http://localhost:8000/health/ready
# Liveness
curl http://localhost:8000/health/live# View recent logs via API
curl http://localhost:8000/logs
# Log statistics
curl http://localhost:8000/logs/stats
# Docker logs
docker-compose logs -f vallmva_llm_v1/
├── app/ # Main application
│ ├── app.py # FastAPI application
│ ├── embeddings.py # VectorStore (FAISS)
│ ├── reasoning.py # ReasoningEngine
│ ├── routes.py # All API endpoints (v1, v2, v3)
│ ├── precompute.py # Build FAISS index
│ ├── train.py # LLM fine-tuning
│ ├── cache.py # Multi-level caching
│ ├── circuit_breaker.py # Resilience pattern
│ ├── exceptions.py # Custom exceptions
│ ├── health.py # Health check endpoints
│ ├── logging_config.py # Structured logging
│ ├── metrics.py # Prometheus metrics
│ ├── rate_limit.py # Rate limiting
│ ├── data/ # Data directory
│ │ ├── *.csv # Knowledge base files
│ │ ├── *.pdf # PDF documents
│ │ ├── vectorstore/ # FAISS index artifacts
│ │ └── model/ # Trained model artifacts
│ └── tests/ # Test files
├── deployment/ # Deployment configs
│ ├── kubernetes/ # K8s manifests
│ └── vm/ # VM deployment
├── monitoring/ # Monitoring stack
│ ├── prometheus.yml # Prometheus config
│ └── grafana/ # Grafana dashboards
├── scripts/ # Utility scripts
├── Dockerfile # Container image
├── docker-compose.yml # Full stack setup
├── requirements.txt # Python dependencies
├── azure-pipelines.yml # Azure DevOps CI/CD
└── .github/workflows/ # GitHub Actions CI/CD
All data is in app/data/:
*.csv- Structured knowledge (resources, incidents, recommendations)*.pdf- DevOps documentation*.json- Configuration datavectorstore/- FAISS index and document metadata
# Standard precompute
python -m app.precompute
# Check index status
python -m app.precompute --action check# Generate synthetic data
python scripts/massive_data_expansion.py
# Rebuild index after adding data
python -m app.precompute# Train on CSV data
python -m app.train --num-train-epochs 1
# Model saved to app/data/model/FAISS index not found
# Rebuild the index
python -m app.precomputeIndex has 0 vectors / generic responses
- Ensure CSV files exist in
app/data/ - Run
python -m app.precomputeto populate the index
Model download failed
- Check internet connection (first run only)
- Model is cached after first download (~80MB)
Out of memory
- Use smaller model:
all-MiniLM-L6-v2(default, 80MB) - Reduce batch size in
embeddings.py - Increase container memory limits
Connection refused on health check
- Wait for startup to complete
- Check logs:
docker-compose logs vallm
# Enable verbose logging
export VALLM_JSON_LOGGING=true
python -m app.app| Category | Technologies |
|---|---|
| Framework | FastAPI, Uvicorn |
| AI/ML | sentence-transformers, FAISS, PyTorch, spaCy |
| Data | Pandas, NumPy, PyPDF2 |
| Caching | Redis, in-memory TTL cache |
| Monitoring | Prometheus, Grafana |
| Container | Docker, Docker Compose |
| Orchestration | Kubernetes (AKS) |
| CI/CD | GitHub Actions, Azure Pipelines |
BSD 3-Clause License — see LICENSE for details.
© 2026 Joel Otepa Wembo
Contributions are welcome! Please follow these steps:
- Fork the repository and create a feature branch
- Make changes and add/update tests
- Run linting:
flake8 app/ - Submit a pull request describing your changes
For detailed deployment instructions, see deployment.md.