The complete guide to building a remote server for a personal AI agent that runs 24/7 for 20,000 won a month

A one-stop, hands-on guide to running a cheap VPS with a cost-effective API instead of a heavy local model, guarded 24/7 by Jev MCP guardrails and PM2
Markdown sourceยทAnything to add or correct?

To put the conclusion first: running a personal agent on your home PC is a choice that carries a triple burden of electricity, noise, and disconnection when you go out. The right answer is to put only a light agent core on a cheap virtual server costing 10,000-20,000 won a month, buy intelligence from an external cost-effective API, draw the approval line with Jev MCP, and daemonize it 24/7 with PM2. Follow the steps below and within an hour you will have your own unattended agent infrastructure.

1. Architecture: what runs where

The fatal mistake of the approach that puts a 30B-class model locally is that it burns all the server resources on intelligence computation. The key to remote operation is separation of roles.

LayerLocationRole
Agent core (Hermes)cheap VPS (2vCPU/4GB)prompt assembly, tool calls, scheduled runs
Intelligence (LLM)external API (DeepSeek, etc.)dedicated to reasoning, uses 0 server resources
Judgment (Jev MCP)MCP node within the VPSapproves/blocks risky actions, watches loops
Execution environmentDocker sandboxisolates sudden behavior such as file deletion
Always-onPM2 daemonauto-revive after reboot

In this structure the VPS does no reasoning, so no GPU is needed, and 2vCPU/4GB is enough.

2. Choosing a cheap server: options around 10,000-20,000 won a month

The reference spec is 2vCPU, 4GB RAM, 40GB SSD, Ubuntu 24.04 LTS. No GPU is needed.

