hermes 配置Ollama本地模型
环境
Win11,WSL2,Ubuntu24.04
AI 提供商 WSL2 网络(Windows 用户)
AI 提供商 | Hermes Agent - Hermes 智能体
一、前置设置
Windows设置环境变量OLLAMA_HOST=0.0.0.0,开放 Ollama 局域网访问
wsl网络使用镜像模式的应该不用设置。
二、使用hermes model命令配置模型
hermes model
Select provider:
↑↓ navigate ENTER/SPACE select ESC cancel
(○) Nous Portal (Everything your agent needs, 300+ models with bundled tool use)
(○) OpenRouter (Pay-per-use API aggregator)
(○) Mixture of Agents (named presets; aggregator acts after reference models)
(○) NovitaAI (Cloud: Model API, Agent Sandbox, GPU Cloud)
(○) LM Studio (Local desktop app with built-in model server)
(○) Anthropic (Claude models via API key or Claude Code)
(○) OpenAI ▸ (Codex CLI or direct OpenAI API)
→ (●) Qwen Cloud / DashScope (Qwen + multi-provider) ← currently active
(○) xAI Grok ▸ (Direct API or SuperGrok / Premium+ OAuth)
(○) Xiaomi MiMo (MiMo-V2.5 and V2 models: pro, omni, flash)
(○) Tencent TokenHub (Hy3 Preview via tokenhub.tencentmaas.com)
(○) NVIDIA NIM (Nemotron models via build.nvidia.com or local NIM)
(○) GitHub Copilot ▸ (GitHub token API or copilot --acp process)
(○) Hugging Face Inference Providers
(○) Google AI Studio (Native Gemini API)
(○) Google Vertex AI (Gemini via GCP; OAuth2 service account or ADC, GCP billing/quotas)
(○) DeepSeek (V3, R1, coder, direct API)
(○) Z.AI / GLM (Zhipu direct API)
(○) Kimi / Moonshot ▸ (Coding Plan, Moonshot global & China endpoints)
(○) StepFun Step Plan (Agent / coding models via Step Plan API)
(○) MiniMax ▸ (Global, OAuth Coding Plan & China endpoints)
(○) Ollama Cloud (Cloud-hosted open models, ollama.com)
(○) Arcee AI (Trinity models, direct API)
(○) GMI Cloud (Multi-model direct API)
(○) Fireworks AI (OpenAI-compatible direct model API)
(○) Kilo Code (Kilo Gateway API)
(○) OpenCode ▸ (Zen pay-as-you-go or Go subscription)
(○) AWS Bedrock (Claude, Nova, Llama, DeepSeek; IAM or API key)
(○) Azure Foundry (OpenAI-style or Anthropic-style endpoint, your Azure AI deployment)
(○) Qwen OAuth (Reuses local Qwen CLI login)
(○) Alibaba Cloud Coding Plan (Dedicated coding tier)
(○) custom (direct API)
(○) DeepInfra — 100+ open models, pay-per-use
(○) Upstage (Solar API)
(○) Custom endpoint (enter URL manually)
(○) Configure auxiliary models...
(○) Leave unchanged
选择
→ (○) Custom endpoint (enter URL manually)
三、hermes model命令及后续选择
admin@UD26:~$ hermes model
Current model: qwen3.6-flash
Active provider: Qwen Cloud
Custom OpenAI-compatible endpoint configuration:
API base URL [e.g. https://api.example.com/v1]: http://localhost:11434/v1(填写Ollama服务地址)
API key [optional]:
Verified endpoint via http://localhost:11434/v1/models (8 model(s) visible)
Select API compatibility mode:
1. Auto-detect [current]
Use Hermes URL heuristics; best for standard OpenAI-compatible endpoints.
2. Chat Completions
Use /chat/completions for standard OpenAI-compatible servers.
3. Responses / Codex
Use /responses for Codex-compatible tool-calling backends.
4. Anthropic Messages
Use /v1/messages for Anthropic-compatible endpoints.
Choice [1-4, Enter to keep current/detected]: 2(选择2)
API mode: chat_completions
Available models:
1. gemma4:31b
2. gemma4:26b
3. qwen3.6:35b
4. qwen3.6:27b
5. qwen3.5:9b
6. deepseek-r1:1.5b
7. qwen3.5:35b
8. qwen3.5:27b
Select model [1-8] or type name: 3(选择模型)
Context length in tokens [leave blank for auto-detect]:(回车自动侦测(默认的简单),或填写对模型应值:262144,后续可再设置)
Display name [Local (localhost:11434)]:Ollama Local(可选改名,后续可再改)
Default model set to: qwen3.6:35b (via http://localhost:11434/v1)
💾 Saved to custom providers as "Ollama Local" (edit in config.yaml)
快速验证Ollama服务地址
在 WSL2 内部,测试是否可以连接到您的模型服务器
curl http://localhost:11434/v1/models
四、聊天测试hermes
输入命令hermes,聊天测试
五、显示配置信息hermes config show
admin@UD26:~$ hermes config show
┌─────────────────────────────────────────────────────────┐
│ ⚕ Hermes Configuration │
└─────────────────────────────────────────────────────────┘
◆ Paths
Config: /home/uadmin/.hermes/config.yaml
Secrets: /home/uadmin/.hermes/.env
Install: /home/uadmin/.hermes/hermes-agent
◆ API Keys
OpenRouter (not set)
OpenAI (STT/TTS) (not set)
Exa (not set)
Parallel (not set)
Firecrawl (not set)
Tavily (not set)
Browserbase (not set)
Browser Use (not set)
FAL (not set)
Anthropic (not set)
◆ Model
Model: {'default': 'qwen3.6:35b', 'provider': 'custom', 'base_url': 'http://localhost:11434/v1', 'context_length': 262144, 'api_mode': 'chat_completions'}
Max turns: 150
◆ Display
Personality: none
Reasoning: off
Bell: off
User preview: first 2 line(s), last 2 line(s)
◆ Terminal
Backend: local
Working dir: .
Timeout: 180s
◆ Timezone
Timezone: (server-local)
◆ Context Compression
Enabled: yes
Threshold: 50%
Target ratio: 20% of threshold preserved
Protect last: 20 messages
Protect first: 3 non-system head messages
Model: (auto)
◆ Messaging Platforms
Telegram: not configured
Discord: not configured
────────────────────────────────────────────────────────────
hermes config edit # Edit config file
hermes config set <key> <value>
hermes setup # Run setup wizard
六、配置文件config.yaml
~/.hermes/config.yaml
七、修改配置文件hermes config edit
hermes config edit(修改的是~/.hermes/config.yaml文件)
设置模型上下文长度
hermes config set model.context_length 262144
八、再次使用hermes model命令查看
会多出一行
(●) Ollama Local (localhost:11434/v1) — qwen3.6:35b
Select provider:
↑↓ navigate ENTER/SPACE select ESC cancel
(○) Nous Portal (Everything your agent needs, 300+ models with bundled tool use)
(○) OpenRouter (Pay-per-use API aggregator)
(○) Mixture of Agents (named presets; aggregator acts after reference models)
(○) NovitaAI (Cloud: Model API, Agent Sandbox, GPU Cloud)
(○) LM Studio (Local desktop app with built-in model server)
(○) Anthropic (Claude models via API key or Claude Code)
(○) OpenAI ▸ (Codex CLI or direct OpenAI API)
(○) Qwen Cloud / DashScope (Qwen + multi-provider)
(○) xAI Grok ▸ (Direct API or SuperGrok / Premium+ OAuth)
(○) Xiaomi MiMo (MiMo-V2.5 and V2 models: pro, omni, flash)
(○) Tencent TokenHub (Hy3 Preview via tokenhub.tencentmaas.com)
(○) NVIDIA NIM (Nemotron models via build.nvidia.com or local NIM)
(○) GitHub Copilot ▸ (GitHub token API or copilot --acp process)
(○) Hugging Face Inference Providers
(○) Google AI Studio (Native Gemini API)
(○) Google Vertex AI (Gemini via GCP; OAuth2 service account or ADC, GCP billing/quotas)
(○) DeepSeek (V3, R1, coder, direct API)
(○) Z.AI / GLM (Zhipu direct API)
(○) Kimi / Moonshot ▸ (Coding Plan, Moonshot global & China endpoints)
(○) StepFun Step Plan (Agent / coding models via Step Plan API)
(○) MiniMax ▸ (Global, OAuth Coding Plan & China endpoints)
(○) Ollama Cloud (Cloud-hosted open models, ollama.com)
(○) Arcee AI (Trinity models, direct API)
(○) GMI Cloud (Multi-model direct API)
(○) Fireworks AI (OpenAI-compatible direct model API)
(○) Kilo Code (Kilo Gateway API)
(○) OpenCode ▸ (Zen pay-as-you-go or Go subscription)
(○) AWS Bedrock (Claude, Nova, Llama, DeepSeek; IAM or API key)
(○) Azure Foundry (OpenAI-style or Anthropic-style endpoint, your Azure AI deployment)
(○) Qwen OAuth (Reuses local Qwen CLI login)
(○) Alibaba Cloud Coding Plan (Dedicated coding tier)
(○) custom (direct API)
(○) DeepInfra — 100+ open models, pay-per-use
(○) Upstage (Solar API)
→ (●) Ollama Local (localhost:11434/v1) — qwen3.6:35b ← currently active
(○) Custom endpoint (enter URL manually)
(○) Remove a saved custom provider
(○) Configure auxiliary models...
(○) Leave unchanged
九、通过命令行方式配置(未实践)
# 1. 设置模型提供商为自定义端点类型
hermes config set model.provider custom
# 2. 设置Ollama本地API地址(WSL2镜像网络直接用localhost即可)
hermes config set model.base_url http://localhost:11434/v1
# 3. 设置默认调用的模型名称
hermes config set model.default qwen3.6:35b
# 4. 设置API兼容模式为标准Chat Completions(匹配Ollama的OpenAI兼容接口)
hermes config set model.api_mode chat_completions
# 5. 固定上下文窗口长度为262144(256k)
hermes config set model.context_length 262144
更多推荐




所有评论(0)