mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-31 03:12:16 +00:00
Trace-driven learning pipeline: - TrainingDataMiner: extract SFT/routing/agent pairs from traces - LoRATrainer: fine-tune local models from trace-derived data - AgentConfigEvolver: rewrite agent configs from trace analysis - LearningOrchestrator: coordinate mine→train→evolve cycle, wired into SystemBuilder Eval framework (15 real IPW benchmarks): - Datasets: SuperGPQA, GPQA, MMLU-Pro, MATH-500, Natural Reasoning, HLE, SimpleQA, WildChat, IPW, GAIA, FRAMES, SWE-bench, SWEfficiency, TerminalBench, TerminalBench Native - Scorers: MCQ extraction, LLM-judge, exact match, structural validation - CLI: jarvis eval list|run|compare|report Composable abstractions: - Recipe system: TOML composition of all 5 pillars (3 built-in recipes) - Agent templates: 15 pre-configured TOML manifests with system prompts - Bundled skills: 20 ready-to-use TOML skill manifests - Operator recipes: researcher (4h), correspondent (5min), sentinel (2h) 102 files changed, ~11,500 lines added. 3241 tests pass (44 skipped). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
95 lines
2.3 KiB
Python
95 lines
2.3 KiB
Python
"""Learning pillar — router policies, reward functions, and trace-driven learning."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from openjarvis.learning._stubs import (
|
|
QueryAnalyzer,
|
|
RewardFunction,
|
|
RouterPolicy,
|
|
RoutingContext,
|
|
)
|
|
from openjarvis.learning.agent_evolver import AgentConfigEvolver
|
|
from openjarvis.learning.heuristic_reward import HeuristicRewardFunction
|
|
from openjarvis.learning.learning_orchestrator import LearningOrchestrator
|
|
from openjarvis.learning.router import (
|
|
HeuristicRouter,
|
|
build_routing_context,
|
|
)
|
|
from openjarvis.learning.training.data import TrainingDataMiner
|
|
from openjarvis.learning.training.lora import HAS_TORCH, LoRATrainer, LoRATrainingConfig
|
|
|
|
|
|
def ensure_registered() -> None:
|
|
"""Ensure all learning policies are registered in RouterPolicyRegistry.
|
|
|
|
Imported lazily to avoid circular imports with the intelligence pillar.
|
|
"""
|
|
from openjarvis.learning.heuristic_policy import (
|
|
ensure_registered as _reg_heuristic,
|
|
)
|
|
|
|
_reg_heuristic()
|
|
|
|
try:
|
|
from openjarvis.learning.grpo_policy import (
|
|
ensure_registered as _reg_grpo,
|
|
)
|
|
|
|
_reg_grpo()
|
|
except ImportError:
|
|
pass
|
|
|
|
try:
|
|
from openjarvis.learning.bandit_router import (
|
|
ensure_registered as _reg_bandit,
|
|
)
|
|
|
|
_reg_bandit()
|
|
except ImportError:
|
|
pass
|
|
|
|
from openjarvis.learning.trace_policy import (
|
|
ensure_registered as _reg_trace,
|
|
)
|
|
|
|
_reg_trace()
|
|
|
|
try:
|
|
import openjarvis.learning.sft_policy # noqa: F401
|
|
except ImportError:
|
|
pass
|
|
|
|
try:
|
|
import openjarvis.learning.agent_advisor # noqa: F401
|
|
except ImportError:
|
|
pass
|
|
|
|
try:
|
|
import openjarvis.learning.icl_updater # noqa: F401
|
|
except ImportError:
|
|
pass
|
|
|
|
# Orchestrator-native SFT & GRPO training
|
|
try:
|
|
import openjarvis.learning.orchestrator # noqa: F401
|
|
except ImportError:
|
|
pass
|
|
|
|
|
|
__all__ = [
|
|
"AgentConfigEvolver",
|
|
"HAS_TORCH",
|
|
"HeuristicRewardFunction",
|
|
"HeuristicRouter",
|
|
"LearningOrchestrator",
|
|
"LoRATrainer",
|
|
"LoRATrainingConfig",
|
|
"QueryAnalyzer",
|
|
"RewardFunction",
|
|
"RouterPolicy",
|
|
"RoutingContext",
|
|
"TrainingDataMiner",
|
|
"build_routing_context",
|
|
"ensure_registered",
|
|
]
|