Skip to content

feat(auth): add Ollama Cloud, Google/Gemini, xAI, and Ollama Local as built-in providers#3709

Closed
simplenamebox-ops wants to merge 1 commit into
NousResearch:mainfrom
simplenamebox-ops:feat/add-ollama-google-xai-providers
Closed

feat(auth): add Ollama Cloud, Google/Gemini, xAI, and Ollama Local as built-in providers#3709
simplenamebox-ops wants to merge 1 commit into
NousResearch:mainfrom
simplenamebox-ops:feat/add-ollama-google-xai-providers

Conversation

@simplenamebox-ops

Copy link
Copy Markdown
Contributor

Summary

Adds 4 inference providers to PROVIDER_REGISTRY and corresponding aliases. These are popular providers that currently require manual patching after every update.

Motivation

Hermes already supports 16 built-in providers (nous, openai-codex, anthropic, minimax, huggingface, etc.). Four widely-used providers are missing:

  • Ollama Cloud (ollama.com) — Cloud-hosted open models (GLM-5, Qwen3.5, DeepSeek, MiniMax, etc.). Ollama launched cloud hosting in late 2025 and has a growing user base. Uses API keys, OpenAI-compatible endpoint.
  • Google/Gemini (generativelanguage.googleapis.com/v1beta/openai) — Google's Gemini models via their OpenAI-compatible endpoint. Many users have free Gemini API credits.
  • xAI (api.x.ai/v1) — Grok models. Standard OpenAI-compatible API with API key auth.
  • Ollama Local (localhost:11434/v1) — Local Ollama instance. Many users run Ollama locally for development/testing.

Without these in the registry, users must either:

  1. Patch auth.py after every hermes update (fragile, breaks on each update)
  2. Use workarounds with custom base URLs (doesn't support env var API keys, must hardcode secrets)

Changes

hermes_cli/auth.py

Add to PROVIDER_REGISTRY:

  • google
  • xai
  • ollama-cloud
  • ollama-local

Add aliases:

  • geminigoogle
  • google-aigoogle
  • googleaigoogle
  • grokxai
  • ollama_cloudollama-cloud
  • ollama-cloud-apiollama-cloud

No other files changed

The provider registry is self-contained. Model validation, provider selection, and API routing already read from PROVIDER_REGISTRY automatically.

Test plan

  • python3 -m py_compile hermes_cli/auth.py
  • git diff --check
  • Only hermes_cli/auth.py changed
  • hermes config set model.provider ollama-cloud → resolves to Ollama Cloud
  • hermes config set model.provider google → resolves to Google
  • hermes config set model.provider xai → resolves to xAI
  • hermes config set model.provider ollama-local → resolves to local Ollama
  • Aliases resolve: gemini → google, grok → xai, ollama_cloud → ollama-cloud
  • API keys read from env vars: OLLAMA_CLOUD_API_KEY, GEMINI_API_KEY, XAI_API_KEY, OLLAMA_API_KEY
  • Base URL overrides work via env vars
  • Existing providers unaffected

Context

These providers have been running via local patches in a multi-agent setup for months. The provider configs are stable and tested in daily use. Adding them upstream would eliminate a recurring post-update patch requirement.

@LakshanDS

Copy link
Copy Markdown

when im using the google model's trough their API (custom API mode in hermes), specially the gemma models the thinking tokens are viable to the telegram. as a block its not hidden. will this fix that?

@teknium1

Copy link
Copy Markdown
Contributor

The Ollama Cloud portion of this PR was covered by PR #10782 (via #6038's implementation). The Google/Gemini and xAI portions are already available as built-in providers on current main. Thanks for the contribution.

@teknium1 teknium1 closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants