Yuna

Self-hosted AI-powered multi-device orchestrator over Telegram. Claude picks the right device and runs the command — devices are just hands. You pick the character.

npx yuna-bot init
VercelClaude HaikuUpstash RedisTelegramNode 18+

Send a message. Claude does the rest.

You message your bot on Telegram. A Claude agent on your Vercel function decides what to do — answer directly, or dispatch bash commands to one of your registered devices via Redis Streams. Devices are stateless long-poll agents behind any NAT or firewall. No VPN, no Tailscale, no port forwarding.

Dynamic device registry

Add or remove devices at runtime. Tools are generated on the fly from whatever's in your Redis — no hardcoding.

Agentic tool_use

Multi-step loops: Claude can chain commands across devices and react to failure. "Grab the log from A, diff against B, deploy."

Per-device auth

Every device gets its own revocable UUID token. One-time setup codes for onboarding. No shared secrets.

Risk gate

Destructive commands (rm -rf, dd, sudo, force-push, writes) are held behind a 👍/❌ confirmation in Telegram. Defends against prompt injection via tool output.

Model overrides

Prefix a message with @opus, @sonnet, or @haiku to pick the model per request. Haiku by default — about $0.001 per message.

100% self-hosted

Your Vercel, your Upstash, your Anthropic key, your Telegram bot. No SaaS middleman. Your conversation history never leaves infrastructure you own.

How it works

Telegram message
         ↓
   Vercel webhook  ─────────→  Claude Haiku API
         ↓                      (tool_use loop)
   Risk gate + pending-confirm
         ↓
   Redis Streams (per-device queue)
         ↓
   Device agent (long-polls, executes bash, returns output)
         ↓
   Result fed back to Claude → final answer → Telegram

Install

# One-shot wizard — guides you through Telegram, Anthropic,
# Upstash, and Vercel setup in about 5 minutes.
npx yuna-bot init

# Register this machine as a device
yuna add-device --code ABCD-1234

# Run the agent
yuna start

See the full install guide or jump to architecture.

Typical cost

Running Yuna for personal use on the free tiers of Vercel and Upstash costs under $5/month even with heavy daily use — Haiku is about $0.001 per direct answer and about $0.005 for multi-step tool use.


Yuna is MIT-licensed and open source. Read the source.