WordPress Developer · WooCommerce Developer · Web Developer · Cape Town, South Africa
Skills in this project: llama.cpp · FastAPI · Python · n8n · SuiteCRM · WordPress · Docker · Nginx · REST API · NDJSON logging · OAuth · Session management · JSON validation · AI integration · CRM automation · Lead enrichment · Web Developer · WordPress Developer
The Problem
Most website visitors don’t convert straight away. They browse, ask questions, and only then submit a form. If the CRM only stores form fields, you lose all that intent data. The goal was to capture what visitors asked the AI assistant and join that history to their form submission when they finally converted — giving the sales team a lead record that already contains context, recommended services, and the visitor’s intent.
What I Built
- Self-hosted LLM running on a VPS using llama.cpp, exposed via an OpenAI-compatible API endpoint
- FastAPI layer with strict JSON validation — guardrails that remove reasoning blocks, extract the first valid JSON object, validate allowed service slugs, and fall back safely when model output is messy
- Session ID strategy: a browser session ID (tl_session_id) injected as a URL parameter on every AI request and stored consistently in the backend NDJSON log
- Backend logging capturing session ID, user question, recommendation slugs, timestamps, latency, IP address, and user agent
- n8n production workflow: receives form submissions via webhook, fetches recent AI logs, filters by session ID, generates a plain-English summary, and writes a complete lead record into SuiteCRM
- SuiteCRM OAuth authentication from n8n with successful lead creation including full AI context in the lead description field
Real Problems Solved
These are real issues that surfaced under real users and real hosting constraints.
- The frontend was cancelling full AI requests after 8 seconds but the backend only logs completed requests to avoid duplicates. Fixed by increasing the full request timeout so logs are always captured.
- SuiteCRM V8 does not support PATCH or PUT updates without triggering duplicate primary key MySQL errors. Restructured the n8n workflow to create the lead once with all context included upfront.
- Implemented email-based deduplication logic to prevent duplicate lead records when visitors submit multiple forms in the same session.
Skills Demonstrated
- llama.cpp
- FastAPI
- Python
- n8n
- SuiteCRM
- WordPress
- Docker
- Nginx
- REST API
- NDJSON logging
- OAuth
- Session management
- JSON validation
- AI integration
- CRM automation
- Lead enrichment
- Web Developer
- WordPress Developer
Looking to hire a WordPress Developer or WooCommerce Developer based in Cape Town? Get in touch or download my CV.