Developer quickstart
Embed Evolve LLM
Stream local model output into your own interface through a dedicated worker. The example includes a scripted fixture that needs no GPU or model download.
Run the example
unzip evolve-llm-browser-0.2.0.zip -d evolve-llm
python3 -m http.server 8080 --directory evolve-llm
# Open http://localhost:8080/examples/Open the embedding example → Run its protocol fixture immediately, or explicitly download about 145 MB of SmolLM2 weights from Hugging Face for real GPU inference. Fixture text and timing are scripted; they are not an inference result or benchmark.
The bundle contains the SDK, TypeScript declarations, worker, WASM engine, licenses and example. Serve them on the same origin as your app. No prompts are sent to a provider by the SDK; internet search tools stay off.
Stream tokens
Add <pre id="answer"></pre> to your page, then import the runtime from its directory.
import { createEngine } from './evolve-llm/sdk.mjs';
const engine = createEngine();
const answer = document.querySelector('#answer');
try {
await engine.initialize();
await engine.load('smollm2-135m');
for await (const event of engine.generate([
{ role: 'user', content: 'Explain WebGPU in one sentence.' }
], { maxTokens: 64 })) {
if (event.type === 'token') {
answer.textContent += event.text;
}
}
} finally {
engine.dispose();
}Control the lifecycle
initialize checks the GPU adapter; load accepts a catalog ID or local File objects. generate returns prefill, token and done events. reset clears chat state, and dispose releases the worker permanently. Each client allows one operation at a time.
Pass an AbortSignal to load or generate. Cancellation, a timeout, a worker failure, or breaking an unfinished stream unloads the model. Reload before the next generation. The default deadline is 120 seconds and can be extended explicitly. Stream buffering is bounded to 1,024 events; a slow consumer receives backpressure. Concurrent operations receive busy. There are no automatic generation retries.
What has been run
| Evidence | Scope |
|---|---|
| Browser/native reply comparisons | SmolLM2 135M, Qwen2.5 0.5B, Qwen3 0.6B, Llama 3.2 1B and OLMoE 1B-7B |
| Large catalog architectures | Layout, tokenizer and reference tests; largest models have not run end to end |
| SDK protocol checks | Ordering, cancellation, cleanup, concurrency, timeouts and bounded buffering |
| Executable browser fixture | Real module worker and stream API; scripted output with no inference |
WebGPU availability, storage, model licenses and hardware affect what you can run. Large catalog entries are architecture support, not proof of end-to-end execution or measured speed. Catalog URLs currently use their main revision; retain pinned local model files for reproducible weights.
Existing measured performance and engine verification → · Browser SDK test → · Download checksums and engine provenance →
- Status
- Versioned downloads; source and executable checks linked below
- License
- Apache 2.0
- Built with
- JavaScript, TypeScript declarations, executable examples