hermit README

README проекта с github.com/Infini-AI-Lab/hermit. Одним файлом markdown: README.md.

Hermit

A Framework for Continual Learning and RSI through Harness Adapter Evolution

License Python Version Website Docs WeChat Discord

Get Started · Harness Adapters · Methods · Examples and Recipes · FAQ · Docs


Hermit is a framework for training, evaluating, and deploying harness adapters, with support for multiple harness evolution algorithms. It adapts your agent to new tasks by evolving an external adapter while keeping your existing model and harness unchanged.

News

What Is a Harness Adapter?

A harness adapter is a trainable external harness (like a plugin with built-in training support). Just as a model adapter adapts a model, a harness adapter adapts an existing agent to new scenarios without modifying its original harness or model.

An agent made of a model and a harness meets a new scenario and fits it poorly. The agent is frozen, a harness adapter plugs into its side, a frame closes around the two as one agent, and task feedback trains the adapter from V0 to V5 while the score curve rises.

Why Harness Adapters?

Many harnesses are black boxes; even open-source ones have carefully designed component interactions that direct evolution can disrupt. Harness adapters offer three practical benefits: (1) No changes to your existing harness: evolve an external adapter through supported extension interfaces, even when both the model and harness are black boxes; (2) Transferable: reuse across compatible models and harnesses; (3) Trainable: learn from task feedback.

A Unified Framework for Harness Evolution

Supported Harness Evolution Methods (More to Come)

Hermit provides an RL-style training loop for evolving harness adapters:

Animated training flow: tasks run through the acting agent and harness adapter, feedback reaches the Evolver, and checked updates become the next adapter version.

Easy to Use

Customize Your Training Loop:

Training pseudocode: initialize the adapter, run and judge tasks, call evolver.step, check and commit the proposal, then finalize.

Get Started

Install

Requires Python 3.12+ and Git.

Clone the repository to run the examples, reproduce recipes, or develop your own methods.

git clone https://github.com/Infini-AI-Lab/hermit.git
cd hermit
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .

From PyPI

To use the framework CLI and bundled adapter templates in your Python environment:

python -m pip install hermit-harness
hermit --help

The Quick Start below uses files from the source checkout. See Installation for method-specific dependencies.

Method Dependencies

From the checkout root, install only the methods you need. Dependency groups require pip 25.1+:

python -m pip install --upgrade "pip>=25.1"
python -m pip install -e . --group gepa
# Or install every supported method dependency:
python -m pip install -e . --group all

Groups gepa, skillopt, and harness2 pin their upstream packages to tested Git commits in pyproject.toml. Repeat --group to combine methods. Groups are source-checkout configuration; pip install hermit-harness installs the core only. See Installation.

Quick Start

The included local training walkthrough connects feedback, an adapter update, evaluation, and deployment. A scripted learner reads the judge's feedback and writes the learned rule.

No model account, GPU, or dataset download required.

Train and Evaluate

hermit check --config docs/_examples/first_training/run.yaml
hermit eval --config docs/_examples/first_training/run.yaml --adapter none
hermit train --config docs/_examples/first_training/run.yaml
hermit eval --config docs/_examples/first_training/run.yaml --adapter final

The teaching agent starts by echoing lowercase text. After a failed attempt, the learner writes Output format: uppercase. into ADAPTER.md. Later executions load the updated adapter.

Expected in this demo: baseline 0.0 → final 1.0, with zero execution errors.

This deterministic example verifies the training contract. Its constructed score gain is not a real-model performance result. Its agent runs in the task sandbox; the learner is trusted local Python in the Trainer's process.

Inspect and Deploy

cat .demo/first-training/first-training/checkout/ADAPTER.md
hermit deploy \
  --adapter .demo/first-training/first-training/checkout \
  --workspace .demo/first-training/workspace \
  --host codex
cat .demo/first-training/workspace/AGENTS.md

The generated AGENTS.md contains the learned rule. Start Codex in that workspace to use it.

Full walkthrough, expected outputs, and repeat-run instructions →

Run harness evolution with your coding plan. Use your Codex/ChatGPT subscription for both acting and learning, with no separate model API key required. Plan-backed recipes are available for GEPA, SkillOpt, Harness², Continual Harness, ACE, AHE Adapter, and RRSI Adapter. See the setup guide and recipes to get started; model access and usage follow your plan.

