Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
PLAYBOOK · 2026 EDITION

Hermes Agent + DeepSeek API from Russia: a Step-by-Step Setup (2026)

DeepSeek serves Russian users directly, and Hermes Agent is open-source software you host yourself. In about 45 minutes you get a Telegram agent with scheduled reports for roughly 170–1,330 ₽ a month in API fees.

Intermediate6 min readSetup time: 45 minUpdated: Author: Zhemal Khamidun
Key takeaways
  • For Russia the dependable stack is Hermes Agent (MIT, self-hosted) plus the DeepSeek API, which does not geo-block Russian users.
  • Use deepseek-flash for routine work and deepseek-v4-pro for heavy reasoning; model names from older tutorials now return HTTP 400.
  • One Docker container on a 1–2 GB VPS runs the Telegram gateway and cron; only IDs listed in TELEGRAM_ALLOWED_USERS get answers.
  • 300 calls a day cost about 1,329 ₽ a month at peak prices and 664 ₽ off-peak. Never give terminal to a shared bot.
Step-by-step plan
  1. Prepare a VPSLinux with 1–2 GB RAM, Docker with the Compose plugin and SSH access.
  2. Test a DeepSeek keyTop up, create a key and call deepseek-flash with curl.
  3. Write .env and config.yamlKeys and the allowlist go to .env; provider, model, timezone and Telegram toolsets go to config.yaml.
  4. Start HermesRun nousresearch/hermes-agent:v0.23.1 with Docker Compose, then check hermes doctor and hermes status.
  5. Connect TelegramMessage the bot from an allowlisted account and send /sethome.
  6. Schedule a jobUse hermes cron create with --deliver telegram and --timezone Europe/Moscow.
  7. Harden and back upRestrict tools, chmod 600 the .env file and run hermes backup before upgrades.

Why Hermes Agent and DeepSeek

Anthropic, OpenAI and Google do not support Russia as a region and require foreign billing. This guide skips workarounds and uses two components that work from Russia as they are.

  • DeepSeek API — no geo-block for Russian users, OpenAI-compatible format, 1M-token context; deepseek-flash for routine work, deepseek-v4-pro for heavy reasoning.
  • Hermes Agent by Nous Research — MIT-licensed and self-hosted: a persona in SOUL.md, skills, memory, a Telegram gateway and cron in one process, with DeepSeek as a built-in provider.
  • Data on your server — sessions, memory and keys stay in ~/.hermes; the model API sees only the prompt.

Provider settings match DeepSeek's own Hermes integration page; Hermes is pinned to v0.23.1.

Architecture: one container, outbound traffic only

The gateway fetches Telegram updates by long polling, so the server opens no inbound ports and needs no domain or TLS certificate.

  • Gateway — takes messages from allowlisted users, sends replies and cron results.
  • Agent — the loop with persona, skills, memory and per-platform tools.
  • DeepSeek API — the only model provider, https://api.deepseek.com/v1.
  • Cron — lives inside the gateway and checks jobs every 60 seconds; each job runs without chat history.
Allowlisted users talk to the Hermes gateway in Telegram, the agent calls the DeepSeek API, and cron jobs start agent runs whose results return to Telegram.Telegramyou + allowlisted usersHermes gatewayDocker, long pollingHermes agentSOUL.md · skills · memoryDeepSeek APIdeepseek-flash / v4-proCron schedulerhermes cron → Telegram
Allowlisted users talk to the Hermes gateway in Telegram, the agent calls the DeepSeek API, and cron jobs start agent runs whose results return to Telegram.

What you need

  • A Linux VPS with Docker and the Compose plugin: 1 GB RAM and one core minimum, 2–4 GB and two cores recommended. No GPU — the model runs at DeepSeek.
  • A DeepSeek platform account with a positive balance.
  • A bot token from @BotFather and your numeric user ID from @userinfobot (123456789, not a username).
  • SSH access: browser consoles can corrupt :, @ and = in pasted keys.

Step 1. Get a DeepSeek API key and test it

Sign up, top up and create a key under API Keys. The DeepSeek FAQ lists PayPal, bank card, Alipay and WeChat Pay; the balance does not expire. Check which method your bank supports first.

Check the key and the model
export DEEPSEEK_API_KEY='<DEEPSEEK_API_KEY>'

# 1. The key works; the list shows the current models
curl -s https://api.deepseek.com/models \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY"

