[LOCAL] Add ollama as first-class provider — blocks local inference story #169

Closed
opened 2026-04-07 02:47:32 +00:00 by Timmy · 1 comment
Owner

Problem

Hermes agent doesn't recognize 'ollama' as a provider. The CLI only accepts: auto, openrouter, nous, openai-codex, copilot-acp, copilot, anthropic, gemini, huggingface, zai, kimi-coding, minimax, minimax-cn, kilocode.

When config.yaml sets provider: ollama, the runtime falls back to OpenRouter which rejects local model names.

Impact

Blocks ALL local inference. Can't run Gemma4, Hermes3, or Hermes4 through the agent harness despite Ollama working perfectly at the API level (33.8 tok/s on Gemma4 with tool-use).

Acceptance Criteria

  • hermes chat -m gemma4 --provider ollama works
  • Routes to http://localhost:11434/v1 (configurable via config.yaml)
  • Tool-use works (function calling via OpenAI-compat endpoint)
  • Profile gemma4-local can run a full agent session locally
  • No cloud calls made during a local-only session

Implementation Hint

  • Add 'ollama' to provider choices in hermes_cli/main.py argument parser
  • Add ollama credential resolution in hermes_cli/auth.py (api_key='ollama', base_url from config)
  • Add ollama to model list in hermes_cli/models.py
  • Ollama uses standard OpenAI-compat API, so the client code already works
## Problem Hermes agent doesn't recognize 'ollama' as a provider. The CLI only accepts: auto, openrouter, nous, openai-codex, copilot-acp, copilot, anthropic, gemini, huggingface, zai, kimi-coding, minimax, minimax-cn, kilocode. When config.yaml sets `provider: ollama`, the runtime falls back to OpenRouter which rejects local model names. ## Impact Blocks ALL local inference. Can't run Gemma4, Hermes3, or Hermes4 through the agent harness despite Ollama working perfectly at the API level (33.8 tok/s on Gemma4 with tool-use). ## Acceptance Criteria - [ ] `hermes chat -m gemma4 --provider ollama` works - [ ] Routes to `http://localhost:11434/v1` (configurable via config.yaml) - [ ] Tool-use works (function calling via OpenAI-compat endpoint) - [ ] Profile `gemma4-local` can run a full agent session locally - [ ] No cloud calls made during a local-only session ## Implementation Hint - Add 'ollama' to provider choices in `hermes_cli/main.py` argument parser - Add ollama credential resolution in `hermes_cli/auth.py` (api_key='ollama', base_url from config) - Add ollama to model list in `hermes_cli/models.py` - Ollama uses standard OpenAI-compat API, so the client code already works
Timmy self-assigned this 2026-04-07 02:47:32 +00:00
Timmy closed this issue 2026-04-07 15:56:51 +00:00
Author
Owner

Bezalel delivered (2026-04-07):

  • hermes_cli/main.py: --provider ollama added to CLI choices
  • hermes_cli/auth.py: ollama alias maps to canonical provider ollama (not custom)
  • agent/auxiliary_client.py: resolve_provider_client routes ollama to http://localhost:11434/v1 with default gemma4:12b
  • agent/auxiliary_client.py: _try_ollama added to auto-detection chain (priority: after Nous, before local/custom)
  • agent/auxiliary_client.py: _VISION_AUTO_PROVIDER_ORDER includes ollama
  • agent/model_metadata.py: ollama added to _PROVIDER_PREFIXES and _URL_TO_PROVIDER
  • agent/model_metadata.py: Gemma-4 context lengths added (256K for 1b/4b/12b/26b/31b)
  • Changes pushed to branch fix/kimi-fallback-model (PR #222)

Closing as completed.

**Bezalel delivered (2026-04-07):** - ✅ `hermes_cli/main.py`: `--provider ollama` added to CLI choices - ✅ `hermes_cli/auth.py`: `ollama` alias maps to canonical provider `ollama` (not `custom`) - ✅ `agent/auxiliary_client.py`: `resolve_provider_client` routes `ollama` to `http://localhost:11434/v1` with default `gemma4:12b` - ✅ `agent/auxiliary_client.py`: `_try_ollama` added to auto-detection chain (priority: after Nous, before local/custom) - ✅ `agent/auxiliary_client.py`: `_VISION_AUTO_PROVIDER_ORDER` includes `ollama` - ✅ `agent/model_metadata.py`: `ollama` added to `_PROVIDER_PREFIXES` and `_URL_TO_PROVIDER` - ✅ `agent/model_metadata.py`: Gemma-4 context lengths added (256K for 1b/4b/12b/26b/31b) - ✅ Changes pushed to branch `fix/kimi-fallback-model` (PR #222) Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/hermes-agent#169