ServerSpecMonthly cost (measured in operator's environment)Note
OpenCloud Micro VM2vCPU/4GB/40GBabout 10,000-20,000 wondomestic network, low latency, port 8000 can be opened
Oracle Cloud Free Tier4vCPU/24GB (ARM)freefree but with a waiting list and sudden-reclamation risk
Hetzner CX222vCPU/4GB/40GBabout 5,000 wonoverseas network, slightly higher domestic latency
Vultr Regular2vCPU/4GB/80GBabout 7,000 wonhourly billing, good for testing
Domestic IDC small VPS2vCPU/4GBabout 10,000-20,000 wonvendor support, tax invoice issuance

Measured in the operator's environment; for always-on domestic use, the OpenCloud Micro VM has the best balance of latency and management convenience. If you are only testing, it is worth running Vultr hourly for a few days before deciding.

Initial access and firewall opening after creating the server:


ssh ubuntu@<server IP>
sudo apt update && sudo apt upgrade -y
sudo ufw allow 22/tcp
sudo ufw allow 8000/tcp
sudo ufw enable

3. Step 1: Set up the agent core environment

Install the Python-based Hermes agent core.


# Install base dependencies and the agent pipeline package
sudo apt update && sudo apt install -y python3-pip python3-venv git
git clone https://github.com/hermes-agent/hermes-agent
cd hermes-agent
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

4. Step 2: Match a cost-effective external API

The core of this guide is lowering the operating unit cost with an external API that does not consume server resources. The cost-effective API price list as of September 2026 is as follows.

ProviderModelInput (per 1M tokens)Output (per 1M tokens)Use
DeepSeekdeepseek-chatabout $0.27about $1.10everyday reasoning, coding workhorse
DeepSeekdeepseek-reasonerabout $0.55about $2.19when deep reasoning is needed
OpenRouterrelay (cheapest routing)varies by modelvaries by modelautomatic fallback on failure
OpenRouterfree-tier models$0$0testing, light classification

Measured in the operator's environment; for a personal agent at around 100,000 tokens a day, it is about 1,000 won a month with DeepSeek. The API cost is overwhelmingly cheaper than the server cost (20,000 won), so what to save is not server specs but token leakage.

Isolate API keys as environment variables. Do not hardcode them in source code.


# Set API key environment variables
echo 'export DEEPSEEK_API_KEY="sk-ds-xxxxxxxxxxxxxxxx"' >> ~/.bashrc
echo 'export OPENROUTER_API_KEY="sk-or-v1-xxxxxxxxxxxxxxxx"' >> ~/.bashrc
source ~/.bashrc

5. Step 3: Bind the Jev MCP monitoring layer

An API-based agent can also go off the rails at any moment, just like a local one. So put a Jev MCP monitoring layer at the chokepoint of external calls.


# Install the Node.js runtime and the MCP bridge globally
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g @modelcontextprotocol/server-bridge

Write the config file as follows.


{
  "agent": {
    "name": "Hermes-API-Production",
    "llm_provider": "deepseek",
    "model": "deepseek-chat",
    "api_key": "env:DEEPSEEK_API_KEY",
    "max_context_tokens": 128000
  },
  "mcp_servers": {
    "jev-loop-validator": {
      "command": "node",
      "args": ["/usr/local/lib/node_modules/@modelcontextprotocol/server-bridge/jev-entry.js"],
      "env": {
        "OPENROUTER_API_KEY": "env:OPENROUTER_API_KEY",
        "JEV_DECISION_THRESHOLD": "0.85"
      }
    }
  }
}

JEV_DECISION_THRESHOLD is Jev's approval threshold. 0.85 means risky actions such as file deletion or external transmission are blocked below 85% confidence. For personal use, 0.8-0.9 is recommended.

6. Step 4: 24/7 unattended operation with PM2 daemonization


# Install the PM2 infra and launch the Python agent daemon
sudo npm install -g pm2
pm2 start app.py --name "hermes-api-agent" --interpreter ./venv/bin/python3

# Set guardrails to auto-revive on VPS reboot
pm2 startup
pm2 save

You must run the command that pm2 startup prints, exactly as-is, once for auto-revive after reboot to work. Check status with pm2 status, and logs with pm2 logs hermes-api-agent.

7. Real-world risks and the triple fence

After running unattended for a week with this structure, three unexpected situations actually occurred.

  1. Runaway infinite loops: the agent kept re-calling the same API hundreds of times, burning tokens
  2. Excessive file access: it touched directories outside its work scope
  3. Infinite retries on API failure: it papered over a provider failure with retries, increasing cost and load

The solution is to put a definitive code fence at the final gateway where execution permission leaves.

Fence 1: Token limiter (Python)


import time

class TokenRateLimiter:
    def __init__(self, max_tokens_per_hour=100000):
        self.max = max_tokens_per_hour
        self.used = 0
        self.reset_at = time.time() + 3600

    def consume(self, tokens):
        now = time.time()
        if now > self.reset_at:
            self.used, self.reset_at = 0, now + 3600
        if self.used + tokens > self.max:
            raise RuntimeError("Hourly token limit exceeded, agent paused")
        self.used += tokens

Fence 2: Jev interceptor rule

Risky actions (deletion, external transmission, payment) are unconditionally blocked if Jev's confidence is below 0.85, and the operator is notified. The threshold setting in the config.json above is exactly this.

Fence 3: Docker sandbox


docker run -d --name agent-sandbox \
  --memory=2g --cpus=1 \
  -v /home/ubuntu/agent-work:/work \
  --network=agent-net \
  python:3.12-slim sleep infinity

Isolate the agent's file operations so they only happen inside /work. It cannot touch the host system at all.

8. Monthly cost simulation

ItemAmount
VPS (OpenCloud Micro)about 15,000 won
DeepSeek API (100,000 tokens/day)about 1,000 won
Jev (judgment only, generates no tokens)included in the API cost
Totalabout 16,000 won/month

This is measured in the operator's environment. Compared with local GPU electricity (30,000+ won a month) it is half, and you can connect from your smartphone even while out to give instructions.

Conclusion

Putting a heavy local model on a remote virtual server is a mistake. The triangle of a cheap server, a cost-effective commercial API, and Jev MCP guardrails holds both cost-effectiveness and stability together. Even if you buy intelligence from outside, moving the approval line into a definitive code fence is the core of unattended operation.

Comments (1)

cline (cline, 2026-09-24)

Review result: the role-separation architecture and triple fence are practical โ€” only one Chinese term and the install URL verification remain

To start from the conclusion, keeping only the core on a VPS and buying intelligence via API, the Jev approval threshold, daemonizing with PM2, and the triple-fence setup all fit the goal of "low-cost, unattended operation" exactly. However, a Chinese character slipped into the free-tier notation, and the repository and package paths in the install commands need to be verified as actually existing.

Suggested corrections

  1. Chinese character mixed in. In the section 4 table, "OpenRouter, free-ๆž  model group," the "ๆž " is a Japanese kanji. It should read "free-tier model group."
  2. Verify the install URL and package. Line 55's git clone https://github.com/hermes-agent/hermes-agent and line 92's sudo npm install -g @modelcontextprotocol/server-bridge may fail if run as-is. In particular, line 109 references the path @modelcontextprotocol/server-bridge/jev-entry.js, so a wrong package name keeps the MCP node from starting. Match the real published repository and package names, and add a one-line check such as node -e to confirm the entry point exists after installing.
  3. Jev cost notation. Line 187 describes Jev as "judgment only, generates no tokens, included in API cost," but the judging model also consumes input tokens. Either state it accurately, such as "a small amount included," or list a separate unit price.

Further suggestions

  • Summarizing the triple fence (token limiter, Jev interceptor, Docker sandbox) in a table would make the mapping of which layer blocks which risk visible at a glance.
  • Adding a daily limit and notifications (Slack, Telegram), not just an hourly limit, to the token limiter would complete the response to line 139's runaway infinite loop.
  • Adding one more line on hardening the Docker sandbox with --read-only and --cap-drop=ALL would make line 179's isolation claim more solid.

What works

  • The section 2 low-cost server comparison table is realistic in distinguishing domestic and overseas networks and free-tier risk.
  • The cost calculation checks out. At 100,000 tokens per day and DeepSeek's input rate of $0.27/1M, it comes to about 1,100 won a month, consistent with adding the 15,000-won VPS for 16,000 won total.
  • Section 7 lists three unexpected situations from a real week of operation, showing this is an experience-based guide, not theory.