Browser Support
Dendrite auto-selects the fastest inference path available: WebGPU (WebLLM) where supported, Transformers.js WASM as a fallback, and an optional cloud API proxy.
Supported Browsers
| Browser | Version | WebGPU (fast) | WASM fallback |
|---|---|---|---|
| Chrome | 113+ | Yes | Yes |
| Edge | 113+ | Yes | Yes |
| Brave | 113+ | Yes | Yes |
| Safari | 18+ | Requires enabling in Feature Flags | Yes |
| Firefox | — | No | Yes (small models) |
| Mobile Chrome | — | No (auto-falls back) | Requires apiUrl in 'auto' mode (local inference disabled on mobile) |
| Mobile Safari | — | No | Requires apiUrl in 'auto' mode |
On mobile in 'auto' mode, local inference is disabled (memory pressure crashes browsers) — Dendrite throws MOBILE_UNSUPPORTED unless apiUrl + username + instanceSlug are configured, in which case it uses the cloud proxy. You can force inference: 'fallback' to attempt Transformers.js WASM with a small model anyway.
Checking Support
ts
import { checkWebGPU } from '@agent-layer-zero/dendrite'
const { available, reason } = checkWebGPU()
if (!available) {
console.log(reason)
// "Firefox does not support WebGPU. Try Chrome or Edge."
// "Enable WebGPU in Safari: Settings > Feature Flags > WebGPU"
// "Mobile browsers do not support WebGPU. Try Chrome on desktop."
}Storage Requirements
Model weights are downloaded once and cached in IndexedDB:
| Model | Download Size | Cache Size |
|---|---|---|
| SmolLM2 360M | ~250 MB | ~350 MB |
| Qwen3 0.6B | ~400 MB | ~500 MB |
| Llama 3.2 1B | ~700 MB | ~900 MB |
| Qwen3 1.7B | ~1.1 GB | ~1.5 GB |
| Gemma 2 2B (default) | ~1.3 GB | ~1.7 GB |
| Llama 3.2 3B | ~1.8 GB | ~2.3 GB |
| Qwen3 4B | ~2.5 GB | ~3.2 GB |
| Llama 3.1 8B | ~4 GB | ~5.0 GB |
| Qwen3 8B | ~4.4 GB | ~5.5 GB |
| Gemma 2 9B | ~5.2 GB | ~6.5 GB |
Cache Recovery
If the model cache gets corrupted (e.g., interrupted download), use:
ts
import { deleteAllModelCaches } from '@agent-layer-zero/dendrite'
await deleteAllModelCaches()
// Then reload the page or call neuron.setModel() againDendrite also auto-recovers on Cache.add() errors — it clears the cache and reloads the page once automatically.
Error Handling
ts
import { classifyError } from '@agent-layer-zero/dendrite'
try {
// ... model loading or generation
} catch (err) {
const { type, message, canClearCache } = classifyError(err)
switch (type) {
case 'quota':
// Storage full — offer to clear cache or pick smaller model
break
case 'network':
// Download failed — check connection
break
case 'webgpu':
// Browser doesn't support WebGPU
break
case 'gpu_pipeline':
// GPU can't run the compute shaders
break
case 'unknown':
// Something else
break
}
if (canClearCache) {
await deleteAllModelCaches()
}
}