Everything you need to build with .elf, run Forge, and use the browser tools.
webelves is a suite of browser-native AI tools built around a single portable format: .elf. An .elf file is a self-contained HTML document bundling a knowledge corpus, a search index, optionally a language model, and a chat interface. Open it in any modern browser — offline, forever.
The stack has two layers:
.elf artifacts at scale. Pro+ tier.Navigate to any Open-tier tool and start immediately:
These are real static .elf files. Open them directly in the browser — no install, server, or API key.
pip install forge-elf
forge loop --seeds my-topics.yaml
An .elf file is a valid HTML document. All data is embedded inline as <script> tags — no external files, no CDN dependencies for core functionality. The format is versioned; this describes v0.2.
Every .elf has exactly one manifest block:
<script type="application/json" id="elf-manifest">
{
"version": "0.2",
"title": "Bayes Theorem",
"fingerprint": "sha256:a3f9...",
"resources": [
{ "id": "corpus-0", "role": "segment-set", "encoding": "base64" },
{ "id": "runtime", "role": "runtime", "encoding": "inline" }
]
}
</script>
The manifest is serialized using RFC 8785 JCS (JSON Canonicalization Scheme) before hashing. Key ordering is lexicographic, no insignificant whitespace.
The corpus is a JSON array of passage objects, base64-encoded, embedded in a resource script block:
<script type="application/octet-stream" id="corpus-0">
<!-- base64-encoded JSON array -->
</script>
Each passage object:
| Field | Type | Description |
|---|---|---|
id | string | Unique passage identifier |
text | string | The passage text |
source | string | Source document title or URL |
embedding | number[] | Pre-computed embedding vector (optional) |
The runtime is a self-contained JavaScript module inlined into the HTML. Two implementations ship:
SharedArrayBuffer (COOP/COEP headers).If no model is present, the runtime falls back to BM25 keyword search over the corpus — still fully functional, no AI inference required.
Identity is derived from content, not file path or timestamp:
fingerprint = "sha256:" + hex(SHA256(JCS(manifest)))
The same artifact — same title, same passages, same resources — always produces the same fingerprint. This makes .elf files content-addressable and auditable without a server.
Forge is a Python package. Python 3.10+ required. No Node.js dependencies.
pip install forge-elf
# verify
forge --version
A seeds file is a YAML list of topics to synthesize. Each entry can be a bare string or a structured object:
# Simple list
topics:
- Bayes Theorem
- Kalman Filter
- PageRank algorithm
# Structured (with hints)
topics:
- title: Bayes Theorem
hints:
- posterior probability
- likelihood ratio
- conjugate priors
depth: thorough # brief | standard | thorough
lang: en
| Command | What it does |
|---|---|
forge loop | Run the full generate → judge → refine → package loop |
forge build | Build a single .elf from an existing article JSON |
forge judge | Run the discriminator on a candidate article |
forge status | Show pipeline status for a seeds file run |
# Full pipeline (cloud key)
forge loop --seeds topics.yaml --workers 4
# Fully offline (local SmolLM2 or Mistral)
forge loop --offline --seeds topics.yaml
# Single topic, build only
forge build --topic "Bayes Theorem" --out bayes.elf.html
The discriminator scores each article against a YAML rubric. Default rubric ships with Forge; override per-domain:
# rubric.yaml
rubric:
accuracy:
weight: 0.4
criteria: "Claims are factually correct and supported by sources"
clarity:
weight: 0.3
criteria: "Explanation is understandable to a non-expert"
depth:
weight: 0.2
criteria: "Topic is covered with sufficient detail"
citations:
weight: 0.1
criteria: "At least 2 distinct sources referenced"
pass_threshold: 0.72
max_retries: 3
forge loop --seeds topics.yaml --rubric rubric.yaml
NotebookELF is a browser studio for building and chatting with knowledge bases, then exporting them as portable .elf files.
From the notebook workspace, open the Sources panel (left). You can:
Ask anything in the Chat panel (center). Every answer includes structured citations — passage ID, source title, and the exact text span the answer drew from. Citations are machine-readable, not decoration.
Hit Build in the toolbar. NotebookELF packages all sources, embeddings, and the chat runtime into one .elf.html file. Download it. Share it. Open it on any machine — offline.
Webelves is a browser-native local search engine — Perplexity-style grounded answers, all inference client-side.
On first load, Webelves downloads the default model (SmolLM2-360M-Instruct) and caches it in OPFS. Subsequent loads are instant — the model is already on disk, and inference runs fully offline.
Type a question. Webelves:
[N] citationsWebelves requires a search backend. Options:
localhost:8080, set in Settings.# Quick SearXNG with Docker
docker run -d -p 8080:8080 searxng/searxng
Codelves is a browser-native Python IDE powered by Pyodide — the full CPython runtime compiled to WebAssembly.
NumPy and Matplotlib are pre-installed. Install others at runtime:
import micropip
await micropip.install('scikit-learn')
from sklearn.linear_model import LinearRegression
Figures are captured and rendered as images inline in the output panel — no display server needed.
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 2*np.pi, 100)
plt.plot(x, np.sin(x))
plt.title('sin(x)')
plt.show() # renders inline
End-to-end walkthrough — from a topic list to an offline-ready .elf artifact.
# my-topics.yaml
topics:
- title: Bayesian inference
hints: [posterior, prior, likelihood, Bayes rule]
depth: thorough
- title: Kalman filter
hints: [state estimation, prediction, update step]
depth: standard
# with an API key (fastest)
export ELF_LLM_API_KEY=sk-ant-...
forge loop --seeds my-topics.yaml --workers 2
# fully offline (local model)
forge loop --offline --seeds my-topics.yaml
Forge writes progress to output/run-{timestamp}/:
output/
run-20260519-143200/
bayesian-inference.elf.html ✓ accepted
kalman-filter.elf.html ✓ accepted
run.log # full generate/judge/refine trace
Serve the output directory with any static HTTP server (required for COEP headers if the .elf uses a GGUF model):
node website/server.mjs
# or
python -m http.server 8000
Navigate to output/run-.../bayesian-inference.elf.html. The chat interface loads. Ask it anything — all inference runs locally in your browser tab.