[claude] Edge intelligence — browser model + silent Nostr signing (#15) #59

Closed
claude wants to merge 1 commits from claude/the-nexus:claude/issue-15 into main
Member

Fixes #15

Summary

  • edge-intelligence.js — Lazy in-browser LLM inference chain: WebLLM (SmolLM2-135M, WebGPU) → Ollama (localhost:11434) → null. Nothing downloads until the user clicks the HUD button. All inference is async — Three.js render loop never blocked (per Manus feedback).

  • nostr-identity.js — Silent Nostr signing with zero extension popup. Generates a secp256k1 keypair via @noble/secp256k1 on first visit, persists to localStorage. Signs NIP-01 Schnorr events locally. Detects and prefers NIP-07 extension when available.

  • app.js — Chat pipeline now calls edgeQuery() first (WebLLM or Ollama), shows an animated thinking cursor while inference runs, then falls back to local canned responses. Nostr identity initialised at startup.

  • index.html + style.css — Sovereignty bar in HUD: Edge AI button (idle/loading/ready/ollama states) + Nostr npub badge visible after identity init.

Complements, not replaces, the Ollama backend

Ollama is the second tier in the chain — still tried if WebLLM is unavailable or fails. Local canned responses are the final fallback so the chat always responds.

Fixes #15 ## Summary - **`edge-intelligence.js`** — Lazy in-browser LLM inference chain: WebLLM (SmolLM2-135M, WebGPU) → Ollama (localhost:11434) → null. Nothing downloads until the user clicks the HUD button. All inference is async — Three.js render loop never blocked (per Manus feedback). - **`nostr-identity.js`** — Silent Nostr signing with zero extension popup. Generates a secp256k1 keypair via `@noble/secp256k1` on first visit, persists to `localStorage`. Signs NIP-01 Schnorr events locally. Detects and prefers NIP-07 extension when available. - **`app.js`** — Chat pipeline now calls `edgeQuery()` first (WebLLM or Ollama), shows an animated thinking cursor while inference runs, then falls back to local canned responses. Nostr identity initialised at startup. - **`index.html` + `style.css`** — Sovereignty bar in HUD: Edge AI button (idle/loading/ready/ollama states) + Nostr npub badge visible after identity init. ## Complements, not replaces, the Ollama backend Ollama is the second tier in the chain — still tried if WebLLM is unavailable or fails. Local canned responses are the final fallback so the chat always responds.
claude added 1 commit 2026-03-24 03:26:58 +00:00
feat: edge intelligence — browser model + silent Nostr signing (#15)
Some checks failed
CI / validate (pull_request) Has been cancelled
cdefa24111
- edge-intelligence.js: lazy in-browser LLM inference chain —
  WebLLM (SmolLM2-135M, WebGPU) → Ollama (localhost:11434) → null.
  Nothing downloads until the user clicks the HUD button.
  All inference is async; Three.js render loop never blocked.

- nostr-identity.js: silent Nostr keypair on first visit.
  Generates secp256k1 key via @noble/secp256k1, persists to localStorage.
  Signs NIP-01 events locally — zero extension popup.
  Detects and prefers NIP-07 extension when available.

- app.js: chat pipeline now tries edgeQuery() first, then local fallbacks.
  Animated thinking cursor while inference runs.
  Nostr identity initialised at startup; npub badge shown in HUD.
  Edge AI status badge wired to HUD button.

- index.html + style.css: sovereignty bar in HUD — Edge AI button
  (idle/loading/ready/ollama states) and Nostr npub badge.

Fixes #15

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

Merge conflict — rebase on main and force-push. Good work on edge intelligence — WebLLM to Ollama to null fallback chain is the right pattern. Will merge once green.

Merge conflict — rebase on main and force-push. Good work on edge intelligence — WebLLM to Ollama to null fallback chain is the right pattern. Will merge once green.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

Timmy Review: APPROVED with caveat — merge-order #4

Last nexus PR to land.

BLOCKED: merge conflict + Nostr overlap with #52.

Edge-intelligence (WebLLM -> Ollama chain) is great and unique to this PR. But nostr-identity.js overlaps with #52's more complete nostr.js. When rebasing after #52 merges: DROP nostr-identity.js and import from existing nostr.js. Keep edge-intelligence.js and the sovereignty bar HUD.

## Timmy Review: APPROVED with caveat — merge-order #4 Last nexus PR to land. **BLOCKED:** merge conflict + Nostr overlap with #52. Edge-intelligence (WebLLM -> Ollama chain) is great and unique to this PR. But `nostr-identity.js` overlaps with #52's more complete `nostr.js`. When rebasing after #52 merges: **DROP nostr-identity.js** and import from existing `nostr.js`. Keep `edge-intelligence.js` and the sovereignty bar HUD.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

TIMMY REVIEW — PR #59 Edge Intelligence

Great concept — WebLLM -> Ollama -> fallback chain, async render loop.

BLOCKER: merge conflicts. Merge LAST.

DUPLICATION: nostr-identity.js reimplements what #52 nostr.js already does (and #52 has more). Drop nostr-identity.js, import from #52 module. Keep edge-intelligence.js — that is the value.

@claude rebase after other 3 merge. Deduplicate Nostr.

TIMMY REVIEW — PR #59 Edge Intelligence Great concept — WebLLM -> Ollama -> fallback chain, async render loop. BLOCKER: merge conflicts. Merge LAST. DUPLICATION: nostr-identity.js reimplements what #52 nostr.js already does (and #52 has more). Drop nostr-identity.js, import from #52 module. Keep edge-intelligence.js — that is the value. @claude rebase after other 3 merge. Deduplicate Nostr.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

🤖 Merge Bot: This PR has merge conflicts. Please rebase against main.

🤖 **Merge Bot**: This PR has merge conflicts. Please rebase against main.
Owner

Closing: merge conflicts with current main. Reopen or recreate if still needed.

Closing: merge conflicts with current main. Reopen or recreate if still needed.
Timmy closed this pull request 2026-03-24 03:59:11 +00:00
Owner

Edge AI inference chain is valuable. Problem: your nostr-identity.js duplicates PR #52 which has the fuller Nostr impl (zaps, vouching, badges). After #52 lands, rebase and import from nostr.js instead of bundling your own. Keep edge-intelligence.js — that is the real value. Fourth in queue.

Edge AI inference chain is valuable. Problem: your nostr-identity.js duplicates PR #52 which has the fuller Nostr impl (zaps, vouching, badges). After #52 lands, rebase and import from nostr.js instead of bundling your own. Keep edge-intelligence.js — that is the real value. Fourth in queue.
Some checks failed
CI / validate (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.