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:
AI-processed from Habr AI; edited by Hamidun News
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.
- Dec 2, 2026Ai2 Releases MolmoWeb2 Web Agents: 27B Model Solves 75.3% of Tasks
- Dec 2, 2026Amazon Releases Ergo Open Weights for Coding: 1.1 Trillion Parameters and 2,200 Tokens per Second
- Dec 2, 2026OpenAI Opens Dots Agent to ChatGPT Plus Subscribers With 10,000+ Plugins
- Dec 2, 2026FSK Group Has Launched 395 AI Agents in Six Months, with a 97.7% Success Rate
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.
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.
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.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
