Agent Stack · Optimization
Hermes Agent Optimization
Domain: AI Agents, Fine-Tuning, Tool Calling Status: Active Research Strategic Importance: High — Core to retired internal project agent capabilities Hermes Agent Optimization is a specialized approach to training language models for tool-calling and multi-step task execution within the Hermes Agent framework. Unlike generic chat models or benchmark-optimized systems, Hermes-optimized models prioritize harness-native behavior — exec…
wiki/wiki/concepts/hermes-agent-optimization.mdAnswer
Domain: AI Agents, Fine-Tuning, Tool Calling Status: Active Research Strategic Importance: High — Core to retired internal project agent capabilities Hermes Agent Optimization is a specialized approach to training language models for tool-calling and multi-step task execution within the Hermes Agent framework. Unlike generic chat models or benchmark-optimized systems, Hermes-optimized models prioritize harness-native behavior — exec…
Auto-generated neutral summary from the source page — needs human review before trusted use.
Evidence & Source Cards
https://huggingface.co/kai-os/Carnice-9bexternal/unverifiedhttps://github.com/NousResearch/hermes-agent-self-evolutionexternal/unverifiedSource Excerpt
Domain: AI Agents, Fine-Tuning, Tool Calling
Status: Active Research
Strategic Importance: High — Core to retired internal project agent capabilities
Executive Summary
Hermes Agent Optimization is a specialized approach to training language models for tool-calling and multi-step task execution within the Hermes Agent framework. Unlike generic chat models or benchmark-optimized systems, Hermes-optimized models prioritize harness-native behavior — executing tools accurately, handling terminal operations, managing multi-turn workflows, and maintaining proper action structure inside the Hermes runtime.
Key Insight: Models trained on Hermes-specific traces (Carnice Model Family-9b) outperform generic tool-trained models because they learn the actual patterns and constraints of the harness, not abstract tool schemas.
Core Principles
1. Harness-Native Over Generic
Problem: Most "agent" models are trained on generic tool schemas (OpenAI Functions, generic JSON schemas) that don't match the actual structure and flow of real agent frameworks.
Solution: Train on actual Hermes traces — real conversations, tool calls, terminal outputs, file edits, and multi-step workflows from inside the Hermes harness.
Result: Models that "think in Hermes" — natural action structure, proper error handling, correct tool sequencing.
2. Execution Quality Over Benchmark Scores
Problem: Leaderboard optimization (MMLU, GSM8K, HumanEval) doesn't correlate with agent execution quality.
Solution: Optimize for:
- Tool calling accuracy (did the model call the right tool with correct arguments?)
- Terminal behavior (does it handle shell output, errors, long-running processes?)
- File editing correctness (proper diffs, atomic changes, rollback capability)
- Multi-turn workflow completion (can it execute 10+ step tasks without losing context?)
Result: Models that actually get work done instead of looking good on benchmarks.
3. Two-Stage Training Architecture
Stage A — Reasoning Repair:
- High-signal reasoning datasets (Bespoke-Stratos-17k, NuminaMath-CoT)
- Builds foundational reasoning capability
- Teaches chain-of-thought, problem decomposition
Stage B — Hermes-Specific Refresh:
- Harness-native traces (Carnice Model Family-glm5-hermes-traces, OpenThoughts-Agent-v1-SFT)
- Teaches Hermes action structure
- Reinforces tool calling patterns specific to Hermes runtime
Critical: Stage B is the differentiator — without it, models have generic reasoning but awkward harness behavior.
Technical Implementation
Training Data Requirements
| Data Type | Purpose | Example Sources |
|---|---|---|
| Reasoning Data | Foundational CoT | Bespoke-Stratos-17k, NuminaMath-CoT |
| Hermes Traces | Harness-native behavior | Carnice Model Family-glm5-hermes-traces |
| Agent Workflows | Multi-step execution | OpenThoughts-Agent-v1-SFT |
| Tool Schemas | Action structure | Hermes-native tool definitions |
| Error Recovery | Handling failures | Real agent error traces |
Model Architecture Considerations
Base Model Selection:
- Qwen3.5-9B (Carnice Model Family-9b base) — good reasoning, efficient
- Qwen3.5-27B (pending) — better reasoning, still tractable
- Avoid overly large models (70B+) unless necessary — diminishing returns for agent work
Precision:
- Training: bfloat16 (stability)
- Deployment: Q4_K_M to Q6_K GGUF Format Format (balance quality/size)
Context Length:
- Minimum: 8K (tool outputs, file contents)
- Target: 16K-32K (complex workflows, multi-file edits)
Evaluation Metrics
Not These (Generic Benchmarks):
- MMLU score
- GSM8K accuracy
- HumanEval pass@1
These (Agent-Specific):
- Tool call accuracy (% correct tool + arguments)
- Workflow completion rate (% multi-step tasks finished)
- Error recovery success (% failures handled correctly)
- Terminal behavior quality (proper output parsing, timeout handling)
- File edit correctness (% atomic, reversible changes)
retired internal project Applications
Current Implementation
Carnice Model Family-9b is the primary Hermes-optimized model for retired internal project:
| Attribute | Value |
|---|---|
| Base Model | Qwen/Qwen3.5-9B |
| Format | Merged standalone checkpoint |
| License | Apache 2.0 (commercial use OK) |
| Deployment | Mac Mini (Q4_K_M ~6GB), Mac Studio (Q8/bf16) |
| Use Case | Primary agent model for tool calling |
Performance Characteristics:
- ✅ Excellent tool calling accuracy (Hermes-native training)
- ✅ Proper terminal behavior (shell output parsing, error handling)
- ✅ Correct action structure (Hermes format, not generic JSON)
- ✅ Multi-turn workflow capability (10+ step tasks)
- ⚠️ 9B size limits complex reasoning (27B pending)
Deployment Strategy
Mac Mini (16GB) — Edge Nodes:
Model: Carnice Model Family-9b @ Q4_K_M (~6GB) Context: 8K-16K Use: Small workspaces, single-agent tasks Concurrent: 1-2 instances
Mac Studio (256GB) — Central Hub:
Model: Carnice Model Family-9b @ Q8 or bf16 (~18-20GB) Context: 16K-32K Use: Primary agent, complex workflows Concurrent: 2-3 instances (with larger model)
Ubuntu 3090 (24GB) — GPU Workers:
Model: Carnice Model Family-9b @ bf16 or Q6_K (~18GB) Context: 16K-32K Use: Batch inference, fine-tuning experiments Concurrent: Multiple parallel workspaces
Future: Carnice-27B
Expected Benefits:
- Better reasoning depth (27B vs 9B)
- More complex workflow handling
- Improved error recovery
- Still fits Mac Studio (Q4_K_M ~18GB) and 3090 (Q4_K_S ~20GB)
Action Plan:
- Monitor @kai-os HuggingFace for release
- Immediate download and validation
- Quantize to Q4_K_M, Q5_K_M, Q6_K
- Benchmark vs 9B on retired internal project workflows
- Deploy as primary model if improvement confirmed
Comparison to Alternatives
| Approach | Tool Accuracy | Harness Fit | Reasoning | Size | retired internal project Fit |
|---|---|---|---|---|---|
| Carnice Model Family-9b (Hermes-native) | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | 9B | ✅ Excellent |
| Generic Tool-Trained | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐ | 7-70B | ⚠️ Awkward |
| Chat-Only Models | ⭐ | ⭐ | ⭐⭐⭐⭐⭐ | 7-70B | ❌ Wrong use case |
| Carnice Model Family-27B (pending) | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | 27B | ⭐ Ideal |
Key Researchers & Sources
| Person/Org | Contribution |
|---|---|
| @kai-os | Carnice Model Family model creator, Hermes optimization pioneer |
| Teknium (Nous Research Research) | Hermes framework, Carnice Model Family contributor |
| Zachary Mueller (Lambda) | Carnice Model Family contributor, GPU training |
| Nous Research Research | Hermes Agent framework development |
Related Concepts
- concepts/hermes-agent-optimization — Broader methodology
- concepts/tool-calling-patterns — Specific action structures
- ai-ml/fine-tuning-methodologies — Training approaches
- retired-internal-project/agent-architecture — System design
- concepts/nightly-learning-loop — retired internal project's self-improvement mechanism
Open Questions
- Optimal Context Length: Is 16K sufficient, or does 32K meaningfully improve complex workflows?
- Fine-Tuning Depth: Should retired internal project fine-tune Carnice Model Family further on proprietary workflows?
- Multi-Model Strategy: When to use 9B vs 27B vs larger models?
- Evaluation Benchmark: What's the right retired internal project-specific agent benchmark?
Follow-up Actions
- [x] Document Hermes optimization principles
- [x] Link to Carnice Model Family-9b model page
- [ ] Create retired internal project agent benchmark suite
- [ ] Test Carnice Model Family-9b on representative workflows
- [ ] Plan Carnice Model Family-27B integration (when released)
- [ ] Evaluate fine-tuning on retired internal project-specific traces
Metadata
- Created: 2026-04-05 by Julius
- Last Updated: 2026-04-05 by Julius
- Next Review: 2026-04-12 (weekly — aligns with Carnice Model Family-27B watch)
Source excerpt truncated at 220 of 222 lines. Open the canonical wiki path above for the full page.
Relationships
Outbound links
- AI Agentscorpus
- Agent Architecturecorpus
- Fine-Tuning Methodologiescorpus
- Hermes Agent Frameworkcorpus
- Hermes Agent Optimizationcorpus
Referenced by
- Hermes Agent Optimizationbacklink
- Hermes Agent Communitybacklink