Ready for a real agent? Train with an API model · Run OfficeQA · Bring your own task

Examples and Recipes

Harness Evolution Recipes

Train and evaluate harness adapters on benchmarks using different evolution methods. Each task's README reports results; each included adapter's .hermit/CARD.md records evaluation details.

Method Recipes
MWM CL-Bench database · CL-Bench poker · ServeLearnBench
ReHarness CL-Bench database · CL-Bench poker · OfficeQA
SkillOpt OfficeQA
GEPA OfficeQA
Harness² OfficeQA (the paper's per-question protocol, Codex as the acting agent)
Continual Harness OfficeQA (policy, sub-agents, skills and memory refined in place, Codex as the acting agent)
Meta-Harness Adapter OfficeQA (whole adapters searched by a coding-agent proposer, Codex as the acting agent)
ACE OfficeQA (a playbook of bullets grown by a Reflector and a Curator, Codex as the acting agent)
AHE Adapter OfficeQA (a Codex harness of prompt, middleware hooks, scripts, skills and memory, evolved by an Agent Debugger and an Evolve Agent)
RRSI Adapter OfficeQA (whole adapters evolved round by round under regularizers against overfitting, Codex + GPT-5.6-Luna acting and learning)
OPRO OfficeQA (one instruction searched by a model that reads the best earlier instructions with their training scores, Codex + GPT-5.6-Luna acting and optimizing)
EvoSafeHarness AgentDyn (a defense bundle of a system prompt and tool-call hooks searched around a frozen victim, on fixed benign and injected cases)
Prompt-only CL-Bench database · CL-Bench poker · ServeLearnBench

Walkthroughs: OfficeQA · CL-Bench · ServeLearnBench.

Smaller training demos: Quick Start (offline) · First real-model training. Task folder layout.

Harness Adapter Examples

The finished Lean collaboration adapter coordinates five Codex agents through shared tools, state, and skills to prove Lean theorems together. Walkthrough →

More Starting Points

Use a trained adapter Train for your tasks Build a new method
Deploy to your agent. Use your tasks and feedback. Implement and compare your idea.

What You Need for Each Starting Point

Your goal What Hermit provides What you bring
Use an existing adapter
Use an adapter →
Workspace deployment and native plugin conversion for a compatible adapter. An adapter, a supported agent host, and any dependencies the adapter needs.
Adapt to your own tasks
Train your adapter →
Existing templates and Evolvers, with a Trainer that connects execution, feedback, checks, and versioning. Your tasks, acting agent, evaluator, and model access.
Develop a learning method or adapter design
Build a learning method →
Editable adapter specifications and an Evolver interface for implementing and comparing methods on shared task pipelines. Your adapter design or update algorithm, plus an evaluation task.

Deploy an Adapter Without Training

mkdir -p .demo
cp -R hermit/adapter/templates/prompt_only .demo/adapter
hermit deploy --adapter .demo/adapter --workspace .demo/codex-workspace --host codex
cat .demo/codex-workspace/AGENTS.md

Train on OfficeQA

Prepare the dataset and model endpoint as described in the OfficeQA recipe. The agent uses SkillOpt's rollout, so install the skillopt and gepa dependency groups (pip 25.1+). Sandboxed agent Evolvers require Linux with bubblewrap.

python -m pip install -e . --group skillopt --group gepa
python examples/officeqa/utils/prepare.py --csv /path/to/officeqa_full.csv --docs /path/to/treasury_bulletins_parsed
hermit check --config examples/officeqa/gepa/smoke.yaml
hermit train --config examples/officeqa/gepa/smoke.yaml
hermit eval --config examples/officeqa/gepa/smoke.yaml --adapter final

Use Your Own Model Server

Models use <backend>/<model id> references. See Model backends for endpoint configuration and requirements.

vllm serve Qwen/Qwen3-30B-A3B-Instruct-2507-FP8 --enable-auto-tool-choice --tool-call-parser hermes
hermit backends check vllm/Qwen/Qwen3-30B-A3B-Instruct-2507-FP8
hermit train --config examples/officeqa/gepa/smoke.yaml model=vllm/Qwen/Qwen3-30B-A3B-Instruct-2507-FP8 llm=vllm/Qwen/Qwen3-30B-A3B-Instruct-2507-FP8

Convert a Trained Adapter into a Plugin

hermit convert --adapter DIR --output OUT --target codex
# Other targets: claude-code, pi, hermes

FAQ

How Is a Harness Adapter Different from a Plugin?

Think of it as a plugin with built-in training support: it defines what can be learned and checked, while Hermit manages updates and versioning from task feedback. A compatible adapter can be deployed as a native plugin.

What Can a Harness Adapter Contain?

A harness adapter can contain instructions, skills, memory, tools, executable code, and agent coordination logic. It can be an entire repository implementing an external harness.

Its specification defines how the agent uses it, which parts can be trained, and how updates are checked—while keeping the original model and harness unchanged.

Why Not Evolve the Original Harness Directly?

Many harnesses are closed-source, and changing a carefully designed harness can disrupt its component interactions. An adapter keeps learned changes in an external layer while leaving the original harness and model fixed.

When Should I Use Hermit?

Use Hermit to deploy an existing adapter, train one on your tasks, or develop and compare harness evolution methods through a shared training interface.

Full FAQ: training, transfer, supported methods, and evaluation →

Community

Join our WeChat community or Discord server to discuss harness evolution, share experiments, and connect with other users and contributors.

Contributing

Help extend Hermit by implementing an Evolver, connecting a task, or reporting a reproduction or integration issue.

License

Apache-2.0

hermit (Infini-AI-Lab/hermit)

Ищем в базе…

531 ·GitHub
Что это такое?Hermit — это фреймворк для обучения, оценки и развёртывания «адаптеров харнесса», то есть внешних обучаемых компонентов, которые подстраивают существующего агента под новые задачи через непрерывное обучение и рекурсивное самосовершенствование, не меняя базовую модель или сам харнесс.
Адаптер харнесса — это плагин или что-то другое?Считайте его плагином со встроенной поддержкой обучения: он описывает, чему можно обучаться и что можно проверять, а Hermit по обратной связи от задач управляет обновлениями и версиями. Совместимый адаптер позже можно преобразовать в нативный плагин.
Как установить и попробовать?Установка из исходников (рекомендуется, для примеров и рецептов) выполняется клонированием репозитория, а также можно поставить базовый пакет CLI через PyPI; установка только базового CLI делается командой 'pip install hermit-harness'. Quick Start проведёт через локальную демонстрацию обучения, для которой не нужны аккаунт в сервисе модели или GPU.
Что нужно для запуска?Python 3.12+ и Git. Для отдельных методов эволюции (gepa, skillopt, harness2) нужно установить дополнительные группы зависимостей через pip 25.1+, а для песочниц агентных Evolvers требуется Linux с bubblewrap.
Есть ли подводные камни, о которых стоит знать?Скачок оценки с 0.0 до 1.0 в Quick Start — детерминированный скриптовый пример для проверки контракта обучения, а не результат работы реальной модели; он запускается с отключённой песочницей программы-обучаемого. Настоящее обучение в песочнице дополнительно требует Linux и bubblewrap.
Для кого это?Для разработчиков и исследователей, которые создают или оценивают агентов и хотят адаптировать существующую модель и харнесс типа «чёрный ящик» под новые задачи, либо хотят разрабатывать и сравнивать новые методы эволюции харнесса.
Что на самом деле может содержать адаптер харнесса?Он может включать инструкции, навыки, память, инструменты, исполняемый код и логику координации агентов, вплоть до целого репозитория, который реализует внешний харнесс.
Почему бы не изменить сам харнесс напрямую?Многие харнессы закрытые, а правка тщательно спроектированного харнесса может нарушить взаимодействие его компонентов, поэтому Hermit хранит изменения, полученные в ходе обучения, во внешнем слое адаптера.
Какой агент используется в примерах?В большинстве рецептов в роли действующего агента используется Codex, включая адаптер для совместной работы пяти агентов по доказательству теорем на Lean.
Какие бенчмарки включены для проверки адаптеров?Среди рецептов есть CL-Bench (база данных, покер), ServeLearnBench и OfficeQA; у каждого есть README с результатами и файл CARD.md с деталями оценки.
Какие есть похожие проекты?hive, context-language-models, Proteus, FlashRSI, RSIGame, awesome-rsi, rrsi, harness2
Автор
Infini-AI-Lab
Размер
27.1 MB
Звёзды
531
Возраст
2 мес
Коммиты · 90 дней