$ cat case-study/dertli-bot.md
Dertli Bot: a serverless Albanian AI chatbot that keeps answering
How I built an AI assistant that speaks Albanian — with provider failover, abuse protection and voice — and how I traced a Cloudflare 403 that was blocking serverless traffic.
Netlify FunctionsAI failoverRate limitingNeural TTSSpeech recognitionTelegram
Live on the web and on Telegram, answering real users in Albanian — now with voice.
01 The goal
Most AI assistants feel foreign to Albanian speakers. I wanted a chatbot that answers naturally in Albanian, works on the web and in Telegram, and can talk back with a voice — without running or paying for a server that sits idle.
02 Architecture
The whole backend is serverless, running on Netlify Functions. Every message travels the same short path:
ClientWeb & Telegram
GuardRate limit + checks
RouterPrimary → fallback
ReplyText + voice
- Provider failover. Requests go to a primary AI provider; if it fails, they are routed automatically to a fallback, so one outage doesn't take the bot down.
- Abuse protection. Per-IP rate limiting keeps costs predictable, and prompt-injection defenses stop users from talking the bot out of its instructions.
- Voice layer. Replies can be spoken with neural text-to-speech, and voice messages are transcribed with server-side speech recognition in Albanian.
03 The incident: a 403 that wasn't my code
At one point, requests leaving the serverless functions started coming back with HTTP 403.
# the symptom
POST → upstream 403 Forbidden // from the serverless function
# the cause
blocked by Cloudflare serverless IP ranges
# the fix path
evidence collected ✓
official support ticket ✓ escalated
I traced the block to Cloudflare: it was rejecting traffic coming from serverless IP addresses, not anything the bot was sending. Once I had that isolated, I documented it and escalated it through an official Cloudflare support ticket.
A 403 from infrastructure looks exactly like a 403 from your own code — so the first step is finding out who actually sent it, before changing anything.
04 What I took from it
- Design for the provider to fail. Fallback routing turns an outage into a slower answer instead of no answer.
- Read the status code, then find who sent it. The same error can come from your code, the provider, or the network in between.
- Escalate with evidence. A clear, reproducible report is what gets a support ticket taken seriously.
Need a chatbot like this for your site or Telegram?
Let's talk →
$ cat case-study/dertli-bot.md
Dertli Bot: një chatbot AI shqip, serverless, që nuk ndalet
Si ndërtova një asistent AI që flet shqip — me failover ndërmjet ofruesve, mbrojtje nga abuzimi dhe zë — dhe si e gjeta një bllokim Cloudflare 403 që po ndalonte trafikun serverless.
Netlify FunctionsAI failoverRate limitingNeural TTSNjohje e të foluritTelegram
Live në web dhe në Telegram, u përgjigjet përdoruesve realë në shqip — tani edhe me zë.
01 Qëllimi
Shumica e asistentëve AI tingëllojnë të huaj për shqipfolësit. Doja një chatbot që përgjigjet natyrshëm në shqip, punon në web dhe në Telegram, dhe mund të flasë me zë — pa mbajtur dhe pa paguar një server që rri bosh.
02 Arkitektura
I gjithë backend-i është serverless, mbi Netlify Functions. Çdo mesazh ndjek të njëjtën rrugë të shkurtër:
KlientiWeb & Telegram
MbrojtjaRate limit + kontrolle
DrejtimiKryesor → rezervë
PërgjigjjaTekst + zë
- Failover ndërmjet ofruesve. Kërkesat shkojnë te një ofrues AI kryesor; nëse ai dështon, drejtohen automatikisht te një rezervë, që një ndërprerje të mos e rrëzojë botin.
- Mbrojtje nga abuzimi. Kufizimi i kërkesave për IP i mban kostot të parashikueshme, dhe mbrojtjet ndaj prompt-injection nuk i lejojnë përdoruesit ta largojnë botin nga udhëzimet e tij.
- Shtresa e zërit. Përgjigjet mund të lexohen me text-to-speech neural, dhe mesazhet zanore transkriptohen me njohje të të folurit shqip në server.
03 Incidenti: një 403 që nuk vinte nga kodi im
Në një moment, kërkesat që dilnin nga funksionet serverless filluan të ktheheshin me HTTP 403.
# simptoma
POST → upstream 403 Forbidden // nga funksioni serverless
# shkaku
bllokuar nga Cloudflare IP-të serverless
# rruga e zgjidhjes
prova të mbledhura ✓
tiket zyrtar mbështetjeje ✓ i përshkallëzuar
E gjeta që bllokimi vinte nga Cloudflare: refuzonte trafikun që vinte nga adresat IP serverless, jo diçka që dërgonte boti. Pasi e izolova, e dokumentova dhe e përshkallëzova me një tiket zyrtar mbështetjeje te Cloudflare.
Një 403 nga infrastruktura duket njësoj si një 403 nga kodi yt — ndaj hapi i parë është të gjesh kush e dërgoi në të vërtetë, para se të ndryshosh ndonjë gjë.
04 Çfarë mësova
- Projekto duke pritur që ofruesi të dështojë. Drejtimi te rezerva e kthen një ndërprerje në një përgjigje më të ngadaltë, jo në asnjë përgjigje.
- Lexo kodin e statusit, pastaj gjej kush e dërgoi. I njëjti gabim mund të vijë nga kodi yt, nga ofruesi ose nga rrjeti ndërmjet.
- Përshkallëzo me prova. Një raport i qartë dhe i përsëritshëm është ai që e bën një tiket mbështetjeje të merret seriozisht.
Të duhet një chatbot si ky për faqen ose Telegram-in tënd?
Le të flasim →