hutir.cloud

Platform guide

Updated:

The agent gets this text from the tool platform_guide.

hutir platform guide

Each customer has one VM with Dokku. An app = one Dokku app, URL https://{app}.{clientid}.hutir.app.

Make the app run here

- Listen on 0.0.0.0:$PORT (never localhost, never a fixed port).
- Health check: GET / must answer 2xx or 3xx within 60 s of the start.
- The container filesystem is temporary. Keep data in the database or in a mounted directory (storage_mount).
- Run migrations in the release phase of the Procfile, not at web start:
    release: npm run migrate
    web: npm start
- Session cookies: use the __Host- prefix (Secure, Path=/, no Domain). Other customers live under hutir.app too.
- app_run takes simple commands (npm run migrate, python manage.py migrate, node scripts/seed.js). In a buildpack
  app nested quotes, pipes and globs do not survive the way into the container: commit a script and run it instead.
- Outgoing mail on ports 25, 465 and 587 is blocked. Send mail through an email API (Resend, Postmark, SES...).

Builders

Dockerfile (if the repo has one), otherwise buildpacks for Node, Python, Go, PHP, Ruby, static sites.
deploy(builder=...) forces one: auto, dockerfile, nixpacks, buildpacks.
- Static site: index.html in the repo root and no app manifest (package.json, requirements.txt, Dockerfile...).
  No .static file is needed. nginx serves the files.
- Language version: deploy_status shows it in runtime. Pin it in the repo, or the buildpack takes the newest:
  Python: a .python-version file with one line, for example 3.13. Node.js: "engines": {"node": "22.x"} in package.json.

Limits at the edge

- Per customer: 100 requests a second on average from one visitor address, bursts up to 200. Over it the visitor
  gets 429 with Retry-After. There is no autoscaling: one VM per customer; app_control scale adds processes.
- When the app does not answer (it starts, restarts or is stopped), visitors get 502 or 504.
- These platform errors (429, 502, 504) are JSON ({"error", "status", "message", "retry_after_s"}) unless the client
  asks for text/html. Errors that the app itself returns pass through unchanged, except its own 502 and 504.

Flow

1. create_app(name), then git_credentials(app) -> git_remote (no secret in it) and a push password for this repo
   only, shown once. Keep the password out of URLs and files; give it to git through the environment:
   git remote add hutir <git_remote>   (git remote set-url hutir <git_remote> if the remote exists)
   HUTIR_GIT_PASSWORD=<password> git -c credential.helper= -c 'credential.helper=!f() { echo username=hutir; echo "password=$HUTIR_GIT_PASSWORD"; }; f' push hutir main
   Lost the password: call git_credentials again (the old one stops working).
2. deploy(app) -> deployment_id; deploy_status(deployment_id, wait_seconds=25) until succeeded or failed.
3. On failure read error_summary and hint, fix the code, push, deploy again.
4. Databases: db_create(name, type='postgres', link_to=[app]) sets DATABASE_URL in the app.

Servers (VMs)

A server is a plain Debian 13 VM with root SSH, for what does not fit an app. Each account has a server limit: a new
account starts with 0, the hutir admin raises it on request. Charged daily from the same balance as the plan; a stopped server is charged too (its disk stays).
Creating one needs a balance of at least one month of all your servers plus the new one. In grace and while
suspended you can still stop and delete a server. Sizes, UAH a month:
  vm-1: 1 vCPU, 2 GB RAM, 25 GB disk, 199 UAH
  vm-2: 2 vCPU, 4 GB RAM, 50 GB disk, 349 UAH
  vm-4: 4 vCPU, 8 GB RAM, 100 GB disk, 649 UAH
1. vm_create(name, size, ssh_key): the user's PUBLIC key (the line of ~/.ssh/id_ed25519.pub), never a private key.
2. vm_list until status is running (2-10 minutes). It gives the SSH command: ssh -p <port> root@193.242.161.40
3. vm_control(name, action): start, stop (a clean ACPI shutdown), reboot.
4. vm_delete(name, confirm=name) deletes the server and its disk at once. There are no server backups.
5. SSH is closed to every address until you open it. Ask the user for their public IPv4 address (the dashboard shows
   it on the Servers page), then vm_ssh_allow(name, source, hours): one address or a prefix up to /16, for 1, 8, 24
   or 168 hours, or 0 (no end); at most 20 a server. vm_ssh_deny(name, source) closes it again. vm_list shows
   ssh_allowed. When the time ends, SSH sessions from that address end too.
- No public IP: from outside only SSH through the port. Outgoing traffic leaves through 193.242.161.40 with the
  limits of the apps: no mail ports 25, 465, 587; at most 50 new connections a second; no private networks.

S3 storage (tools s3_info, s3_set)

One bucket for the account (its name = clientid) and one key that reads and writes only that bucket. Sizes, UAH a
month: 1 GB free, 10 GB 19 UAH, 50 GB 59 UAH, 200 GB 149 UAH. Charged daily with
the plan (00:10 Kyiv time). A bigger size also pays the price difference for today at once; a smaller one gives
nothing back for today.
1. s3_set(size_gb) turns the storage on or changes its size; 0 turns it off. A bigger size needs an active account and
   a balance of one month of all servers, addresses and the new size. A smaller size (also in grace) must hold what
   the bucket stores now, unfinished uploads too: else TOO_FULL.