# 2. One cheap request to deepseek-flash with thinking off
curl -s https://api.deepseek.com/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
  -d '{"model": "deepseek-flash", "messages": [{"role": "user", "content": "Reply with one word: ok"}], "thinking": {"type": "disabled"}, "max_tokens": 20}'

The first call should list deepseek-flash and deepseek-v4-pro; the second returns usage with prompt_cache_hit_tokens and prompt_cache_miss_tokens, the fields behind your bill. HTTP 401 means a wrong key, 402 an empty balance.

Step 2. Run Hermes in Docker

This is the gateway service from the official docker-compose.yml, with the published image pinned instead of a local build.

~/hermes/docker-compose.yml
services:
  gateway:
    image: nousresearch/hermes-agent:v0.23.1
    container_name: hermes
    restart: unless-stopped
    network_mode: host
    volumes:
      - ~/.hermes:/opt/data
    environment:
      - HERMES_UID=${HERMES_UID:-10000}
      - HERMES_GID=${HERMES_GID:-10000}
    command: ["gateway", "run"]

Create both files in ~/.hermes before the first start: the container writes defaults only where a file is missing.

~/.hermes/.env
# Secrets only. Never commit this file.
DEEPSEEK_API_KEY=<DEEPSEEK_API_KEY>
TELEGRAM_BOT_TOKEN=<TELEGRAM_BOT_TOKEN>
# Numeric IDs, comma-separated. Empty list = everyone is denied
TELEGRAM_ALLOWED_USERS=<YOUR_TELEGRAM_ID>,<TEAMMATE_TELEGRAM_ID>
# Optional: chat for cron results (or send /sethome in that chat)
# TELEGRAM_HOME_CHANNEL=<CHAT_ID>
~/.hermes/config.yaml
model:
  provider: deepseek
  default: deepseek-flash

# Cron schedules and the agent clock use this zone
timezone: "Europe/Moscow"

# Tools the Telegram bot may use. No terminal here
platform_toolsets:
  telegram: [web, memory, skills, todo, session_search]
Start and check
cd ~/hermes
chmod 600 ~/.hermes/.env
HERMES_UID=$(id -u) HERMES_GID=$(id -g) docker compose up -d

# Config and DeepSeek connectivity; exit code 1 on failure
docker exec hermes hermes doctor
# Model, provider, gateway state, platforms, scheduled jobs
docker exec hermes hermes status
docker compose logs -f gateway

hermes doctor must pass its API Connectivity check. Prefer a wizard? docker run -it --rm -v ~/.hermes:/opt/data nousresearch/hermes-agent:v0.23.1 setup writes the same files.

Step 3. Connect Telegram with an allowlist

  1. Create a bot with @BotFather (/newbot); the token goes to TELEGRAM_BOT_TOKEN.
  2. Add numeric IDs from @userinfobot to TELEGRAM_ALLOWED_USERS.
  3. Run docker compose restart and message the bot.
  4. Send /sethome in the chat for cron reports; /model and /usage work there too.

Everyone else is denied. A stranger can at most get a one-time pairing code, which does nothing until you run hermes pairing approve telegram <PAIRING_CODE>.

No terminal in chat

Never add terminal to platform_toolsets.telegram on a shared bot: every allowlisted user, or whoever hijacks their account, would get a shell on your server.

Step 4. Scheduled reports in Telegram

Jobs run inside the gateway and start without chat history, so the prompt must name sources, format and length.

A weekday digest at 08:00 Moscow time
docker exec hermes hermes cron create "0 8 * * 1-5" \
  "Find the 5 most important AI news stories of the last 24 hours. For each: a 2-sentence summary in Russian and the source link. Under 300 words." \
  --name "Morning AI digest" \
  --deliver telegram \
  --timezone Europe/Moscow

docker exec hermes hermes cron list

08:00 MSK falls between DeepSeek's two weekday peak windows, so this job runs at half price. Useful flags: --model deepseek-v4-pro for deep reasoning, --skill, and --script for data collection. A run that answers [SILENT] delivers nothing — handy for change monitors.

What it costs in rubles

Peak prices per million tokens: deepseek-flash $0.30 uncached input, $0.006 cached input, $1.20 output; deepseek-v4-pro $1.32, $0.044, $3.96. Off-peak is half price. Peak runs 04:00–07:00 and 09:00–13:00 Moscow time (01:00–04:00 and 06:00–10:00 UTC) on weekdays; weekends are off-peak.

