Skip to content

Personal AI, On Personal Devices

Python

fix: address installation failures and SDK bugs (#100)

Jon Saad-Falcon59dad5eddfe6
diff --git a/README.md b/README.md
index 0b885e24..54e79dcd 100644
--- a/README.md
+++ b/README.md
@@ -35,8 +35,13 @@ git clone https://github.com/open-jarvis/OpenJarvis.git
cd OpenJarvis
uv sync # core framework
uv sync --extra server # + FastAPI server
+
+# Build the Rust extension (requires Rust: https://rustup.rs/)
+uv run maturin develop -m rust/crates/openjarvis-python/Cargo.toml
```
+> **Python 3.14+:** set `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` before the `maturin` command.
+
You also need a local inference backend: [Ollama](https://ollama.com), [vLLM](https://github.com/vllm-project/vllm), [SGLang](https://github.com/sgl-project/sglang), or [llama.cpp](https://github.com/ggerganov/llama.cpp). Alternatively, use the `cloud` engine with [OpenAI](https://openai.com), [Anthropic](https://anthropic.com), [Google Gemini](https://ai.google.dev), [OpenRouter](https://openrouter.ai), or [MiniMax](https://www.minimax.io) by setting the corresponding API key environment variable.
## Quick Start
diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md
index 9324dbe0..20598dd7 100644
--- a/docs/getting-started/installation.md
+++ b/docs/getting-started/installation.md
@@ -42,9 +42,14 @@ If you prefer to run each step yourself:
git clone https://github.com/open-jarvis/OpenJarvis.git
cd OpenJarvis
uv sync --extra server
+ uv run maturin develop -m rust/crates/openjarvis-python/Cargo.toml
cd frontend && npm install && cd ..
```
+ !!! note "Prerequisites"
+ Requires [Rust](https://rustup.rs/) (`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`).
+ On Python 3.14+, set `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` before the `maturin` command.
+
=== "Step 2: Start Ollama"
```bash
@@ -131,8 +136,11 @@ programmatically. Every feature is accessible from the terminal.
git clone https://github.com/open-jarvis/OpenJarvis.git
cd OpenJarvis
uv sync
+uv run maturin develop -m rust/crates/openjarvis-python/Cargo.toml
```
+Requires [Rust](https://rustup.rs/). On Python 3.14+, set `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` before the `maturin` command.
+
### Verify
```bash
@@ -172,8 +180,11 @@ For programmatic access, the `Jarvis` class provides a high-level sync API.
git clone https://github.com/open-jarvis/OpenJarvis.git
cd OpenJarvis
uv sync
+uv run maturin develop -m rust/crates/openjarvis-python/Cargo.toml
```
+Requires [Rust](https://rustup.rs/). On Python 3.14+, set `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` before the `maturin` command.
+
### Quick example
```python
diff --git a/pyproject.toml b/pyproject.toml
index d6adcaba..f13232dc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -108,8 +108,8 @@ jarvis = "openjarvis.cli:main"
packages = ["src/openjarvis"]
[tool.hatch.build.targets.wheel.force-include]
-"src/openjarvis/agents/claude_code_runner" = "openjarvis/agents/claude_code_runner"
-"src/openjarvis/channels/whatsapp_baileys_bridge" = "openjarvis/channels/whatsapp_baileys_bridge"
+"src/openjarvis/agents/claude_code_runner" = "_node_modules/claude_code_runner"
+"src/openjarvis/channels/whatsapp_baileys_bridge" = "_node_modules/whatsapp_baileys_bridge"
[tool.pytest.ini_options]
testpaths = ["tests"]
diff --git a/scripts/quickstart.sh b/scripts/quickstart.sh
index 1a89b9df..157bf0b6 100755
--- a/scripts/quickstart.sh
+++ b/scripts/quickstart.sh
@@ -146,6 +146,12 @@ info "Installing Python dependencies..."
uv sync --extra server --quiet 2>/dev/null || uv sync --extra server
ok "Python dependencies installed"
+# ── 7b. Build Rust extension ──────────────────────────────────────
+info "Building Rust extension..."
+uv run maturin develop -m rust/crates/openjarvis-python/Cargo.toml --quiet 2>/dev/null \
+ || uv run maturin develop -m rust/crates/openjarvis-python/Cargo.toml
+ok "Rust extension built"
+
# ── 8. Install frontend dependencies ────────────────────────────────
info "Installing frontend dependencies..."
(cd frontend && npm install --silent 2>/dev/null || npm install)
diff --git a/src/openjarvis/agents/claude_code.py b/src/openjarvis/agents/claude_code.py
index 060c226f..59aaefc1 100644
--- a/src/openjarvis/agents/claude_code.py
+++ b/src/openjarvis/agents/claude_code.py
@@ -29,8 +29,16 @@ logger = logging.getLogger(__name__)
_OUTPUT_START = "---OPENJARVIS_OUTPUT_START---"
_OUTPUT_END = "---OPENJARVIS_OUTPUT_END---"
-# Path to the bundled runner source (relative to this module)
+# Path to the bundled runner source (relative to this module).
+# In editable installs this lives next to this file; in wheel installs
+# it is placed under _node_modules/ to avoid namespace package conflicts.
_RUNNER_SRC = Path(__file__).resolve().parent / "claude_code_runner"
+if not _RUNNER_SRC.exists():
+ _RUNNER_SRC = (
+ Path(__file__).resolve().parents[2]
+ / "_node_modules"
+ / "claude_code_runner"
+ )
@AgentRegistry.register("claude_code")
diff --git a/src/openjarvis/channels/whatsapp_baileys.py b/src/openjarvis/channels/whatsapp_baileys.py
index 0bb182be..bfbdd704 100644
--- a/src/openjarvis/channels/whatsapp_baileys.py
+++ b/src/openjarvis/channels/whatsapp_baileys.py
@@ -27,7 +27,15 @@ from openjarvis.core.registry import ChannelRegistry
logger = logging.getLogger(__name__)
# Path to the bundled bridge shipped inside the package.
+# In editable installs this lives next to this file; in wheel installs
+# it is placed under _node_modules/ to avoid namespace package conflicts.
_BRIDGE_SRC = Path(__file__).resolve().parent / "whatsapp_baileys_bridge"
+if not _BRIDGE_SRC.exists():
+ _BRIDGE_SRC = (
+ Path(__file__).resolve().parents[2]
+ / "_node_modules"
+ / "whatsapp_baileys_bridge"
+ )
# Default runtime directory (npm install + auth state).
_DEFAULT_RUNTIME_DIR = Path.home() / ".openjarvis" / "whatsapp_baileys_bridge"
diff --git a/src/openjarvis/core/config.py b/src/openjarvis/core/config.py
index 3db5bc53..5ca8fa77 100644
--- a/src/openjarvis/core/config.py
+++ b/src/openjarvis/core/config.py
@@ -762,7 +762,7 @@ class TelemetryConfig:
class TracesConfig:
"""Trace system settings."""
- enabled: bool = False
+ enabled: bool = True
db_path: str = str(DEFAULT_CONFIG_DIR / "traces.db")
diff --git a/src/openjarvis/engine/_openai_compat.py b/src/openjarvis/engine/_openai_compat.py
index fcc08034..ba7d3870 100644
--- a/src/openjarvis/engine/_openai_compat.py
+++ b/src/openjarvis/engine/_openai_compat.py
@@ -68,7 +68,6 @@ class _OpenAICompatibleEngine(InferenceEngine):
"temperature": temperature,
"max_tokens": max_tokens,
"stream": False,
- "chat_template_kwargs": {"enable_thinking": False},
**kwargs,
}
try:
diff --git a/src/openjarvis/server/api_routes.py b/src/openjarvis/server/api_routes.py
index 24b5a7fe..ca6c93c8 100644
--- a/src/openjarvis/server/api_routes.py
+++ b/src/openjarvis/server/api_routes.py
@@ -179,13 +179,13 @@ traces_router = APIRouter(prefix="/v1/traces", tags=["traces"])
async def list_traces(request: Request, limit: int = 20):
"""List recent traces."""
try:
- from openjarvis.traces.store import TraceStore
- store = TraceStore()
- traces = store.recent(limit=limit)
- items = [
- t.to_dict() if hasattr(t, "to_dict") else str(t)
- for t in traces
- ]
+ from dataclasses import asdict
+
+ store = getattr(request.app.state, "trace_store", None)
+ if store is None:
+ return {"traces": []}
+ traces = store.list_traces(limit=limit)
+ items = [asdict(t) for t in traces]
return {"traces": items}
except Exception as exc:
return {"traces": [], "error": str(exc)}
@@ -194,12 +194,15 @@ async def list_traces(request: Request, limit: int = 20):
async def get_trace(trace_id: str, request: Request):
"""Get a specific trace by ID."""
try:
- from openjarvis.traces.store import TraceStore
- store = TraceStore()
+ from dataclasses import asdict
+
+ store = getattr(request.app.state, "trace_store", None)
+ if store is None:
+ raise HTTPException(status_code=404, detail="Trace not found")
trace = store.get(trace_id)
if trace is None:
raise HTTPException(status_code=404, detail="Trace not found")
- return trace.to_dict() if hasattr(trace, 'to_dict') else {"id": trace_id}
+ return asdict(trace)
except HTTPException:
raise
except Exception as exc:
diff --git a/src/openjarvis/server/app.py b/src/openjarvis/server/app.py
index dce15f4f..e00f0945 100644
--- a/src/openjarvis/server/app.py
+++ b/src/openjarvis/server/app.py
@@ -110,6 +110,18 @@ def create_app(
app.state.agent_scheduler = agent_scheduler
app.state.session_start = time.time()
+ # Wire up trace store if traces are enabled
+ app.state.trace_store = None
+ try:
+ from openjarvis.core.config import load_config
+ from openjarvis.traces.store import TraceStore
+
+ cfg = config if config is not None else load_config()
+ if cfg.traces.enabled:
+ app.state.trace_store = TraceStore(db_path=cfg.traces.db_path)
+ except Exception:
+ pass # traces are optional; don't block server startup
+
app.include_router(router)
app.include_router(dashboard_router)
app.include_router(comparison_router)