GigaChat by SMS: How to Talk to AI Without the Internet

When mobile internet is unstable or unavailable, an idea surfaces: why not talk to an AI over SMS? The author put that idea to a practical test. The system consists of a cheap Android phone, a Russian VPS, and an app that forwards incoming SMS to an AI model and sends the reply back. Total cost of ownership is around 500 rubles a month. The logic is simple: a text arrives via SMS, GigaChat processes it, and the reply goes back in one or several SMS messages. What's needed: • Android 5+ (the author used a Nokia 7 running Android 7.1.1) • A T-Mobile SIM with an unlimited SMS package (49 rubles/month) • A Selectel VPS: 2 vCPU, 2 GB RAM, 40 GB SSD (400 rubles/month) • Sber's GigaChat (250 million free tokens per year) • The SMS Gateway for Android app v1.77.1 and a Python + FastAPI + SQLite + Caddy stack

AI-processed from Habr AI; edited by Hamidun News
GigaChat by SMS: How to Talk to AI Without the Internet
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Android 5+ (the author used a Nokia 7 running Android 7.1.1)
Key metric #2A T-Mobile SIM with an unlimited SMS package (49 rubles/month)
A Selectel VPS2 vCPU, 2 GB RAM, 40 GB SSD (400 rubles/month)

The Idea and the Architecture

Unstable mobile internet in some regions of Russia is pushing developers toward experimentation. One of them decided to build a system for talking to AI via SMS — the most reliable communication channel for any phone. The pitch is simple: you send a text via SMS and get a reply from GigaChat in a return message.

The system was built iteratively with help from the AI agent itself. The author tested it in practice rather than claiming it's a technically perfect or secure solution. Similar services already exist (Voxie AI in the US, for example), but they run on international numbers with unclear support for Russian.

Components and Prices

Here's the full stack broken down:

Hardware: an old Android phone (a Nokia 7 TA-1041 running Android 7.1.1, or any other phone for 1,000–2,000 rubles from Avito) plus a second SIM card.

Carrier: T-Mobile with a custom plan builder — 0 minutes, 0 GB of data, just unlimited SMS for 49 rubles a month. Registration took extra effort, but it worked out in the end.

Cloud: a Selectel VPS with 2 vCPU, 2 GB RAM, 40 GB SSD — 400 rubles a month. Requirements: Ubuntu 22 or 24, KVM virtualization.

Domain: any cheap domain (100–200 rubles/year). Two A-type DNS records are needed, for app.domain.ru and sms.domain.ru, pointing to the VPS's IP. Important: proxy status must be "DNS only" (not routed through Cloudflare's proxy), otherwise Let's Encrypt and the SSE connection to the phone will break.

AI model: Sber's GigaChat (free 250 million tokens a year). Requires registering for the GigaChat API and obtaining an authorization key.

Mobile app: SMS Gateway for Android version 1.77.1 (specifically the app-release.apk, not the insecure version).

Dev stack: Python, FastAPI for the web server, SQLite for the session database, Caddy for HTTPS and reverse proxying.

Setup and Configuration

Docker and a UFW firewall are installed on the VPS. The rules: allow SSH (22), 80 (for Let's Encrypt), 443 (for HTTPS), and deny everything else. NTP is enabled for time sync — webhooks are signed with timestamps, and the receiver only accepts requests within a ±5-minute window.

The project code is cloned from the repository https://github.com/VladSmr/sms-ai-gateway. The environment variables in .env and config.yaml are then filled in.

Key parameters:

• system_prompt — the instruction given to the model: "Reply in Russian, concisely, under 200 characters, no emoji or markdown" • max_reply_units = 201 — a hard cap on reply size (each block is 67 characters, minus 3 characters per header for concatenation) • max_tokens = 500 — GigaChat's generation limit • max_sessions = 10 — concurrent dialog sessions (each lives for 24 hours without activity; switching to another: "#2 your question") • history_messages = 10 — the number of past messages sent to the model for context

On the phone, the SMS Gateway app is configured with the API URL (https://sms.domain.ru/api/mobile/v1) and an access token; connecting generates credentials. The webhook signing key (HMAC) is then set, along with a 14-minute ping interval; battery optimization is disabled and FIFO message processing is enabled.

Five events are registered on the VPS via the REST API: sms:received, sms:delivered, sms:failed, system:ping, and app:started. The main number that sends requests is added to the whitelist in config.yaml, so tokens aren't wasted replying to random senders.

Practical Difficulties

The first problem: Android's sleep mode kicks in after 30 minutes, and messages get stuck in a buffer, retrying at increasing intervals (14 attempts over 45 hours). The fix: enable developer mode and check "keep screen on" — but that only works while the phone is charging. Whether it's safe to leave the phone running for several days unattended is unclear.

The second problem: a new, "unwarmed" SIM card can delay outgoing SMS due to the carrier's anti-fraud filters. The exact cause is unknown, and carrier support didn't help. The issue didn't recur after that.

Takeaways

The project proved the concept works. Further development could include adding RAG for search, integrating other AI models, or redirecting annoying contacts to the AI. The possibilities are limited only by imagination and Russian law. One important caveat: the carrier can read every SMS.

Story

Key Questions Answered

What are the key details on The Idea and the Architecture?

Unstable mobile internet in some regions of Russia is pushing developers toward experimentation. One of them decided to build a system for talking to AI via SMS — the most reliable communication channel for any phone. The pitch is simple: you send a text via SMS and get a reply from GigaChat in a return message. The system was built iteratively with help from the AI agent itself. The author tested it in practice rather than claiming it's a technically perfect or secure solution. Similar services already exist (Voxie AI in the US, for example), but they run on international

What are the key details on Components and Prices?

Here's the full stack broken down: Hardware: an old Android phone (a Nokia 7 TA-1041 running Android 7.1.1, or any other phone for 1,000–2,000 rubles from Avito) plus a second SIM card. Carrier: T-Mobile with a custom plan builder — 0 minutes, 0 GB of data, just unlimited SMS for 49 rubles a month. Registration took extra effort, but it worked out in the end. Cloud: a Selectel VPS with 2 vCPU, 2 GB RAM, 40 GB SSD — 400 rubles a month. Requirements: Ubuntu 22 or 24, KVM virtualization. Domain: any cheap domain (100–200 rubles/year). Two A-type DNS records are needed, for app

What are the key details on Setup and Configuration?

Docker and a UFW firewall are installed on the VPS. The rules: allow SSH (22), 80 (for Let's Encrypt), 443 (for HTTPS), and deny everything else. NTP is enabled for time sync — webhooks are signed with timestamps, and the receiver only accepts requests within a ±5-minute window. The project code is cloned from the repository https://github.com/VladSmr/sms-ai-gateway. The environment variables in .env and config.yaml are then filled in. Key parameters: system_prompt — the instruction given to the model: "Reply in Russian, concisely, under 200 characters, no emoji or markdown

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Private AI Builders Community · Vibe Club

Ship AI Faster with Founders, Engineers & Weekly Architecture Reviews

Inside Vibe Club (hamidun.com/club) — weekly live masterminds with Zhemal Khamidun, Tech Radar, full LMS access, and 370+ production Claude Code skills.

Join Vibe Club →Explore Hamidun Academy
What do you think?
Loading comments…