Dev builds multilingual chat widget using local ONNX embeddings to cut API costs

A developer created 'Ask Leya', a business-focused chat widget that answers queries from a company's own content and escalates to a human agent when needed. Unlike conventional chatbots, it uses the paraphrase-multilingual-MiniLM-L12-v2 model run locally via ONNX to embed queries across 50+ languages without external API calls or per-query embedding costs. The stack combines Node.js, Express, Postgres with pgvector, Socket.IO for live handoffs, and gpt-4o-mini via OpenRouter for generating responses. Key engineering challenges included managing a shared database with unreleased modules, handling async rejections in Express 4, and a 90-second production hang caused by a macOS binary being deployed on a Linux server. Integrations for WhatsApp, Instagram, and Messenger are complete but held back pending a polished self-serve release.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in