Skip to content

Personal AI, On Personal Devices

Python

feat: remote engine host configuration via CLI (#104)

Jon Saad-Falcon43b1240a440c
diff --git a/pyproject.toml b/pyproject.toml
index 67e820eb..4af236ee 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -17,6 +17,7 @@ dependencies = [
"python-telegram-bot>=22.6",
"rich>=13",
"tomli>=2.0; python_version < '3.11'",
+ "tomlkit>=0.12",
]
[project.optional-dependencies]
diff --git a/src/openjarvis/cli/ask.py b/src/openjarvis/cli/ask.py
index 43014909..594338e4 100644
--- a/src/openjarvis/cli/ask.py
+++ b/src/openjarvis/cli/ask.py
@@ -44,7 +44,8 @@ def _get_memory_backend(config):
if key == "sqlite":
backend = MemoryRegistry.create(
- key, db_path=config.memory.db_path,
+ key,
+ db_path=config.memory.db_path,
)
else:
backend = MemoryRegistry.create(key)
@@ -106,8 +107,7 @@ def _run_agent(
if not AgentRegistry.contains(agent_name):
raise click.ClickException(
- f"Unknown agent: {agent_name}. "
- f"Available: {', '.join(AgentRegistry.keys())}"
+ f"Unknown agent: {agent_name}. Available: {', '.join(AgentRegistry.keys())}"
)
agent_cls = AgentRegistry.get(agent_name)
@@ -117,6 +117,7 @@ def _run_agent(
if tool_names:
# Trigger tool registration
import openjarvis.tools # noqa: F401
+
tools = _build_tools(tool_names, config, engine, model_name)
# Build agent with appropriate kwargs
@@ -149,7 +150,10 @@ def _run_agent(
max_context_tokens=config.memory.context_max_tokens,
)
context_messages = inject_context(
- query_text, [], backend, config=ctx_cfg,
+ query_text,
+ [],
+ backend,
+ config=ctx_cfg,
)
for msg in context_messages:
ctx.conversation.add(msg)
@@ -169,9 +173,7 @@ def _print_profile(
) -> None:
"""Print an inference telemetry profile table from EventBus history."""
# Collect all INFERENCE_END events (agents may fire multiple)
- inf_events = [
- e for e in bus.history if e.event_type == EventType.INFERENCE_END
- ]
+ inf_events = [e for e in bus.history if e.event_type == EventType.INFERENCE_END]
if not inf_events:
console.print("[dim]No inference telemetry recorded.[/dim]")
return
@@ -186,13 +188,15 @@ def _print_profile(
for e in inf_events
)
total_prompt = sum(
- e.data.get("usage", {}).get("prompt_tokens", 0)
- for e in inf_events
+ e.data.get("usage", {}).get("prompt_tokens", 0) for e in inf_events
)
total_energy = sum(e.data.get("energy_joules", 0.0) for e in inf_events)
avg_power = 0.0
- power_vals = [e.data.get("power_watts", 0.0) for e in inf_events
- if e.data.get("power_watts", 0.0) > 0]
+ power_vals = [
+ e.data.get("power_watts", 0.0)
+ for e in inf_events
+ if e.data.get("power_watts", 0.0) > 0
+ ]
if power_vals:
avg_power = sum(power_vals) / len(power_vals)
@@ -284,29 +288,42 @@ def _print_profile(
@click.option("-m", "--model", "model_name", default=None, help="Model to use.")
@click.option("-e", "--engine", "engine_key", default=None, help="Engine backend.")
@click.option(
- "-t", "--temperature", default=None, type=float,
+ "-t",
+ "--temperature",
+ default=None,
+ type=float,
help="Sampling temperature (default: from config).",
)
@click.option(
- "--max-tokens", default=None, type=int,
+ "--max-tokens",
+ default=None,
+ type=int,
help="Max tokens to generate (default: from config).",
)
@click.option("--json", "output_json", is_flag=True, help="Output raw JSON result.")
@click.option("--no-stream", is_flag=True, help="Disable streaming (sync mode).")
@click.option(
- "--no-context", is_flag=True,
+ "--no-context",
+ is_flag=True,
help="Disable memory context injection.",
)
@click.option(
- "-a", "--agent", "agent_name", default=None,
+ "-a",
+ "--agent",
+ "agent_name",
+ default=None,
help="Agent to use (simple, orchestrator).",
)
@click.option(
- "--tools", "tool_names", default=None,
+ "--tools",
+ "tool_names",
+ default=None,
help="Comma-separated tool names to enable (e.g. calculator,think).",
)
@click.option(
- "--profile", "enable_profile", is_flag=True,
+ "--profile",
+ "enable_profile",
+ is_flag=True,
help="Print inference telemetry profile (latency, tokens, energy, IPW).",
)
def ask(
@@ -377,7 +394,10 @@ def ask(
" [cyan]ollama serve[/cyan] — start Ollama\n"
" [cyan]vllm serve <model>[/cyan] — start vLLM\n"
" [cyan]llama-server -m <gguf>[/cyan] — start llama.cpp\n\n"
- "Or set OPENAI_API_KEY / ANTHROPIC_API_KEY for cloud inference."
+ "Or set OPENAI_API_KEY / ANTHROPIC_API_KEY for cloud inference.\n\n"
+ "[dim]To use a remote engine:[/dim]\n"
+ " [cyan]jarvis config set engine.ollama.host http://<remote-ip>:11434[/cyan]\n"
+ " [dim]or[/dim] [cyan]export OLLAMA_HOST=http://<remote-ip>:11434[/cyan]"
)
sys.exit(1)
@@ -385,6 +405,7 @@ def ask(
# Apply security guardrails
from openjarvis.security import setup_security
+
sec = setup_security(config, engine, bus)
engine = sec.engine
@@ -427,12 +448,14 @@ def ask(
# the user would have gotten without the analyzer.
if not user_set_max_tokens:
suggested = adjust_tokens_for_model(
- complexity_result.suggested_max_tokens, model_name,
+ complexity_result.suggested_max_tokens,
+ model_name,
)
max_tokens = max(suggested, config.intelligence.max_tokens)
logger.debug(
"Using complexity-suggested max_tokens=%d (model=%s)",
- max_tokens, model_name,
+ max_tokens,
+ model_name,
)
# Agent mode
@@ -444,8 +467,15 @@ def ask(
)
try:
result = _run_agent(
- agent_name, query_text, engine, model_name,
- parsed_tools, config, bus, temperature, max_tokens,
+ agent_name,
+ query_text,
+ engine,
+ model_name,
+ parsed_tools,
+ config,
+ bus,
+ temperature,
+ max_tokens,
capability_policy=sec.capability_policy,
)
except EngineConnectionError as exc:
@@ -454,25 +484,33 @@ def ask(
sys.exit(1)
if output_json:
- click.echo(json_mod.dumps({
- "content": result.content,
- "turns": result.turns,
- "tool_results": [
+ click.echo(
+ json_mod.dumps(
{
- "tool_name": tr.tool_name,
- "content": tr.content,
- "success": tr.success,
- }
- for tr in result.tool_results
- ],
- }, indent=2))
+ "content": result.content,
+ "turns": result.turns,
+ "tool_results": [
+ {
+ "tool_name": tr.tool_name,
+ "content": tr.content,
+ "success": tr.success,
+ }
+ for tr in result.tool_results
+ ],
+ },
+ indent=2,
+ )
+ )
else:
click.echo(result.content)
if enable_profile:
_print_profile(
- bus, time.monotonic() - wall_start,
- engine_name, model_name, console,
+ bus,
+ time.monotonic() - wall_start,
+ engine_name,
+ model_name,
+ console,
complexity_result=complexity_result,
)
@@ -493,17 +531,18 @@ def ask(
ContextConfig,
inject_context,
)
+
backend = _get_memory_backend(config)
if backend is not None:
ctx_cfg = ContextConfig(
top_k=config.memory.context_top_k,
min_score=config.memory.context_min_score,
- max_context_tokens=(
- config.memory.context_max_tokens
- ),
+ max_context_tokens=(config.memory.context_max_tokens),
)
messages = inject_context(
- query_text, messages, backend,
+ query_text,
+ messages,
+ backend,
config=ctx_cfg,
)
except Exception as exc:
@@ -531,8 +570,11 @@ def ask(
if enable_profile:
_print_profile(
- bus, time.monotonic() - wall_start,
- engine_name, model_name, console,
+ bus,
+ time.monotonic() - wall_start,
+ engine_name,
+ model_name,
+ console,
complexity_result=complexity_result,
)
diff --git a/src/openjarvis/cli/config_cmd.py b/src/openjarvis/cli/config_cmd.py
index 324a348a..43e5be3f 100644
--- a/src/openjarvis/cli/config_cmd.py
+++ b/src/openjarvis/cli/config_cmd.py
@@ -4,9 +4,11 @@ from __future__ import annotations
import json
import os
+import re
from pathlib import Path
import click
+import httpx
from rich.console import Console
from rich.panel import Panel
from rich.syntax import Syntax
@@ -274,4 +276,100 @@ def hardware() -> None:
config.add_command(show_group, "show")
+def _probe_engine_host(url: str, console: Console) -> None:
+ """Probe an engine host URL and print reachability status."""
+ try:
+ resp = httpx.get(url.rstrip("/") + "/", timeout=2.0)
+ if resp.status_code < 500:
+ console.print(f" [green]Reachable[/green] ({url})")
+ else:
+ console.print(
+ f" [yellow]Warning:[/yellow] Host returned status "
+ f"{resp.status_code} — config saved anyway."
+ )
+ except Exception:
+ console.print(
+ f" [yellow]Warning:[/yellow] Host unreachable ({url}) "
+ f"— config saved anyway."
+ )
+
+
+def _coerce_value(value: str, target_type: type) -> object:
+ """Coerce a CLI string value to the target Python type."""
+ if target_type is bool:
+ low = value.lower()
+ if low in ("true", "1", "yes"):
+ return True
+ if low in ("false", "0", "no"):
+ return False
+ raise ValueError(
+ f"Invalid boolean value: {value!r} (expected: true/false, yes/no, 1/0)"
+ )
+ if target_type is int:
+ return int(value)
+ if target_type is float:
+ return float(value)
+ return value
+
+
+def set_config(key: str, value: str) -> None:
+ """Set a configuration value (e.g. jarvis config set engine.ollama.host URL)."""
+ import tomlkit
+
+ from openjarvis.core.config import DEFAULT_CONFIG_DIR, validate_config_key
+
+ console = Console(stderr=True)
+
+ # Validate key
+ try:
+ target_type = validate_config_key(key)
+ except ValueError as exc:
+ console.print(f"[red]Error:[/red] {exc}")
+ raise SystemExit(1)
+
+ # Coerce value
+ try:
+ typed_value = _coerce_value(value, target_type)
+ except (ValueError, TypeError) as exc:
+ console.print(
+ f"[red]Error:[/red] Cannot convert {value!r} to "
+ f"{target_type.__name__}: {exc}"
+ )
+ raise SystemExit(1)
+
+ # Load or create TOML document
+ config_path = Path(
+ os.environ.get("OPENJARVIS_CONFIG", DEFAULT_CONFIG_DIR / "config.toml")
+ )
+ if config_path.exists():
+ doc = tomlkit.parse(config_path.read_text())
+ else:
+ doc = tomlkit.document()
+ config_path.parent.mkdir(parents=True, exist_ok=True)
+
+ # Set nested key
+ parts = key.split(".")
+ current = doc
+ for part in parts[:-1]:
+ if part not in current:
+ current.add(part, tomlkit.table())
+ current = current[part]
+ current[parts[-1]] = typed_value
+
+ # Write back
+ config_path.write_text(tomlkit.dumps(doc))
+
+ console.print(f"[green]Set[/green] {key} = {value!r}")
+
+ # Probe engine host if applicable
+ if re.match(r"^engine\.\w+\.host$", key):
+ _probe_engine_host(value, console)
+
+
+config.add_command(set_config, "set")
+
+
__all__ = ["config"]
diff --git a/src/openjarvis/cli/hints.py b/src/openjarvis/cli/hints.py
index 9c8617cf..c2b1e3cd 100644
--- a/src/openjarvis/cli/hints.py
+++ b/src/openjarvis/cli/hints.py
@@ -22,7 +22,11 @@ def hint_no_engine(engine_name: Optional[str] = None) -> str:
f"[yellow]Hint:[/yellow] Engine '{name}' is not reachable.\n"
f" Make sure the {name} server is running.\n"
" Run [bold]jarvis doctor[/bold] to check all engines.\n"
- " Run [bold]jarvis quickstart[/bold] for guided setup."
+ " Run [bold]jarvis quickstart[/bold] for guided setup.\n"
+ "\n"
+ " [dim]To use a remote engine:[/dim]\n"
+ f" [cyan]jarvis config set engine.{name}.host http://<remote-ip>:<port>[/cyan]\n"
+ f" [dim]or[/dim] [cyan]export OLLAMA_HOST=http://<remote-ip>:11434[/cyan]"
)
diff --git a/src/openjarvis/cli/init_cmd.py b/src/openjarvis/cli/init_cmd.py
index 8d729b7e..a60f0217 100644
--- a/src/openjarvis/cli/init_cmd.py
+++ b/src/openjarvis/cli/init_cmd.py
@@ -6,6 +6,7 @@ from pathlib import Path
from typing import Optional
import click
+import httpx
from rich.console import Console
from rich.markup import escape
from rich.panel import Panel
@@ -25,8 +26,14 @@ from openjarvis.core.config import (
# Engines supported by ``jarvis init --engine``.
_SUPPORTED_ENGINES = [
- "ollama", "vllm", "sglang", "llamacpp", "mlx", "lmstudio",
- "exo", "nexa",
+ "ollama",
+ "vllm",
+ "sglang",
+ "llamacpp",
+ "mlx",
+ "lmstudio",
+ "exo",
+ "nexa",
]
@@ -70,7 +77,7 @@ def _next_steps_text(engine: str, model: str = "") -> str:
f" ollama pull {pull_model}\n"
"\n"
" 3. Try it out:\n"
- " jarvis ask \"Hello\"\n"
+ ' jarvis ask "Hello"\n'
"\n"
" Run `jarvis doctor` to verify your setup."
),
@@ -82,7 +89,7 @@ def _next_steps_text(engine: str, model: str = "") -> str:
" vllm serve Qwen/Qwen3-4B\n"
"\n"
" 2. Try it out:\n"
- " jarvis ask \"Hello\"\n"
+ ' jarvis ask "Hello"\n'
"\n"
" Run `jarvis doctor` to verify your setup."
),
@@ -94,7 +101,7 @@ def _next_steps_text(engine: str, model: str = "") -> str:
" llama-server -m path/to/model.gguf\n"
"\n"
" 2. Try it out:\n"
- " jarvis ask \"Hello\"\n"
+ ' jarvis ask "Hello"\n'
"\n"
" Run `jarvis doctor` to verify your setup."
),
@@ -106,7 +113,7 @@ def _next_steps_text(engine: str, model: str = "") -> str:
" python -m sglang.launch_server --model-path Qwen/Qwen3-8B\n"
"\n"
" 2. Try it out:\n"
- " jarvis ask \"Hello\"\n"
+ ' jarvis ask "Hello"\n'
"\n"
" Run `jarvis doctor` to verify your setup."
),
@@ -118,7 +125,7 @@ def _next_steps_text(engine: str, model: str = "") -> str:
" mlx_lm.server --model mlx-community/Qwen2.5-7B-4bit\n"
"\n"
" 2. Try it out:\n"
- " jarvis ask \"Hello\"\n"
+ ' jarvis ask "Hello"\n'
"\n"
" Run `jarvis doctor` to verify your setup."
),
@@ -131,7 +138,7 @@ def _next_steps_text(engine: str, model: str = "") -> str:
" 2. Load a model and start the local server (port 1234)\n"
"\n"
" 3. Try it out:\n"
- " jarvis ask \"Hello\"\n"
+ ' jarvis ask "Hello"\n'
"\n"
" Run `jarvis doctor` to verify your setup."
),
@@ -141,7 +148,7 @@ def _next_steps_text(engine: str, model: str = "") -> str:
" pip install exo\n"
" exo\n\n"
" 2. Try it out:\n"
- " jarvis ask \"Hello\"\n\n"
+ ' jarvis ask "Hello"\n\n'
" Run `jarvis doctor` to verify your setup."
),
"nexa": (
@@ -150,7 +157,7 @@ def _next_steps_text(engine: str, model: str = "") -> str:
" pip install nexaai\n"
" nexa server\n\n"
" 2. Try it out:\n"
- " jarvis ask \"Hello\"\n\n"
+ ' jarvis ask "Hello"\n\n'
" Run `jarvis doctor` to verify your setup."
),
}
@@ -177,6 +184,7 @@ def _quick_privacy_check(console: Console) -> None:
def _do_download(engine: str, model: str, spec, console: Console) -> None:
"""Dispatch model download based on engine type."""
import os
+
if engine == "ollama":
host = os.environ.get("OLLAMA_HOST", "http://localhost:11434").rstrip("/")
ollama_pull(host, model, console)
@@ -228,12 +236,18 @@ def _do_download(engine: str, model: str, spec, console: Console) -> None:
@click.option(
"--no-download", is_flag=True, default=False, help="Skip the model download prompt."
)
+ "--host",
+ default=None,
+ help="Remote engine host URL (e.g. http://192.168.1.50:11434).",
+)
def init(
force: bool,
config: Optional[Path],
full_config: bool = False,
engine: Optional[str] = None,
no_download: bool = False,
+ host: Optional[str] = None,
) -> None:
"""Detect hardware and generate ~/.openjarvis/config.toml."""
console = Console()
@@ -267,9 +281,7 @@ def init(
console.print("[bold]Detecting running inference engines...[/bold]")
running = _detect_running_engines()
if running:
- console.print(
- f" Found running: [green]{', '.join(running)}[/green]"
- )
+ console.print(f" Found running: [green]{', '.join(running)}[/green]")
else:
console.print(" No running engines detected.")
@@ -313,13 +325,31 @@ def init(
default=default,
)
+ # Probe remote host if specified
+ if host:
+ console.print("\n[bold]Checking remote host...[/bold]")
+ try:
+ resp = httpx.get(host.rstrip("/") + "/", timeout=2.0)
+ if resp.status_code < 500:
+ console.print(f" [green]Reachable[/green] ({host})")
+ else:
+ console.print(
+ f" [yellow]Warning:[/yellow] Host returned status "
+ f"{resp.status_code} — writing config anyway."
+ )
+ except Exception:
+ console.print(
+ f" [yellow]Warning:[/yellow] Host unreachable ({host}) "
+ f"— writing config anyway."
+ )
+
if config:
toml_content = config.read_text()
else:
if full_config:
- toml_content = generate_default_toml(hw, engine=engine)
+ toml_content = generate_default_toml(hw, engine=engine, host=host)
else:
- toml_content = generate_minimal_toml(hw, engine=engine)
+ toml_content = generate_minimal_toml(hw, engine=engine, host=host)
DEFAULT_CONFIG_DIR.mkdir(parents=True, exist_ok=True)
if config:
@@ -341,8 +371,7 @@ def init(
soul_path = DEFAULT_CONFIG_DIR / "SOUL.md"
if not soul_path.exists():
soul_path.write_text(
- "# Agent Persona\n\n"
- "You are Jarvis, a helpful personal AI assistant.\n"
+ "# Agent Persona\n\nYou are Jarvis, a helpful personal AI assistant.\n"
)
memory_path = DEFAULT_CONFIG_DIR / "MEMORY.md"
diff --git a/src/openjarvis/core/config.py b/src/openjarvis/core/config.py
index 9a829fd4..d8f1f10f 100644
--- a/src/openjarvis/core/config.py
+++ b/src/openjarvis/core/config.py
@@ -1157,6 +1157,80 @@ class JarvisConfig:
self.tools.storage = value
+# ---------------------------------------------------------------------------
+# Config key validation
+# ---------------------------------------------------------------------------
+
+# Sections that users may set via ``jarvis config set``.
+# ``hardware`` is auto-detected and not user-settable.
+_SETTABLE_SECTIONS = frozenset(JarvisConfig.__dataclass_fields__.keys()) - {"hardware"}
+
+
+def validate_config_key(dotted_key: str) -> type:
+ """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
+ """
+ from dataclasses import fields as dc_fields
+
+ parts = dotted_key.split(".")
+ if len(parts) < 2:
+ raise ValueError(
+ f"Config key must have at least two segments (e.g. engine.default), "
+ f"got: {dotted_key!r}"
+ )
+
+ if parts[0] not in _SETTABLE_SECTIONS:
+ raise ValueError(
+ f"Unknown config key: {dotted_key!r} "
+ f"(valid top-level sections: {sorted(_SETTABLE_SECTIONS)})"
+ )
+
+ # Walk the dataclass tree
+ current_cls = JarvisConfig
+ for i, part in enumerate(parts):
+ field_map = {f.name: f for f in dc_fields(current_cls)}
+ if part not in field_map:
+ path_so_far = ".".join(parts[: i + 1])
+ raise ValueError(
+ f"Unknown config key: {dotted_key!r} "
+ f"(no field {part!r} at {path_so_far}; "
+ f"valid fields: {sorted(field_map.keys())})"
+ )
+ fld = field_map[part]
+ # Resolve the type — unwrap Optional, etc.
+ fld_type = fld.type
+ if isinstance(fld_type, str):
+ # Evaluate forward references in the config module namespace
+ import openjarvis.core.config as _cfg_mod
+
+ fld_type = eval(fld_type, vars(_cfg_mod)) # noqa: S307
+
+ if i == len(parts) - 1:
+ # Leaf — return the primitive type
+ return fld_type
+ else:
+ # Must be a nested dataclass
+ if not hasattr(fld_type, "__dataclass_fields__"):
+ path_so_far = ".".join(parts[: i + 1])
+ raise ValueError(
+ f"Unknown config key: {dotted_key!r} "
+ f"({path_so_far} is a leaf of type {fld_type.__name__}, "
+ f"not a section)"
+ )
+ current_cls = fld_type
+
+ # Should not reach here, but satisfy type checker
+ raise ValueError(f"Unknown config key: {dotted_key!r}")
+
+
# ---------------------------------------------------------------------------
# TOML loading
# ---------------------------------------------------------------------------
@@ -1283,7 +1357,9 @@ def load_config(path: Optional[Path] = None) -> JarvisConfig:
# ---------------------------------------------------------------------------
-def generate_minimal_toml(hw: HardwareInfo, engine: str | None = None) -> str:
+def generate_minimal_toml(
+ hw: HardwareInfo, engine: str | None = None, *, host: str | None = None
+) -> str:
"""Render a minimal TOML config with only essential settings."""
engine = engine or recommend_engine(hw)
model = recommend_model(hw, engine)
@@ -1291,6 +1367,14 @@ def generate_minimal_toml(hw: HardwareInfo, engine: str | None = None) -> str:
if hw.gpu:
mem_label = "unified memory" if hw.gpu.vendor == "apple" else "VRAM"
gpu_comment = f"\n# GPU: {hw.gpu.name} ({hw.gpu.vram_gb} GB {mem_label})"
+ if host:
+ engine_host_section = f'\n[engine.{engine}]\nhost = "{host}"\n'
+ else:
+ engine_host_section = (
+ f"\n[engine.{engine}]\n"
+ f'# host = "http://localhost:11434" '
+ f"# set to remote URL if engine runs elsewhere\n"
+ )
return f"""\
# OpenJarvis configuration
# Hardware: {hw.cpu_brand} ({hw.cpu_count} cores, {hw.ram_gb} GB RAM){gpu_comment}
@@ -1298,7 +1382,7 @@ def generate_minimal_toml(hw: HardwareInfo, engine: str | None = None) -> str:
[engine]
default = "{engine}"
-
+{engine_host_section}
[intelligence]
default_model = "{model}"
@@ -1310,7 +1394,9 @@ enabled = ["code_interpreter", "web_search", "file_read", "shell_exec"]
"""
-def generate_default_toml(hw: HardwareInfo, engine: str | None = None) -> str:
+def generate_default_toml(
+ hw: HardwareInfo, engine: str | None = None, *, host: str | None = None
+) -> str:
"""Render a commented TOML string suitable for ``~/.openjarvis/config.toml``."""
engine = engine or recommend_engine(hw)
model = recommend_model(hw, engine)
@@ -1322,7 +1408,7 @@ def generate_default_toml(hw: HardwareInfo, engine: str | None = None) -> str:
if model:
model_comment = " # recommended for your hardware"
- return f"""\
+ result = f"""\
# OpenJarvis configuration
# Generated by `jarvis init`
#
@@ -1517,6 +1603,13 @@ ssrf_protection = true
# assistant_name = "Jarvis"
# assistant_has_own_number = false
"""
+ if host:
+ import re as _re
+
+ pattern = _re.escape(f"[engine.{engine}]") + r"\nhost = \"[^\"]*\""
+ replacement = f'[engine.{engine}]\\nhost = "{host}"'
+ result = _re.sub(pattern, replacement, result)
+ return result
__all__ = [
@@ -1581,4 +1674,5 @@ __all__ = [
"load_config",
"recommend_engine",
"recommend_model",
+ "validate_config_key",
]
diff --git a/tests/cli/test_config_set.py b/tests/cli/test_config_set.py
new file mode 100644
index 00000000..54162256
--- /dev/null
+++ b/tests/cli/test_config_set.py
@@ -0,0 +1,154 @@
+"""Tests for ``jarvis config set`` command."""
+
+from __future__ import annotations
+
+import os
+from pathlib import Path
+from unittest import mock
+
+from click.testing import CliRunner
+
+from openjarvis.cli import cli
+
+
+class TestConfigSet:
+ def test_set_creates_config_file(self, tmp_path: Path) -> None:
+ """config set creates config.toml if it doesn't exist."""
+ config_file = tmp_path / "config.toml"
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with mock.patch.dict(os.environ, env):
+ result = CliRunner().invoke(
+ cli, ["config", "set", "engine.default", "vllm"]
+ )
+ assert result.exit_code == 0
+ assert config_file.exists()
+ content = config_file.read_text()
+ assert "vllm" in content
+
+ def test_set_engine_ollama_host(self, tmp_path: Path) -> None:
+ """config set writes engine.ollama.host correctly."""
+ config_file = tmp_path / "config.toml"
+ config_file.write_text('[engine]\ndefault = "ollama"\n')
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with (
+ mock.patch.dict(os.environ, env),
+ mock.patch("openjarvis.cli.config_cmd.httpx"),
+ ):
+ result = CliRunner().invoke(
+ cli,
+ ["config", "set", "engine.ollama.host", "http://192.168.1.50:11434"],
+ )
+ assert result.exit_code == 0
+ content = config_file.read_text()
+ assert "http://192.168.1.50:11434" in content
+
+ def test_set_preserves_existing_keys(self, tmp_path: Path) -> None:
+ """config set preserves other keys in the file."""
+ config_file = tmp_path / "config.toml"
+ config_file.write_text(
+ '[engine]\ndefault = "ollama"\n\n'
+ "[intelligence]\n"
+ 'default_model = "qwen2.5:3b"\n'
+ )
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with mock.patch.dict(os.environ, env):
+ result = CliRunner().invoke(
+ cli, ["config", "set", "engine.default", "vllm"]
+ )
+ assert result.exit_code == 0
+ content = config_file.read_text()
+ assert "vllm" in content
+ assert "qwen2.5:3b" in content
+
+ def test_set_invalid_key_rejected(self, tmp_path: Path) -> None:
+ """config set rejects unknown keys."""
+ config_file = tmp_path / "config.toml"
+ config_file.write_text("")
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with mock.patch.dict(os.environ, env):
+ result = CliRunner().invoke(
+ cli, ["config", "set", "engine.olllama.host", "http://x:1234"]
+ )
+ assert result.exit_code != 0
+ assert "Unknown config key" in result.output
+
+ def test_set_engine_host_probes_reachable(self, tmp_path: Path) -> None:
+ """config set probes engine host and reports reachability."""
+ config_file = tmp_path / "config.toml"
+ config_file.write_text("")
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with (
+ mock.patch.dict(os.environ, env),
+ mock.patch("openjarvis.cli.config_cmd.httpx") as mock_httpx,
+ ):
+ mock_httpx.get.return_value = mock.Mock(status_code=200)
+ result = CliRunner().invoke(
+ cli,
+ ["config", "set", "engine.ollama.host", "http://myserver:11434"],
+ )
+ assert result.exit_code == 0
+ assert "Reachable" in result.output
+
+ def test_set_engine_host_probes_unreachable(self, tmp_path: Path) -> None:
+ """config set warns when engine host is unreachable, but still writes."""
+ config_file = tmp_path / "config.toml"
+ config_file.write_text("")
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with (
+ mock.patch.dict(os.environ, env),
+ mock.patch("openjarvis.cli.config_cmd.httpx") as mock_httpx,
+ ):
+ mock_httpx.get.side_effect = Exception("Connection refused")
+ result = CliRunner().invoke(
+ cli,
+ ["config", "set", "engine.ollama.host", "http://myserver:11434"],
+ )
+ assert result.exit_code == 0
+ output_lower = result.output.lower()
+ assert "unreachable" in output_lower or "warning" in output_lower
+ content = config_file.read_text()
+ assert "http://myserver:11434" in content
+
+ def test_set_integer_value(self, tmp_path: Path) -> None:
+ """config set coerces integer values."""
+ config_file = tmp_path / "config.toml"
+ config_file.write_text("")
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with mock.patch.dict(os.environ, env):
+ result = CliRunner().invoke(
+ cli, ["config", "set", "intelligence.max_tokens", "2048"]
+ )
+ assert result.exit_code == 0
+ content = config_file.read_text()
+ assert "2048" in content
+
+ def test_set_float_value(self, tmp_path: Path) -> None:
+ """config set coerces float values."""
+ config_file = tmp_path / "config.toml"
+ config_file.write_text("")
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with mock.patch.dict(os.environ, env):
+ result = CliRunner().invoke(
+ cli, ["config", "set", "intelligence.temperature", "0.9"]
+ )
+ assert result.exit_code == 0
+ content = config_file.read_text()
+ assert "0.9" in content
+
+ def test_set_missing_args(self) -> None:
+ """config set with missing args shows usage error."""
+ result = CliRunner().invoke(cli, ["config", "set"])
+ assert result.exit_code != 0
+
+ def test_set_shows_confirmation(self, tmp_path: Path) -> None:
+ """config set prints a confirmation message."""
+ config_file = tmp_path / "config.toml"
+ config_file.write_text("")
+ env = {"OPENJARVIS_CONFIG": str(config_file)}
+ with mock.patch.dict(os.environ, env):
+ result = CliRunner().invoke(
+ cli, ["config", "set", "engine.default", "vllm"]
+ )
+ assert result.exit_code == 0
+ assert "Set" in result.output
+ assert "engine.default" in result.output
diff --git a/tests/cli/test_hints.py b/tests/cli/test_hints.py
index 0ba4797a..67953d16 100644
--- a/tests/cli/test_hints.py
+++ b/tests/cli/test_hints.py
@@ -35,3 +35,13 @@ class TestHintFunctions:
def test_hint_no_model_with_name(self):
msg = hint_no_model("qwen3:8b")
assert "qwen3:8b" in msg
+
+ def test_hint_no_engine_includes_remote_tip(self):
+ msg = hint_no_engine()
+ assert "config set" in msg
+ assert "OLLAMA_HOST" in msg
+
+ def test_hint_no_engine_with_name_includes_remote_tip(self):
+ msg = hint_no_engine("vllm")
+ assert "config set" in msg
+ assert "engine.vllm.host" in msg
diff --git a/tests/cli/test_init_host.py b/tests/cli/test_init_host.py
new file mode 100644
index 00000000..aed663dc
--- /dev/null
+++ b/tests/cli/test_init_host.py
@@ -0,0 +1,117 @@
+"""Tests for ``jarvis init --host`` option."""
+
+from __future__ import annotations
+
+from pathlib import Path
+from unittest import mock
+
+from click.testing import CliRunner
+
+from openjarvis.cli import cli
+from openjarvis.core.config import generate_default_toml, generate_minimal_toml
+
+_NO_DL = "--no-download"
+
+
+class TestInitHost:
+ def test_init_host_writes_to_config(self, tmp_path: Path) -> None:
+ """jarvis init --host writes the host into config.toml."""
+ config_dir = tmp_path / ".openjarvis"
+ config_path = config_dir / "config.toml"
+ with (
+ mock.patch("openjarvis.cli.init_cmd.DEFAULT_CONFIG_DIR", config_dir),
+ mock.patch("openjarvis.cli.init_cmd.DEFAULT_CONFIG_PATH", config_path),
+ mock.patch("openjarvis.cli.init_cmd.PrivacyScanner"),
+ ):
+ result = CliRunner().invoke(
+ cli,
+ [
+ "init",
+ "--engine",
+ "ollama",
+ "--host",
+ "http://192.168.1.50:11434",
+ _NO_DL,
+ ],
+ )
+ assert result.exit_code == 0
+ content = config_path.read_text()
+ assert "http://192.168.1.50:11434" in content
+
+ def test_init_host_with_vllm(self, tmp_path: Path) -> None:
+ """jarvis init --host applies to the selected engine."""
+ config_dir = tmp_path / ".openjarvis"
+ config_path = config_dir / "config.toml"
+ with (
+ mock.patch("openjarvis.cli.init_cmd.DEFAULT_CONFIG_DIR", config_dir),
+ mock.patch("openjarvis.cli.init_cmd.DEFAULT_CONFIG_PATH", config_path),
+ mock.patch("openjarvis.cli.init_cmd.PrivacyScanner"),
+ ):
+ result = CliRunner().invoke(
+ cli,
+ ["init", "--engine", "vllm", "--host", "http://10.0.0.5:8000", _NO_DL],
+ )
+ assert result.exit_code == 0
+ content = config_path.read_text()
+ assert "http://10.0.0.5:8000" in content
+
+ def test_init_host_probes_and_reports(self, tmp_path: Path) -> None:
+ """jarvis init --host shows reachability status."""
+ config_dir = tmp_path / ".openjarvis"
+ config_path = config_dir / "config.toml"
+ with (
+ mock.patch("openjarvis.cli.init_cmd.DEFAULT_CONFIG_DIR", config_dir),
+ mock.patch("openjarvis.cli.init_cmd.DEFAULT_CONFIG_PATH", config_path),
+ mock.patch("openjarvis.cli.init_cmd.PrivacyScanner"),
+ mock.patch("openjarvis.cli.init_cmd.httpx") as mock_httpx,
+ ):
+ mock_httpx.get.side_effect = Exception("Connection refused")
+ result = CliRunner().invoke(
+ cli,
+ ["init", "--engine", "ollama", "--host", "http://bad:11434", _NO_DL],
+ )
+ assert result.exit_code == 0
+ output_lower = result.output.lower()
+ assert "unreachable" in output_lower or "warning" in output_lower
+
+ def test_init_without_host_still_works(self, tmp_path: Path) -> None:
+ """jarvis init without --host still produces valid config."""
+ config_dir = tmp_path / ".openjarvis"
+ config_path = config_dir / "config.toml"
+ with (
+ mock.patch("openjarvis.cli.init_cmd.DEFAULT_CONFIG_DIR", config_dir),
+ mock.patch("openjarvis.cli.init_cmd.DEFAULT_CONFIG_PATH", config_path),
+ mock.patch("openjarvis.cli.init_cmd.PrivacyScanner"),
+ ):
+ result = CliRunner().invoke(cli, ["init", "--engine", "ollama", _NO_DL])
+ assert result.exit_code == 0
+ content = config_path.read_text()
+ assert "[engine]" in content
+
+
+class TestGenerateTomlHost:
+ def test_minimal_toml_with_host(self) -> None:
+ from openjarvis.core.config import HardwareInfo
+
+ hw = HardwareInfo()
+ toml_str = generate_minimal_toml(
+ hw, engine="ollama", host="http://remote:11434"
+ )
+ assert "http://remote:11434" in toml_str
+ assert "[engine.ollama]" in toml_str
+
+ def test_minimal_toml_without_host_has_comment(self) -> None:
+ from openjarvis.core.config import HardwareInfo
+
+ hw = HardwareInfo()
+ toml_str = generate_minimal_toml(hw, engine="ollama")
+ assert "# host" in toml_str
+
+ def test_default_toml_with_host(self) -> None:
+ from openjarvis.core.config import HardwareInfo
+
+ hw = HardwareInfo()
+ toml_str = generate_default_toml(
+ hw, engine="ollama", host="http://remote:11434"
+ )
+ assert "http://remote:11434" in toml_str
diff --git a/tests/core/test_config_key_validation.py b/tests/core/test_config_key_validation.py
new file mode 100644
index 00000000..badc706e
--- /dev/null
+++ b/tests/core/test_config_key_validation.py
@@ -0,0 +1,54 @@
+"""Tests for config key validation."""
+
+from __future__ import annotations
+
+import pytest
+
+from openjarvis.core.config import validate_config_key
+
+
+class TestValidateConfigKey:
+ def test_valid_engine_default(self):
+ field_type = validate_config_key("engine.default")
+ assert field_type is str
+
+ def test_valid_engine_ollama_host(self):
+ field_type = validate_config_key("engine.ollama.host")
+ assert field_type is str
+
+ def test_valid_intelligence_temperature(self):
+ field_type = validate_config_key("intelligence.temperature")
+ assert field_type is float
+
+ def test_valid_intelligence_max_tokens(self):
+ field_type = validate_config_key("intelligence.max_tokens")
+ assert field_type is int
+
+ def test_valid_agent_default_agent(self):
+ field_type = validate_config_key("agent.default_agent")
+ assert field_type is str
+
+ def test_invalid_top_level_key(self):
+ with pytest.raises(ValueError, match="Unknown config key"):
+ validate_config_key("nonexistent.foo")
+
+ def test_invalid_nested_key(self):
+ with pytest.raises(ValueError, match="Unknown config key"):
+ validate_config_key("engine.olllama.host")
+
+ def test_invalid_leaf_key(self):
+ with pytest.raises(ValueError, match="Unknown config key"):
+ validate_config_key("engine.ollama.nonexistent")
+
+ def test_empty_key(self):
+ with pytest.raises(ValueError):
+ validate_config_key("")
+
+ def test_single_segment(self):
+ with pytest.raises(ValueError):
+ validate_config_key("engine")
+
+ def test_hardware_key_rejected(self):
+ """Hardware is auto-detected, not user-settable."""
+ with pytest.raises(ValueError, match="Unknown config key"):
+ validate_config_key("hardware.cpu_count")
diff --git a/uv.lock b/uv.lock
index da90bd67..e6821504 100644
--- a/uv.lock
+++ b/uv.lock
@@ -893,6 +893,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/ae/3a/dbeec9d1ee0844c679f6bb5d6ad4e9f198b1224f4e7a32825f47f6192b0c/cffi-2.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:0a1527a803f0a659de1af2e1fd700213caba79377e27e4693648c2923da066f9", size = 184195, upload-time = "2025-09-08T23:23:43.004Z" },
]
+[[package]]
+name = "cfgv"
+version = "3.5.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334, upload-time = "2025-11-19T20:55:51.612Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" },
+]
+
[[package]]
name = "charset-normalizer"
version = "3.4.4"
@@ -1632,6 +1641,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/3f/27/4570e78fc0bf5ea0ca45eb1de3818a23787af9b390c0b0a0033a1b8236f9/diskcache-5.6.3-py3-none-any.whl", hash = "sha256:5e31b2d5fbad117cc363ebaf6b689474db18a1f6438bc82358b024abd4c2ca19", size = 45550, upload-time = "2023-08-31T06:11:58.822Z" },
]
+[[package]]
+name = "distlib"
+version = "0.4.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/96/8e/709914eb2b5749865801041647dc7f4e6d00b549cfe88b65ca192995f07c/distlib-0.4.0.tar.gz", hash = "sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d", size = 614605, upload-time = "2025-07-17T16:52:00.465Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/33/6b/e0547afaf41bf2c42e52430072fa5658766e3d65bd4b03a563d1b6336f57/distlib-0.4.0-py2.py3-none-any.whl", hash = "sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16", size = 469047, upload-time = "2025-07-17T16:51:58.613Z" },
+]
+
[[package]]
name = "distro"
version = "1.9.0"
@@ -2467,6 +2485,7 @@ wheels = [
name = "griffelib"
version = "2.0.0"
source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/ad/06/eccbd311c9e2b3ca45dbc063b93134c57a1ccc7607c5e545264ad092c4a9/griffelib-2.0.0.tar.gz", hash = "sha256:e504d637a089f5cab9b5daf18f7645970509bf4f53eda8d79ed71cce8bd97934", size = 166312, upload-time = "2026-03-23T21:06:55.954Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/4d/51/c936033e16d12b627ea334aaaaf42229c37620d0f15593456ab69ab48161/griffelib-2.0.0-py3-none-any.whl", hash = "sha256:01284878c966508b6d6f1dbff9b6fa607bc062d8261c5c7253cb285b06422a7f", size = 142004, upload-time = "2026-02-09T19:09:40.561Z" },
]
@@ -2695,6 +2714,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/a8/af/48ac8483240de756d2438c380746e7130d1c6f75802ef22f3c6d49982787/huggingface_hub-0.36.2-py3-none-any.whl", hash = "sha256:48f0c8eac16145dfce371e9d2d7772854a4f591bcb56c9cf548accf531d54270", size = 566395, upload-time = "2026-02-06T09:24:11.133Z" },
]
+[[package]]
+name = "identify"
+version = "2.6.18"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/46/c4/7fb4db12296cdb11893d61c92048fe617ee853f8523b9b296ac03b43757e/identify-2.6.18.tar.gz", hash = "sha256:873ac56a5e3fd63e7438a7ecbc4d91aca692eb3fefa4534db2b7913f3fc352fd", size = 99580, upload-time = "2026-03-15T18:39:50.319Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/46/33/92ef41c6fad0233e41d3d84ba8e8ad18d1780f1e5d99b3c683e6d7f98b63/identify-2.6.18-py2.py3-none-any.whl", hash = "sha256:8db9d3c8ea9079db92cafb0ebf97abdc09d52e97f4dcf773a2e694048b7cd737", size = 99394, upload-time = "2026-03-15T18:39:48.915Z" },
+]
+
[[package]]
name = "idna"
version = "3.11"
@@ -4237,6 +4265,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/df/93/a7b983643d1253bb223234b5b226e69de6cda02b76cdca7770f684b795f5/ninja-1.13.0-py3-none-win_arm64.whl", hash = "sha256:3c0b40b1f0bba764644385319028650087b4c1b18cdfa6f45cb39a3669b81aa9", size = 290806, upload-time = "2025-08-11T15:10:18.018Z" },
]
+[[package]]
+name = "nodeenv"
+version = "1.10.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" },
+]
+
[[package]]
name = "numba"
version = "0.61.2"
@@ -4682,6 +4719,7 @@ dependencies = [
{ name = "python-telegram-bot" },
{ name = "rich" },
{ name = "tomli", marker = "python_full_version < '3.11'" },
+ { name = "tomlkit" },
]
[package.optional-dependencies]
@@ -4734,6 +4772,7 @@ dashboard = [
]
dev = [
{ name = "maturin" },
+ { name = "pre-commit" },
{ name = "pytest" },
{ name = "pytest-asyncio" },
{ name = "pytest-cov" },
@@ -4772,6 +4811,9 @@ inference-cloud = [
{ name = "anthropic" },
{ name = "openai" },
]
+inference-gemma = [
+ { name = "pygemma" },
+]
inference-google = [
{ name = "google-genai" },
]
@@ -4895,7 +4937,9 @@ requires-dist = [
{ name = "pdfplumber", marker = "extra == 'pdf'", specifier = ">=0.10" },
{ name = "playwright", marker = "extra == 'browser'", specifier = ">=1.40" },
{ name = "praw", marker = "extra == 'channel-reddit'", specifier = ">=7.0" },
+ { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=3.0" },
{ name = "pydantic", marker = "extra == 'server'", specifier = ">=2.0" },
+ { name = "pygemma", marker = "extra == 'inference-gemma'", specifier = ">=0.1.3" },
{ name = "pymessenger", marker = "extra == 'channel-messenger'", specifier = ">=0.0.7" },
{ name = "pynostr", marker = "extra == 'channel-nostr'", specifier = ">=0.6" },
{ name = "pynvml", marker = "extra == 'energy-all'", specifier = ">=12.0" },
@@ -4917,6 +4961,7 @@ requires-dist = [
{ name = "tavily-python", marker = "extra == 'tools-search'", specifier = ">=0.3" },
{ name = "textual", marker = "extra == 'dashboard'", specifier = ">=0.80" },
{ name = "tomli", marker = "python_full_version < '3.11'", specifier = ">=2.0" },
+ { name = "tomlkit", specifier = ">=0.12" },
{ name = "torch", marker = "extra == 'memory-colbert'", specifier = ">=2.0" },
{ name = "torch", marker = "extra == 'orchestrator-training'", specifier = ">=2.0" },
{ name = "transformers", marker = "extra == 'orchestrator-training'", specifier = ">=4.40" },
@@ -4930,7 +4975,7 @@ requires-dist = [
{ name = "zeus-ml", extras = ["apple"], marker = "extra == 'energy-apple'" },
{ name = "zulip", marker = "extra == 'channel-zulip'", specifier = ">=0.9" },
]
-provides-extras = ["dev", "inference-mlx", "inference-vllm", "inference-cloud", "inference-google", "inference-litellm", "tools-search", "memory-faiss", "memory-colbert", "memory-pdf", "memory-bm25", "server", "openhands", "gpu-metrics", "energy-amd", "energy-apple", "energy-all", "orchestrator-training", "learning-dspy", "learning-gepa", "channel-telegram", "channel-discord", "channel-slack", "channel-line", "channel-viber", "channel-messenger", "channel-reddit", "channel-mastodon", "channel-xmpp", "channel-rocketchat", "channel-zulip", "channel-twitch", "channel-nostr", "browser", "media", "pdf", "scheduler", "security-signing", "sandbox-wasm", "sandbox-docker", "dashboard", "speech", "speech-deepgram", "eval-wandb", "eval-sheets", "docs"]
+provides-extras = ["dev", "inference-mlx", "inference-vllm", "inference-cloud", "inference-google", "inference-litellm", "inference-gemma", "tools-search", "memory-faiss", "memory-colbert", "memory-pdf", "memory-bm25", "server", "openhands", "gpu-metrics", "energy-amd", "energy-apple", "energy-all", "orchestrator-training", "learning-dspy", "learning-gepa", "channel-telegram", "channel-discord", "channel-slack", "channel-line", "channel-viber", "channel-messenger", "channel-reddit", "channel-mastodon", "channel-xmpp", "channel-rocketchat", "channel-zulip", "channel-twitch", "channel-nostr", "browser", "media", "pdf", "scheduler", "security-signing", "sandbox-wasm", "sandbox-docker", "dashboard", "speech", "speech-deepgram", "eval-wandb", "eval-sheets", "docs"]
[package.metadata.requires-dev]
dev = [{ name = "maturin", specifier = ">=1.12.6" }]
@@ -5601,6 +5646,22 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/96/5c/8af904314e42d5401afcfaff69940dc448e974f80f7aa39b241a4fbf0cf1/prawcore-2.4.0-py3-none-any.whl", hash = "sha256:29af5da58d85704b439ad3c820873ad541f4535e00bb98c66f0fbcc8c603065a", size = 17203, upload-time = "2023-10-01T23:30:47.651Z" },
]
+[[package]]
+name = "pre-commit"
+version = "4.5.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "cfgv" },
+ { name = "identify" },
+ { name = "nodeenv" },
+ { name = "pyyaml" },
+ { name = "virtualenv" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/40/f1/6d86a29246dfd2e9b6237f0b5823717f60cad94d47ddc26afa916d21f525/pre_commit-4.5.1.tar.gz", hash = "sha256:eb545fcff725875197837263e977ea257a402056661f09dae08e4b149b030a61", size = 198232, upload-time = "2025-12-16T21:14:33.552Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/5d/19/fd3ef348460c80af7bb4669ea7926651d1f95c23ff2df18b9d24bab4f3fa/pre_commit-4.5.1-py2.py3-none-any.whl", hash = "sha256:3b3afd891e97337708c1674210f8eba659b52a38ea5f822ff142d10786221f77", size = 226437, upload-time = "2025-12-16T21:14:32.409Z" },
+]
+
[[package]]
name = "primp"
version = "1.1.3"
@@ -6386,6 +6447,16 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/a0/c4/b4d4827c93ef43c01f599ef31453ccc1c132b353284fc6c87d535c233129/pyee-13.0.1-py3-none-any.whl", hash = "sha256:af2f8fede4171ef667dfded53f96e2ed0d6e6bd7ee3bb46437f77e3b57689228", size = 15659, upload-time = "2026-02-14T21:12:26.263Z" },
]
+[[package]]
+name = "pygemma"
+version = "0.1.3.post3"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/ed/23/ec5446b040c35be02431dffcc04f808b2cb8007af03d811b76a4fd3d08a0/pygemma-0.1.3.post3.tar.gz", hash = "sha256:2456accacd5643514ef28b43931261f86ece5e61e1da4fe51e3e0ce7ec0ac109", size = 3997, upload-time = "2024-03-19T02:09:42.599Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/08/51/426d2e3b3b1253bacb281357d698815c432456ad0827d49cc09e456ac3e1/pygemma-0.1.3.post3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:d1a61added2ea6765130b55e12e2fc305afbddb77b2cb88e257fcec91c766464", size = 1650822, upload-time = "2024-03-19T02:09:40.274Z" },
+ { url = "https://files.pythonhosted.org/packages/72/4a/4bd0aafd5e9073c9a4c3926f56bcc681290cc0811479638290fc7e189b7e/pygemma-0.1.3.post3-cp311-cp311-manylinux1_x86_64.whl", hash = "sha256:5a54175b7ecf76b3fcd6df061f7cc7d3eab90c1f0e00b6884ca9948852e3dd04", size = 1848325, upload-time = "2024-03-19T11:14:02.634Z" },
+]
+
[[package]]
name = "pygments"
version = "2.19.2"
@@ -6559,6 +6630,19 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" },
]
+[[package]]
+name = "python-discovery"
+version = "1.2.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "filelock" },
+ { name = "platformdirs" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/9c/90/bcce6b46823c9bec1757c964dc37ed332579be512e17a30e9698095dcae4/python_discovery-1.2.0.tar.gz", hash = "sha256:7d33e350704818b09e3da2bd419d37e21e7c30db6e0977bb438916e06b41b5b1", size = 58055, upload-time = "2026-03-19T01:43:08.248Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/c2/3c/2005227cb951df502412de2fa781f800663cccbef8d90ec6f1b371ac2c0d/python_discovery-1.2.0-py3-none-any.whl", hash = "sha256:1e108f1bbe2ed0ef089823d28805d5ad32be8e734b86a5f212bf89b71c266e4a", size = 31524, upload-time = "2026-03-19T01:43:07.045Z" },
+]
+
[[package]]
name = "python-dotenv"
version = "1.2.1"
@@ -8373,6 +8457,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a", size = 14477, upload-time = "2026-01-11T11:22:37.446Z" },
]
+[[package]]
+name = "tomlkit"
+version = "0.14.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/c3/af/14b24e41977adb296d6bd1fb59402cf7d60ce364f90c890bd2ec65c43b5a/tomlkit-0.14.0.tar.gz", hash = "sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064", size = 187167, upload-time = "2026-01-13T01:14:53.304Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload-time = "2026-01-13T01:14:51.965Z" },
+]
+
[[package]]
name = "torch"
version = "2.10.0"
@@ -8932,6 +9025,22 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/5d/c1/f01846f10c8383b197a67b4cdfea6eea476aab678ed9f6f5d9ccc8c8dddf/viberbot-1.0.12-py3-none-any.whl", hash = "sha256:ca43fea2945d650c2ef2cbd777f3c546c795bf945278f6620ceda42f4101d801", size = 26164, upload-time = "2021-01-27T13:45:43.726Z" },
]
+[[package]]
+name = "virtualenv"
+version = "21.2.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "distlib" },
+ { name = "filelock" },
+ { name = "platformdirs" },
+ { name = "python-discovery" },
+ { name = "typing-extensions", marker = "python_full_version < '3.11'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/aa/92/58199fe10049f9703c2666e809c4f686c54ef0a68b0f6afccf518c0b1eb9/virtualenv-21.2.0.tar.gz", hash = "sha256:1720dc3a62ef5b443092e3f499228599045d7fea4c79199770499df8becf9098", size = 5840618, upload-time = "2026-03-09T17:24:38.013Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/c6/59/7d02447a55b2e55755011a647479041bc92a82e143f96a8195cb33bd0a1c/virtualenv-21.2.0-py3-none-any.whl", hash = "sha256:1bd755b504931164a5a496d217c014d098426cddc79363ad66ac78125f9d908f", size = 5825084, upload-time = "2026-03-09T17:24:35.378Z" },
+]
+
[[package]]
name = "vllm"
version = "0.17.1"