2. s3_info() gives endpoint, region, bucket, access_key and the use. s3_info(secret=true) adds secret_key (full token
   only). Give the keys to the app with env_set; never put them in the code or in a commit.
3. Endpoint https://s3.hutir.cloud, region hutir, path style only: https://s3.hutir.cloud/<bucket>/<object>
   (rclone: provider Other, force_path_style true; boto3: addressing_style "path"). <bucket>.s3... names do not work.
   No versions, no object lock, no bucket policies, no public buckets.
4. One copy on a mirrored RAID, no backups: keep a second copy of important data in another place.
5. Multipart uploads that are not finished in 1 day are removed. A full bucket answers 403 "Bucket size quota is reached".

Public IPv4 of a server (when vm_list shows public_ips; else the tools answer NOT_AVAILABLE)

1. vm_ip_attach(name): the server gets its own address 193.43.211.N (1:1: inbound to it reaches the server, outbound
   leaves with it). 100 UAH a month for each address you hold, charged daily, attached or not; the
   first day at once. At most one address a server, as many addresses as servers you may have.
2. Inbound is closed. vm_port_open(name, proto, port, source): tcp or udp, a port or a range like 8000-8100, from
   0.0.0.0/0 (everyone) or an address or prefix /8 to /32. At most 30 rules a server; rules must not overlap.
   vm_port_close with the same values closes it and ends its open connections. vm_list shows ports_open.
3. vm_ip_detach(name) takes the address off; you keep it and pay for it. To move it: vm_ip_detach on the first
   server, then vm_ip_attach(other server, address). vm_ip_release(address, confirm=address) gives it back: only you
   can take it back in the next 7 days.
4. Deleting a server keeps its address with you (detached). The limits of outgoing traffic stay the same: no mail
   ports, 50 new connections a second. Inbound: at most 50 new connections a second and 2000 open connections a
   server. An address used for abuse is blocked by the admin (vm_list shows why); then no new address is given.
5. A server reaches no other server of the platform, also not your own second server: not by a 193.43.211.x
   address and not by the private 10.31.0.x address. Ping (ICMP echo) to a public address gets no answer.

Agents and long-running bots

For a bot or an AI agent that serves no web pages (Telegram, Discord, Hermes Agent):
- Run it as a worker process, not web. A web process that listens on nothing deploys, but its URL answers 502.
  Procfile in the repo root:
    worker: python bot.py
  Only web starts by itself. Before the first deploy:
  app_control(app, action="scale", processes={"web": 0, "worker": 1}).
- Memory: memory_mb=1024 or more for an AI agent (create_app, or app_control action="scale"). 256 MB is too small,
  and the Start plan (512 MB for all apps) cannot hold one.
- One copy: storage_mount turns single_instance on; app_control(app, action="single_instance") does it without a
  mount. A deploy or restart then stops the old copy first: 10-15 s down, but no second copy on the same data
  directory or bot token. A release that fails to start is not caught: read app_logs after each deploy.
  app_run is not covered: it starts one more container with the same mounts and variables. Never start the bot
  itself with app_run: app_run(command="worker") runs the Procfile worker and starts a second gateway.
- Data: storage_mount(app, path=<data directory>), for example /opt/data for Hermes Agent.
- Secrets: env_set(app, set={...}, restart=false) for each change, then one app_control(app, action="restart").
- Logs: app_logs(app, process="worker").
- app_run in a Dockerfile app has no shell: the words go to the program as they are ($VAR stays text). Use
  app_run(command="sh -c '...'") for variables or pipes. Dokku takes --app, --trace, --quiet, --force and --label
  for itself, so app_run refuses them: put such a command in a script.
Template for Hermes Agent as a Telegram bot (hutir repo, hosting/templates/hermes): put these three files in the
root of the repo. Set OPENAI_API_KEY, TELEGRAM_BOT_TOKEN and TELEGRAM_ALLOWED_USERS with env_set. HERMES_PROVIDER
(default openai-api), HERMES_MODEL (default gpt-5.4-mini) and HERMES_BASE_URL are optional.
Dockerfile:
    FROM nousresearch/hermes-agent:v0.23.1
    COPY start.sh /usr/local/bin/hutir-start
    RUN chmod 755 /usr/local/bin/hutir-start
    CMD ["/usr/local/bin/hutir-start"]
start.sh:
    #!/bin/sh
    # hutir template: apply the model from env on every start. config.yaml on the volume beats env otherwise.
    set -e
    hermes config set model.provider "${HERMES_PROVIDER:-openai-api}"
    hermes config set model.default "${HERMES_MODEL:-gpt-5.4-mini}"
    if [ -n "$HERMES_BASE_URL" ]; then hermes config set model.base_url "$HERMES_BASE_URL"; else hermes config unset model.base_url || true; fi
    exec hermes gateway run
Procfile:
    worker: /usr/local/bin/hutir-start

Variables set by the platform

PORT, DATABASE_URL, REDIS_URL, APP_URL. env_set cannot change them.

Reply to the user in their language. Never put the hutir token in the code or in a commit.

For agents: all of this text as markdown is at /llms-full.txt, a short version at /llms.txt; the MCP server card is at https://mcp.hutir.dev/mcp/server-card. A page for agents and their users: /ai-agents.