config
config
¶
Configuration loading, hardware detection, and engine recommendation.
User configuration lives at ~/.openjarvis/config.toml. load_config()
detects hardware, fills sensible defaults, then overlays any user overrides
found in the TOML file.
Classes¶
GpuInfo
dataclass
¶
GpuInfo(vendor: str = '', name: str = '', vram_gb: float = 0.0, compute_capability: str = '', count: int = 0)
Detected GPU metadata.
HardwareInfo
dataclass
¶
HardwareInfo(platform: str = '', cpu_brand: str = '', cpu_count: int = 0, ram_gb: float = 0.0, gpu: Optional[GpuInfo] = None)
Detected system hardware.
VLLMEngineConfig
dataclass
¶
Per-engine config for vLLM.
SGLangEngineConfig
dataclass
¶
Per-engine config for SGLang.
LlamaCppEngineConfig
dataclass
¶
Per-engine config for llama.cpp.
MLXEngineConfig
dataclass
¶
Per-engine config for MLX.
LMStudioEngineConfig
dataclass
¶
Per-engine config for LM Studio.
ExoEngineConfig
dataclass
¶
Per-engine config for Exo.
NexaEngineConfig
dataclass
¶
Per-engine config for Nexa.
UzuEngineConfig
dataclass
¶
Per-engine config for Uzu.
AppleFmEngineConfig
dataclass
¶
Per-engine config for Apple Foundation Models.
GemmaCppEngineConfig
dataclass
¶
GemmaCppEngineConfig(model_path: str = '', tokenizer_path: str = '', model_type: str = '', num_threads: int = 0)
Per-engine config for gemma.cpp.
EngineConfig
dataclass
¶
EngineConfig(default: str = 'ollama', ollama: OllamaEngineConfig = OllamaEngineConfig(), vllm: VLLMEngineConfig = VLLMEngineConfig(), sglang: SGLangEngineConfig = SGLangEngineConfig(), llamacpp: LlamaCppEngineConfig = LlamaCppEngineConfig(), mlx: MLXEngineConfig = MLXEngineConfig(), lmstudio: LMStudioEngineConfig = LMStudioEngineConfig(), exo: ExoEngineConfig = ExoEngineConfig(), nexa: NexaEngineConfig = NexaEngineConfig(), uzu: UzuEngineConfig = UzuEngineConfig(), apple_fm: AppleFmEngineConfig = AppleFmEngineConfig(), gemma_cpp: GemmaCppEngineConfig = GemmaCppEngineConfig())
Inference engine settings with nested per-engine configs.
Attributes¶
IntelligenceConfig
dataclass
¶
IntelligenceConfig(default_model: str = '', fallback_model: str = '', model_path: str = '', checkpoint_path: str = '', quantization: str = 'none', preferred_engine: str = '', provider: str = '', temperature: float = 0.7, max_tokens: int = 1024, top_p: float = 0.9, top_k: int = 40, repetition_penalty: float = 1.0, stop_sequences: str = '')
The model — identity, paths, quantization, and generation defaults.
RoutingLearningConfig
dataclass
¶
Routing sub-policy config within Learning.
SFTConfig
dataclass
¶
SFTConfig(model_name: str = 'Qwen/Qwen3-1.7B', max_seq_length: int = 4096, num_epochs: int = 3, batch_size: int = 8, learning_rate: float = 2e-05, weight_decay: float = 0.01, warmup_ratio: float = 0.1, max_grad_norm: float = 1.0, gradient_checkpointing: bool = True, use_lora: bool = True, lora_rank: int = 16, lora_alpha: int = 32, lora_dropout: float = 0.05, target_modules: str = 'q_proj,v_proj', use_4bit: bool = False, checkpoint_dir: str = 'checkpoints/sft', min_pairs: int = 10, agent_filter: str = '')
General-purpose SFT training config. Maps to [learning.intelligence.sft].
GRPOConfig
dataclass
¶
GRPOConfig(model_name: str = 'Qwen/Qwen3-1.7B', max_seq_length: int = 4096, max_response_length: int = 2048, num_epochs: int = 10, batch_size: int = 16, learning_rate: float = 1e-06, max_grad_norm: float = 1.0, gradient_checkpointing: bool = True, num_samples_per_prompt: int = 8, temperature: float = 1.0, kl_coef: float = 0.0001, clip_ratio: float = 0.2, use_8bit_ref: bool = True, checkpoint_dir: str = 'checkpoints/grpo', save_every_n_epochs: int = 1, keep_last_n: int = 3, min_prompts: int = 10, agent_filter: str = '')
General-purpose GRPO training config. Maps to [learning.intelligence.grpo].
DSPyOptimizerConfig
dataclass
¶
DSPyOptimizerConfig(optimizer: str = 'BootstrapFewShotWithRandomSearch', task_lm: str = '', teacher_lm: str = '', max_bootstrapped_demos: int = 4, max_labeled_demos: int = 4, num_candidate_programs: int = 10, max_rounds: int = 1, optimize_system_prompt: bool = True, optimize_few_shot: bool = True, optimize_tool_descriptions: bool = True, min_traces: int = 20, metric_threshold: float = 0.7, agent_filter: str = '', config_dir: str = '')
DSPy agent optimizer config. Maps to [learning.agent.dspy].
GEPAOptimizerConfig
dataclass
¶
GEPAOptimizerConfig(reflection_lm: str = '', max_metric_calls: int = 150, population_size: int = 10, optimize_system_prompt: bool = True, optimize_tools: bool = True, optimize_max_turns: bool = True, optimize_temperature: bool = True, min_traces: int = 20, assessment_batch_size: int = 10, agent_filter: str = '', config_dir: str = '')
GEPA agent optimizer config. Maps to [learning.agent.gepa].
IntelligenceLearningConfig
dataclass
¶
IntelligenceLearningConfig(policy: str = 'none', sft: SFTConfig = SFTConfig(), grpo: GRPOConfig = GRPOConfig())
Intelligence sub-policy config within Learning.
AgentLearningConfig
dataclass
¶
AgentLearningConfig(policy: str = 'none', dspy: DSPyOptimizerConfig = DSPyOptimizerConfig(), gepa: GEPAOptimizerConfig = GEPAOptimizerConfig())
Agent sub-policy config within Learning.
MetricsConfig
dataclass
¶
MetricsConfig(accuracy_weight: float = 0.6, latency_weight: float = 0.2, cost_weight: float = 0.1, efficiency_weight: float = 0.1)
Reward / optimization metric weights.
LearningConfig
dataclass
¶
LearningConfig(enabled: bool = False, update_interval: int = 100, auto_update: bool = False, routing: RoutingLearningConfig = RoutingLearningConfig(), intelligence: IntelligenceLearningConfig = IntelligenceLearningConfig(), agent: AgentLearningConfig = AgentLearningConfig(), metrics: MetricsConfig = MetricsConfig(), training_enabled: bool = False, training_schedule: str = '', min_improvement: float = 0.02)
StorageConfig
dataclass
¶
StorageConfig(default_backend: str = 'sqlite', db_path: str = str(DEFAULT_CONFIG_DIR / 'memory.db'), context_top_k: int = 5, context_min_score: float = 0.1, context_max_tokens: int = 2048, chunk_size: int = 512, chunk_overlap: int = 64)
Storage (memory) backend settings.
MCPConfig
dataclass
¶
MCP (Model Context Protocol) settings.
BrowserConfig
dataclass
¶
BrowserConfig(headless: bool = True, timeout_ms: int = 30000, viewport_width: int = 1280, viewport_height: int = 720)
Browser automation settings (Playwright).
ToolsConfig
dataclass
¶
ToolsConfig(storage: StorageConfig = StorageConfig(), mcp: MCPConfig = MCPConfig(), browser: BrowserConfig = BrowserConfig(), enabled: str = '')
Tools primitive settings — wraps storage and MCP configuration.
AgentConfig
dataclass
¶
ServerConfig
dataclass
¶
ServerConfig(host: str = '127.0.0.1', port: int = 8000, agent: str = 'orchestrator', model: str = '', workers: int = 1, cors_origins: list = (lambda: ['http://localhost:3000', 'http://localhost:5173', 'http://127.0.0.1:3000', 'http://127.0.0.1:5173', 'tauri://localhost'])())
API server settings.
TelemetryConfig
dataclass
¶
TelemetryConfig(enabled: bool = True, db_path: str = str(DEFAULT_CONFIG_DIR / 'telemetry.db'), gpu_metrics: bool = False, gpu_poll_interval_ms: int = 50, energy_vendor: str = '', warmup_samples: int = 0, steady_state_window: int = 5, steady_state_threshold: float = 0.05)
Telemetry persistence settings.
TracesConfig
dataclass
¶
Trace system settings.
TelegramChannelConfig
dataclass
¶
TelegramChannelConfig(bot_token: str = '', allowed_chat_ids: str = '', parse_mode: str = 'Markdown')
Per-channel config for Telegram.
DiscordChannelConfig
dataclass
¶
Per-channel config for Discord.
SlackChannelConfig
dataclass
¶
Per-channel config for Slack.
WebhookChannelConfig
dataclass
¶
Per-channel config for generic webhooks.
EmailChannelConfig
dataclass
¶
EmailChannelConfig(smtp_host: str = '', smtp_port: int = 587, imap_host: str = '', imap_port: int = 993, username: str = '', password: str = '', use_tls: bool = True)
Per-channel config for email (SMTP/IMAP).
WhatsAppChannelConfig
dataclass
¶
Per-channel config for WhatsApp Cloud API.
SignalChannelConfig
dataclass
¶
Per-channel config for Signal (via signal-cli REST API).
GoogleChatChannelConfig
dataclass
¶
Per-channel config for Google Chat webhooks.
IRCChannelConfig
dataclass
¶
IRCChannelConfig(server: str = '', port: int = 6667, nick: str = '', password: str = '', use_tls: bool = False)
Per-channel config for IRC.
TeamsChannelConfig
dataclass
¶
Per-channel config for Microsoft Teams (Bot Framework).
MatrixChannelConfig
dataclass
¶
Per-channel config for Matrix.
MattermostChannelConfig
dataclass
¶
Per-channel config for Mattermost.
FeishuChannelConfig
dataclass
¶
Per-channel config for Feishu (Lark).
BlueBubblesChannelConfig
dataclass
¶
Per-channel config for BlueBubbles (iMessage bridge).
WhatsAppBaileysChannelConfig
dataclass
¶
WhatsAppBaileysChannelConfig(auth_dir: str = '', assistant_name: str = 'Jarvis', assistant_has_own_number: bool = False)
Per-channel config for WhatsApp via Baileys protocol.
ChannelConfig
dataclass
¶
ChannelConfig(enabled: bool = False, default_channel: str = '', default_agent: str = 'simple', telegram: TelegramChannelConfig = TelegramChannelConfig(), discord: DiscordChannelConfig = DiscordChannelConfig(), slack: SlackChannelConfig = SlackChannelConfig(), webhook: WebhookChannelConfig = WebhookChannelConfig(), email: EmailChannelConfig = EmailChannelConfig(), whatsapp: WhatsAppChannelConfig = WhatsAppChannelConfig(), signal: SignalChannelConfig = SignalChannelConfig(), google_chat: GoogleChatChannelConfig = GoogleChatChannelConfig(), irc: IRCChannelConfig = IRCChannelConfig(), webchat: WebChatChannelConfig = WebChatChannelConfig(), teams: TeamsChannelConfig = TeamsChannelConfig(), matrix: MatrixChannelConfig = MatrixChannelConfig(), mattermost: MattermostChannelConfig = MattermostChannelConfig(), feishu: FeishuChannelConfig = FeishuChannelConfig(), bluebubbles: BlueBubblesChannelConfig = BlueBubblesChannelConfig(), whatsapp_baileys: WhatsAppBaileysChannelConfig = WhatsAppBaileysChannelConfig())
Channel messaging settings.
CapabilitiesConfig
dataclass
¶
RBAC capability system settings.
SecurityConfig
dataclass
¶
SecurityConfig(enabled: bool = True, scan_input: bool = True, scan_output: bool = True, mode: str = 'redact', secret_scanner: bool = True, pii_scanner: bool = True, audit_log_path: str = str(DEFAULT_CONFIG_DIR / 'audit.db'), enforce_tool_confirmation: bool = True, merkle_audit: bool = True, signing_key_path: str = '', ssrf_protection: bool = True, rate_limit_enabled: bool = True, rate_limit_rpm: int = 60, rate_limit_burst: int = 10, local_engine_bypass: bool = False, local_tool_bypass: bool = False, profile: str = '', vault_key_path: str = str(DEFAULT_CONFIG_DIR / '.vault_key'), capabilities: CapabilitiesConfig = CapabilitiesConfig())
Security guardrails settings.
SandboxConfig
dataclass
¶
SandboxConfig(enabled: bool = False, image: str = 'openjarvis-sandbox:latest', timeout: int = 300, workspace: str = '', mount_allowlist_path: str = '', max_concurrent: int = 5, runtime: str = 'docker', wasm_fuel_limit: int = 1000000, wasm_memory_limit_mb: int = 256)
Container sandbox settings.
SchedulerConfig
dataclass
¶
Task scheduler settings.
WorkflowConfig
dataclass
¶
Workflow engine settings.
SessionConfig
dataclass
¶
SessionConfig(enabled: bool = False, max_age_hours: float = 24.0, consolidation_threshold: int = 100, db_path: str = str(DEFAULT_CONFIG_DIR / 'sessions.db'))
Cross-channel session settings.
OperatorsConfig
dataclass
¶
OperatorsConfig(enabled: bool = False, manifests_dir: str = '~/.openjarvis/operators', auto_activate: str = '')
Operator lifecycle settings.
SpeechConfig
dataclass
¶
SpeechConfig(backend: str = 'auto', model: str = 'base', language: str = '', device: str = 'auto', compute_type: str = 'float16')
Speech-to-text settings.
OptimizeConfig
dataclass
¶
OptimizeConfig(max_trials: int = 20, early_stop_patience: int = 5, optimizer_model: str = 'claude-sonnet-4-6', optimizer_provider: str = 'anthropic', benchmark: str = '', max_samples: int = 50, judge_model: str = 'gpt-5-mini-2025-08-07', db_path: str = str(DEFAULT_CONFIG_DIR / 'optimize.db'))
Configuration optimization settings.
AgentManagerConfig
dataclass
¶
Persistent agent manager settings.
MemoryFilesConfig
dataclass
¶
MemoryFilesConfig(soul_path: str = '~/.openjarvis/SOUL.md', memory_path: str = '~/.openjarvis/MEMORY.md', user_path: str = '~/.openjarvis/USER.md', nudge_interval: int = 10)
Persistent memory-file paths and nudge settings.
SystemPromptConfig
dataclass
¶
SystemPromptConfig(soul_max_chars: int = 4000, memory_max_chars: int = 2500, user_max_chars: int = 1500, skill_desc_max_chars: int = 60, truncation_strategy: str = 'head_tail')
Limits and strategy for system-prompt assembly.
CompressionConfig
dataclass
¶
CompressionConfig(enabled: bool = True, threshold: float = 0.5, strategy: str = 'session_consolidation')
Configuration for context compression.
SkillsConfig
dataclass
¶
SkillsConfig(skills_dir: str = '~/.openjarvis/skills/', nudge_interval: int = 15, auto_discover: bool = True)
Configuration for agent-authored procedural skills.
JarvisConfig
dataclass
¶
JarvisConfig(hardware: HardwareInfo = HardwareInfo(), engine: EngineConfig = EngineConfig(), intelligence: IntelligenceConfig = IntelligenceConfig(), learning: LearningConfig = LearningConfig(), tools: ToolsConfig = ToolsConfig(), agent: AgentConfig = AgentConfig(), server: ServerConfig = ServerConfig(), telemetry: TelemetryConfig = TelemetryConfig(), traces: TracesConfig = TracesConfig(), channel: ChannelConfig = ChannelConfig(), security: SecurityConfig = SecurityConfig(), sandbox: SandboxConfig = SandboxConfig(), scheduler: SchedulerConfig = SchedulerConfig(), workflow: WorkflowConfig = WorkflowConfig(), sessions: SessionConfig = SessionConfig(), a2a: A2AConfig = A2AConfig(), operators: OperatorsConfig = OperatorsConfig(), speech: SpeechConfig = SpeechConfig(), optimize: OptimizeConfig = OptimizeConfig(), agent_manager: AgentManagerConfig = AgentManagerConfig(), memory_files: MemoryFilesConfig = MemoryFilesConfig(), system_prompt: SystemPromptConfig = SystemPromptConfig(), compression: CompressionConfig = CompressionConfig(), skills: SkillsConfig = SkillsConfig())
Top-level configuration for OpenJarvis.
Attributes¶
memory
property
writable
¶
memory: StorageConfig
Backward-compatible accessor — canonical location is tools.storage.
Functions¶
detect_hardware
¶
detect_hardware() -> HardwareInfo
Auto-detect hardware capabilities with graceful fallbacks.
Source code in src/openjarvis/core/config.py
recommend_engine
¶
recommend_engine(hw: HardwareInfo) -> str
Suggest the best inference engine for the detected hardware.
Source code in src/openjarvis/core/config.py
recommend_model
¶
recommend_model(hw: HardwareInfo, engine: str) -> str
Suggest the largest Qwen3.5 model that fits the detected hardware.
Uses llmfit-style VRAM estimation: Q4_K_M quantization is ~0.5 bytes/param
with 10% overhead. For MoE models Ollama loads full model weights, so we
use parameter_count_b (total), not active_parameter_count_b.
Source code in src/openjarvis/core/config.py
estimated_download_gb
¶
apply_security_profile
¶
apply_security_profile(security_cfg: 'SecurityConfig', server_cfg: 'ServerConfig | None', *, overrides: 'set[str] | None' = None) -> None
Expand a named security profile into config fields.
Fields in overrides (explicitly set by the user in TOML) are not overwritten by the profile.
Source code in src/openjarvis/core/config.py
validate_config_key
¶
Validate a dotted config key and return the leaf field's Python type.
Raises :class:ValueError when the key does not map to a known field.
The function walks the JarvisConfig dataclass hierarchy using
dataclasses.fields().
Examples::
validate_config_key("engine.ollama.host") # -> str
validate_config_key("intelligence.temperature") # -> float
Source code in src/openjarvis/core/config.py
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 | |
load_config
cached
¶
load_config(path: Optional[Path] = None) -> JarvisConfig
Detect hardware, build defaults, overlay TOML overrides.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
Explicit config file. If not set, uses
TYPE:
|
Source code in src/openjarvis/core/config.py
1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 | |
generate_minimal_toml
¶
generate_minimal_toml(hw: HardwareInfo, engine: str | None = None, *, host: str | None = None) -> str
Render a minimal TOML config with only essential settings.
Source code in src/openjarvis/core/config.py
generate_default_toml
¶
generate_default_toml(hw: HardwareInfo, engine: str | None = None, *, host: str | None = None) -> str
Render a commented TOML string suitable for ~/.openjarvis/config.toml.
Source code in src/openjarvis/core/config.py
1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 | |