Agents · ByteDance Seed 2.1 Turbo · OpenRouter · CPU/API
published by @dh7 on
m64 m64_0d864b72c74fHermes Agent on ByteDance Seed 2.1 Turbo (OpenRouter). Hermes Agent v2026.9.21 (NousResearch), driven through its one-shot CLI (hermes -z), with ByteDance Seed 2.1 Turbo through OpenRouter ($0.50/$2.50 per M tokens, 262K context, tools + vision). Each session gets an empty directory; the agent can write and run code there. Replies are the final text only (no per-tool trace). No GPU. It needs openrouter.ai:443, so it runs with --allow-external-network (public internet, never your LAN; every connection is logged by m64 net); the m64 gate adds the OpenRouter key, so the agent never holds it.
Lineage
- parent
- none declared
- derived from
- no published capsule shares half its files
- children
- none
Files
8 files- human/
- index.html10.3 KB
- agent_gateway.py12.9 KB
- AGENT.md6.5 KB
- capsule.toml1.5 KB
- cli_shim.py17.3 KB
- Dockerfile2.2 KB
- llm_relay.py4.8 KB
- start.shexec1.7 KB
AGENT.md
Hermes Agent (ByteDance Seed 2.1 Turbo via OpenRouter)
This service is a coding agent you drive over HTTP. You open a session, send it a task in
plain English, and it does the work: it writes files, runs shell commands and reads the
results until it is done. Then it replies. The harness is Hermes Agent v2026.9.21
(NousResearch), run through its one-shot CLI (hermes -z), once per message. The model is ByteDance Seed 2.1 Turbo, called
through OpenRouter.
Each session works in its own empty directory, and you can list, download and upload its
files. The agent runs in a sandbox, as a non-root user. It needs openrouter.ai:443, so it
runs with public-internet access: it can also fetch pages or pip install packages, but it
cannot reach the LAN or the machine it runs on, and every connection it makes is logged
(network in GET /status). Python 3.11, git, ripgrep, jq and a C toolchain are installed.
You cannot choose the model, tools or system prompt. You send only message text and files.
Security note
- The agent cannot read the OpenRouter key, but anyone who can reach this service can spend it. The key never enters the sandbox: the m64 gate adds it to the agent's requests to openrouter.ai, and the agent only sees a placeholder. Every task you send still costs OpenRouter credit on that key, so whoever holds this service's token can spend it. Keep the token private.
- What you give the agent can leave. It can reach the public internet, so treat anything you send or upload as something it could post elsewhere.
- Sessions are not isolated from each other. Every session runs as the same user, in the same container, so an agent in one session can read and change other sessions' files. Use one running service per person or project, not per session.
Base URL: {{BASE_URL}}
Quick start
SID=$(curl -s -X POST {{BASE_URL}}/v1/sessions {{AUTH}} \
-H "Content-Type: application/json" -d '{}' | jq -r .id)
curl -s -X POST {{BASE_URL}}/v1/sessions/$SID/messages {{AUTH}} \
-H "Content-Type: application/json" \
-d '{"text": "write hello.py that prints hi and run it"}' | jq '{text, exit_code, elapsed_s}'
curl -s {{BASE_URL}}/v1/sessions/$SID/files {{AUTH}}
curl -s "{{BASE_URL}}/v1/sessions/$SID/files?path=hello.py" {{AUTH}}
Routes
POST /v1/sessions
Creates a session with a fresh empty directory. The body is optional: {"title": "..."}.
Returns 201 with {"id": "ses_...", "title": ..., "created": <unix time>}.
POST /v1/sessions/{id}/messages
Sends one task or follow-up to the session. The agent remembers earlier messages in the
same session (Hermes's --continue).
text(string, required): what to do.wait(bool, defaulttrue): withtrue, the request blocks until the agent's turn is over. That can take a few seconds or several minutes, so set your client timeout to at least 10 minutes. Withfalse, it returns202at once; follow the turn on the events stream, whoseturn.endevent carries the same fields as the reply below.
Reply (with wait: true):
{"role": "assistant", "text": "I created hello.py and ran it; it prints: hi",
"tools": [], "exit_code": 0, "elapsed_s": 9.8}
text is Hermes's final answer. Hermes's one-shot mode prints only that answer, so tools
is always empty: look at the session's files to see what it did. A non-zero exit_code
means Hermes itself failed (for example, OpenRouter is out of credit); the reply then
carries an error string with the end of Hermes's error output.
A second message to a session whose turn is still running returns 409.
GET /v1/sessions/{id}/events
Server-sent events for this session, one data: JSON line each:
{"type": "turn.start", "text": ...}, then one {"type": "output", "line": ...} per line
Hermes prints (its final answer, as plain text), then {"type": "turn.end", ...} with the same fields as the
wait: true reply. The stream stays open; close it when you are done.
curl -sN {{BASE_URL}}/v1/sessions/$SID/events {{AUTH}}
GET /v1/sessions/{id}/files[?path=...]
With no path, or a directory path, it lists entries:
{"path": ".", "entries": [{"name": "hello.py", "type": "file", "size": 12}]}.
type is file, dir or other (a FIFO, socket or device).
A file path returns the file's bytes as a download (Content-Disposition: attachment).
The agent wrote these bytes, so they are never served as a web page: the type is
text/plain, image/png, image/jpeg, image/gif or image/webp when the extension
says so, and application/octet-stream for everything else (.py, .html, .svg...).
A path that leaves the session directory, contains a NUL byte, or names something other
than a regular file or directory returns 400. A missing path returns 404.
PUT /v1/sessions/{id}/files?path=...
Uploads the raw request body to path in the session directory, creating parent
directories as needed. 400 if path exists and is not a regular file. Returns 201 with
{"written": "data/input.csv", "bytes": 1234}.
curl -s -X PUT "{{BASE_URL}}/v1/sessions/$SID/files?path=data/input.csv" {{AUTH}} \
--data-binary @input.csv
POST /v1/sessions/{id}/abort
Stops the session's running turn (Hermes's process is killed). A messages request waiting on
that turn then returns with a non-zero exit_code.
GET /v1/agent
What this agent is: harness, model and sandbox policy.
GET /status
Start-up progress: phase is building, starting, loading, ready or error.
network summarises the sandbox's outbound connections, and lists blocked attempts.
Timings and concurrency
- First start builds the container image, which takes a few minutes. After that, the service is ready in a few seconds (budgeted at 30 s).
- A small task such as the quick start takes about 10–30 s, and bigger tasks take minutes. Time depends on OpenRouter and on how many steps the agent takes.
- Sessions are independent and can run in parallel. Send one message at a time per session, and wait for the turn to end before you send the next.
- Sessions and their files live only as long as this run of the service. Download what you want to keep.
Errors
401: missing or wrong token. SendAuthorization: Bearer <token>.503withRetry-Afterwhile the service is still starting: wait and retry.404: unknown session id, file not found, or a route this service does not offer.409: the session is still busy with a turn.400: the body is not a JSON object,textis missing, or a path escapes the session.5xxotherwise: retry once, then checkGET /status.
capsule.toml
schema = "m64/capsule@1"description = "Hermes Agent on ByteDance Seed 2.1 Turbo (OpenRouter). Hermes Agent v2026.9.21 (NousResearch), driven through its one-shot CLI (hermes -z), with ByteDance Seed 2.1 Turbo through OpenRouter ($0.50/$2.50 per M tokens, 262K context, tools + vision). Each session gets an empty directory; the agent can write and run code there. Replies are the final text only (no per-tool trace). No GPU. It needs openrouter.ai:443, so it runs with --allow-external-network (public internet, never your LAN; every connection is logged by m64 net); the m64 gate adds the OpenRouter key, so the agent never holds it."kinds = ["agent.session"]authors = ["dh7"]license = "apache-2.0"[hardware]platform = "linux-aarch64"[runtime]sandbox = "container"# No image: the Dockerfile builds on debian:12-slim pinned by digest.gpu = falseinternal_port = 9500health = "/health"expected_load_seconds = 30user = "1000:1000"[network]needs = ["openrouter.ai:443"]why = "the model runs on OpenRouter: your prompts, the files the agent reads and its replies go through openrouter.ai"[secrets]required = ["OPENROUTER_API_KEY"]# The key never enters the container: llm_relay.py calls http://openrouter.ai/api/v1 through# the gate, which adds the header and goes on over TLS. The capsule's env var holds only the# placeholder m64-injected:OPENROUTER_API_KEY.[[secrets.inject]]name = "OPENROUTER_API_KEY"host = "openrouter.ai"header = "Authorization"value = "Bearer {secret}"