Assumptions: 30 days, 82.31 ₽ per dollar (CBR); an agent re-sends instructions and history, so most input hits the automatic cache (best-effort). Light: 50 calls a day, 8,000 input tokens (70% cached), 500 output. Medium: 300 calls, 12,000 (75%), 700. Heavy: 1,500 calls, 20,000 (80%), 1,000.

Scenario, per monthPeak pricesOff-peak prices
Light, deepseek-flash$2.03 ≈ 167 ₽$1.02 ≈ 84 ₽
Medium, deepseek-flash$16.15 ≈ 1,329 ₽$8.07 ≈ 664 ₽
Heavy, deepseek-flash$112.32 ≈ 9,245 ₽$56.16 ≈ 4,623 ₽
Medium, deepseek-v4-pro$64.15 ≈ 5,280 ₽$32.08 ≈ 2,640 ₽

Real bills land between the columns: with calls spread evenly, 35 of 168 weekly hours are peak, so you pay about 60% of the peak column. The VPS is extra. Try your own volumes in the LLM cost calculator.

Step 5. Security hardening

  • Allowlist only — never set GATEWAY_ALLOW_ALL_USERS=true.
  • Minimal tools per platform in platform_toolsets.
  • Secrets only in ~/.hermes/.env with chmod 600 — not in config.yaml, prompts or git.
  • No open ports — keep the gateway API server and the dashboard off, or use an SSH tunnel.
  • A small prepaid balance — a runaway loop stops at HTTP 402 instead of draining a large deposit.
  • Deliberate upgrades — back up, change the pinned tag, read the release notes, recreate.
Emergency stop, backup, upgrade
# Emergency stop: no new cron runs or bot turns
docker exec hermes hermes pause --reason "incident"
docker exec hermes hermes resume

# Before an upgrade: back up, change the tag, recreate
docker exec hermes hermes backup
docker compose pull && docker compose up -d

hermes pause lets running turns finish and starts nothing new until hermes resume. For approval gates and staged rollout, see the production agent workflows guide.

Common gotchas and fixes

SymptomCauseFix
HTTP 400 after copying a config from an older tutorial.Older model names were retired on 2026-07-24; only deepseek-flash and deepseek-v4-pro remain.Set default: deepseek-flash; GET https://api.deepseek.com/models shows the current list.
The bot ignores you.Your numeric ID is missing from TELEGRAM_ALLOWED_USERS; without an allowlist everyone is denied.Add the ID from @userinfobot to ~/.hermes/.env, then run docker compose restart.
Replies stop and the logs show HTTP 402.The prepaid DeepSeek balance is empty.Top up on platform.deepseek.com; the key and the config stay as they are.
A cron job never fires.Jobs are fired by the running gateway's 60-second ticker; a stopped container runs nothing.Check docker ps and docker exec hermes hermes cron status; keep restart: unless-stopped.
Reports arrive three hours off.Without timezone Hermes uses server time, usually UTC on a VPS.Set timezone: "Europe/Moscow" or pass --timezone Europe/Moscow to the job.
New defaults from an upgraded image never appear.The container seeds .env, config.yaml and SOUL.md only when they are missing; your files win.Edit the files in ~/.hermes on the host and run docker compose restart.

Frequently asked questions

Does DeepSeek work from Russia without workarounds?

Yes: DeepSeek does not geo-block Russian users. Check payment first — the FAQ lists PayPal, bank cards, Alipay and WeChat Pay.

Can I use Claude or GPT in Hermes instead?

Hermes supports them, but Anthropic, OpenAI and Google do not support Russia as a region and require foreign billing. This guide covers only DeepSeek.

Which model should be the default?

deepseek-flash. Switch to deepseek-v4-pro with /model or --model for deep reasoning; at the same volume it costs about four times more.

Can a team share one bot?

Yes: list every member's ID in TELEGRAM_ALLOWED_USERS and keep the toolset minimal, because every allowlisted user can use every enabled tool.

Free · Daily AI brief

The AI brief engineers actually read

The day’s most important AI stories — models, tools, prices and agents — in five minutes. Free, unsubscribe in one click.

Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — Hermes Agent + DeepSeek API in Russia: Setup Guide 2026 — Hamidun News https://news.hamidun.com/en/guides/hermes-deepseek-russia-2026