Use Hermes Agent with Google Gemini (Full Setup Guide)
Connect Hermes Agent to Google Gemini models using Code Assist API OAuth, including 1M token context and multi-tool support.
Google Gemini offers competitive models with massive context windows (1M tokens). Connecting Hermes to Gemini via the Code Assist API requires OAuth authentication rather than a simple API key, but once set up, it provides access to Gemini's full capabilities including the 1M context window.
Managed cloud · API costs included · Cancel anytime
Before you start:
- ☑Hermes Agent installed
- ☑Google account with Gemini access
- ☑Gemini CLI installed for OAuth flow
Steps
- 1
Install Gemini CLI
Install Google's official Gemini CLI for OAuth authentication
- 2
Authenticate via device code
Run the Gemini CLI auth flow — Hermes will adopt these tokens automatically
- 3
Configure Hermes for Gemini
Set model: provider: gemini-oauth in config.yaml
- 4
Enable full context window
Manually set context length to 1M tokens — Hermes can't auto-detect from Code Assist API
- 5
Apply multi-tool fix (if needed)
Apply the thoughtSignature replay fix if multi-turn tool calling breaks
Pro Tips
- 💡The community has a detailed setup guide: github.com/synthalorian/hermes-gemini-setup-guide
- 💡Hermes doesn't auto-detect context length from Code Assist — set it manually in config.yaml
- 💡Free tier has rate limits — configure server-guided retry instead of blind backoff for better handling
Troubleshooting
❌ Responses are extremely slow
✅ Gemini can be slow with thinking-heavy tasks. This is normal — as long as it doesn't timeout or crash, let it complete.
❌ Multi-turn tool calling fails
✅ Apply the thoughtSignature replay fix from the community setup guide. This is a known issue with the Code Assist API.
❌ Context window seems limited to 128k
✅ Hermes can't auto-detect context from Code Assist. Manually set 'model: contextLength: 1000000' in config.yaml.