Skip to content
Ask
Reference

Presets Reference

The @inbrowser/model/local export: the bundled ModelPreset values and the static types they carry.

This page describes the six bundled ModelPreset values exported from @inbrowser/model and the static types they carry.

Spread a preset into createEngine to construct a running engine; see ./engine.md.

TS
import { createEngine, smollm2_360m } from '@inbrowser/model/local';

const engine = createEngine(smollm2_360m);

Bundled presets

Every bundled preset uses dtype: 'q4f16' and backend: 'auto'.

Presetmodel.modelIdcontextWindowsupportsToolssupportsThinkingsupportsVisionsupportsAudiothinkingTags
gemma4_E2Bonnx-community/gemma-4-E2B-it-ONNX128000falsetruefalsetruenone
gemma4_E4Bonnx-community/gemma-4-E4B-it-ONNX128000falsetruefalsetruenone
smollm2_360mHuggingFaceTB/SmolLM2-360M-Instruct8192falsefalsefalsefalsenone
qwen2_5_coder_1_5bonnx-community/Qwen2.5-Coder-1.5B-Instruct32768truefalsefalsefalsenone
qwen3_1_7bonnx-community/Qwen3-1.7B-ONNX32768truefalsefalsefalsenone
deepseek_r1_qwen_1_5bonnx-community/DeepSeek-R1-Distill-Qwen-1.5B-ONNX131072falsetruefalsefalse<think> / </think>

Notes on capability flags:

  • The Gemma 4 presets declare supportsThinking: true but deliberately omit thinkingTags. Their channel-marker emission is inconsistent, so a text-based parser cannot reliably separate thinking from answer. Reasoning streams inline as token events.
  • qwen2_5_coder_1_5b and qwen3_1_7b declare supportsTools: true. The engine threads tools into the chat template and wraps the output with parseToolCalls() when tools are provided.
  • deepseek_r1_qwen_1_5b declares thinkingTags: { openTag: '<think>', closeTag: '</think>' }. These literal-text tags match splitThinking’s defaults; declaring them on the preset lets consumers stay model-agnostic.

ModelPreset

A fully-specified model configuration. Spread into createEngine alongside optional EngineHooks.

FieldTypeDescription
modelModelRefHF Hub locator.
dtypeDtypeWeight/activation precision.
backendBackendONNX Runtime Web execution backend.
capabilitiesEngineCapabilitiesStatic, pre-load capability declaration.
chatTemplate?(messages: ReadonlyArray<EngineMessage>) => stringOptional chat-template override.

ModelRef

FieldTypeDescription
modelIdstringHF Hub repo id.
revision?stringOptional revision. The bundled presets pin no revision.

Dtype

TS
type Dtype = 'q4f16' | 'q8' | 'fp16' | 'fp32';
ValueMeaning
q4f164-bit int weights, fp16 activations.
q88-bit int weights.
fp16Half precision throughout.
fp32Full precision.

Backend

TS
type Backend = 'auto' | 'webgpu' | 'wasm';
ValueMeaning
autoProbe navigator.gpu; fall back to wasm if absent.
webgpuWebGPU compute pipeline.
wasmSIMD CPU fallback. Always available, much slower.

EngineCapabilities

EngineCapabilities is the static capability declaration carried on ModelPreset.capabilities. Its full field table, including thinkingTags, is documented in ./engine.md.

Authoring presets

Community presets are authored with definePreset, the same helper used for the bundled set. See ./engine.md.