
Deploy Hermes Agent Gemini
Run Hermes Agent on Google Gemini models with your API key
hermes-agent
Just deployed
/opt/data
Deploy and Host self hosted Hermes Agent Gemini (Gemini Models for Self-Hosted Agents) on Railway
This template deploys Hermes Agent as one Railway service that talks to Google Gemini through your own GOOGLE_API_KEY.
About Hosting Hermes Agent Gemini open-source software on Railway (self hosted Hosted Hermes Agent running on Google Gemini models template)
This template runs one Railway service built from the pinned nousresearch/hermes-agent:v0.22.0 image on port 8642, with a persistent volume at /opt/data holding your agent's memory, skills, and config.
Why Deploy Hermes Agent Gemini, the Gemini app alternative on Railway (Railway Free Trial)
The Gemini app keeps your chats and scheduled tasks inside Google's product and gives you little say over which model handles each job.
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Hermes Agent Gemini on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Railway vs Other Hosting Providers and VPS for Hermes Agent Gemini self hosting
Hermes Agent Gemini runs as one Railway service with a persistent volume, so the trade-off against a VPS is how much server work you want to do yourself.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | One deploy, a volume at /opt/data, and GOOGLE_API_KEY set as a service variable with no SSH work. | Full root access and a Droplet you size yourself for custom firewall rules. |
| AWS | The pinned Hermes image running with no VPC or IAM setup before the first Gemini call. | Deep integration with other AWS services for teams already on AWS. |
| Hetzner | Restarts and deploys from the dashboard, with no OS patching on a small plan. | Low-cost servers with generous bandwidth if you run hermes gateway under systemd yourself. |
Common Use Cases for hosted Hermes Agent Gemini
- Internal team endpoint: Point your team's chat client at HERMES_API_URL so everyone reaches one Gemini-backed agent. You control the key and can rotate API_SERVER_KEY without touching anyone's laptop.
- Per-session model switching: Move between Gemini models with /model when a task needs more reasoning or a faster reply. Run hermes model once first, since /model only lists providers you have already configured.
- Cheap models for background work: Route compression and title tasks to a lighter Gemini model with auxiliary.*.provider in config.yaml. These jobs run constantly and don't need your strongest model, so this keeps spend down.
- OpenClaw migration: Bring an existing OpenClaw agent across with hermes import-agent openclaw and keep your Gemini key and model settings. You skip rebuilding its configuration by hand.
- Keys on your own service: Store GOOGLE_API_KEY as a Railway variable instead of pasting it into a consumer chat app. Usage stays under your account, and you can see exactly which service is making the calls.
Dependencies for Hermes Agent Gemini Docker hosted on Railway
This section covers what the single Hermes service needs before it answers its first prompt. The template will not supply a Gemini key, so you add GOOGLE_API_KEY yourself.
Deployment Dependencies for Managed Hermes Agent Gemini Service (AI Agent)
You need a Railway account, a Google Gemini API key from Google AI Studio or a billing-enabled Google Cloud project, and a domain for the API endpoint.
Implementation Details for Hermes Agent Gemini (Using Hermes Agent official docker image)
The service runs nousresearch/hermes-agent:v0.22.0, pinned by sha256, on port 8642 with the health check at /health. Set GOOGLE_API_KEY in the service Variables.
How does Hermes Agent Gemini compare against other ways to run Gemini models behind a self-hosted agent
Hermes Agent Gemini vs Gemini app (Gemini App Alternative)
- Where Hermes wins: You own the agent. Memory, skills, and cron jobs live on your Railway volume at /opt/data.
- Where the Gemini app wins: Setup takes seconds. Sign in with a Google account and start chatting.
- Gotcha: A consumer Google AI Pro or Ultra subscription does not carry over to Hermes. The gemini provider takes an API key only.
Hermes Agent Gemini vs OpenClaw (Self-Hosted Agent Alternative)
- Where Hermes wins: A learning loop, messaging gateways for Telegram, Discord, Slack, WhatsApp, and Signal, and provider settings under model: in config.yaml.
- Where OpenClaw wins: Scheduling is its core design, so it's the more familiar choice if your automations already run there.
- Migration path: Move an existing OpenClaw agent into Hermes with hermes import-agent openclaw.
Hermes Agent Gemini vs Gemini CLI (Command-Line Gemini Alternative)
- Where Hermes wins: It runs unattended as a service with cron and subagents, so it works while you're away from the terminal.
- Where Gemini CLI wins: It's one command for one-off questions, with nothing to deploy or keep running.
- Cost lever: Hermes can route cheap Gemini models to auxiliary compression and title tasks, which the CLI doesn't offer.
Hermes Agent Gemini vs OpenRouter (Multi-Model Gateway Alternative)
- Where Hermes wins: Hermes is the agent layer itself. OpenRouter only routes requests, so you still need something to hold memory, tools, and schedules.
- Where OpenRouter wins: One API key reaches many providers, which is simpler if you only want model access.
- Fallback reality: The upstream docs don't document Gemini-specific fallback chains, so don't assume Hermes fails over on its own. OpenRouter handles routing at the gateway.
How to use Hermes Agent Gemini (the OSS AI agent)?
- Deploy the Hermes Agent Railway template (nousresearch/hermes-agent:v0.22.0, port 8642, volume at /opt/data).
- In Railway, open the Hermes service Variables and add GOOGLE_API_KEY, since the template does not list a Gemini key.
- Set the endpoint to https://your-domain/v1 using HERMES_API_URL and the generated API_SERVER_KEY.
- For a local install, put GOOGLE_API_KEY in ~/.hermes/.env.
- Run hermes model once to open the provider setup wizard and add Gemini.
- Select the model with
hermes chat --provider gemini --model MODEL_ID, or set it in config.yaml as shown below. - Switch models mid-session with /model.
- Optionally point auxiliary tasks at a cheaper model.
model:
provider: "gemini"
default: "your-model-id"
auxiliary:
compression:
provider: "gemini"
export GOOGLE_API_KEY="your-key"
hermes model
hermes chat --provider gemini --model your-model-id
How to self host Hermes Agent Gemini on other VPS Services (Hermes Agent self hosting guide)
Hermes Agent runs fine on any Linux VPS if you want to skip Railway. The steps below assume a fresh Ubuntu box with Python 3.11 or newer.
Clone the Repository
SSH into your server, then pull the source:
git clone https://github.com/NousResearch/hermes-agent.git
cd hermes-agent
Install Dependencies
Run the install script, which handles Python packages and the hermes command:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
Configure Environment Variables
Put your Gemini key in ~/.hermes/.env, then point the model at the gemini provider in config.yaml:
echo 'GOOGLE_API_KEY=your-google-api-key' >> ~/.hermes/.env
model:
provider: "gemini"
default: "your-model-id"
Start the Hermes Agent Gemini Application
Run the gateway in the foreground to test, or install it as a service so it survives reboots:
hermes gateway
hermes gateway start
Railway handles the server, the persistent volume, and the HTTPS endpoint for you, which is the part you otherwise maintain yourself.
Official Pricing of Hermes Agent Gemini (Hermes Agent pricing)
Hermes Agent is free and open source under the MIT license, so there is no license fee to pay.
Hermes Agent Gemini cloud vs self hosted comparison (Pricing, features, costs, and more)
Self hosting Hermes Agent Gemini means paying for two things: the Railway service that keeps the agent online, and the Gemini API usage behind each request.
Monthly cost of self hosting Hermes Agent Gemini on Railway
Railway typically runs this single service at about $5 to $10 per month at 512 MB to 1 GB of memory, plus your Gemini API charges, which depend on how many tokens you send.
System Requirements for Hosting Hermes Agent Gemini on a VPS
A VPS needs enough memory to run the Hermes gateway comfortably, so plan for at least 1 GB, plus a persistent volume mounted at /opt/data so config and memory survive restarts.
Frequently Asked Questions (FAQs)
Do I need a Google AI Pro or Ultra subscription to use Gemini in Hermes?
No. The docs don't document a Hermes path for AI Pro or Ultra plans.
Why does the gemini provider fail with my key?
The most common cause is a free-tier Google key running out of quota, which the docs warn can happen quickly.
Can I use Vertex AI instead of GOOGLE_API_KEY?
Yes, but it's a separate path.
Does Hermes support Gemini fallback models?
The fetched upstream docs don't show a Gemini fallback chain or a fallback config key, so I wouldn't count on one.
How do I keep Gemini costs down with auxiliary tasks?
Auxiliary tasks like compression, titles, and vision default to your main chat model.
Why is LLM_MODEL being ignored?
LLM_MODEL was removed from .env, so it does nothing. Set the model under model: in config.yaml, using provider: "gemini" and default: "MODEL_ID".
Template Content
hermes-agent
nousresearch/hermes-agent:v0.22.0
