At a glance
| Model card | Alibaba-NLP/gte-base-en-v1.5 |
|---|---|
| Task & pooling |
sentence-similarity via feature-extraction
(1_Pooling/config.json: pooling: "cls", normalize: true)
|
| Architecture |
GteModel (model_type: "gte", 12 layers, 12 heads, 768-d hidden, 3072 FFN,
linear RoPE rope_theta=1,000,000, ~137M params, 30,528 WordPiece vocab)
|
| Context window |
8,192 tokens (max_position_embeddings: 8192; worker raises
tokenizer.model_max_length from tokenizer_config.json's
max_length: 512)
|
| Quantization & size | q8 CPU WASM — 146.54 MB (onnx/model_quantized.onnx, 146,540,971 bytes) |
| License & runtime | apache-2.0 · shared ../../lib/webai.js (WebAssembly + module Web Worker) |
Run it — live 768-d sentence similarity explorer
1_Pooling/config.json, Alibaba-NLP/gte-base-en-v1.5 encodes the normalized
[CLS] hidden state (pooling: "cls") into a [1, 768] vector with
symmetric query/passage prompting. Use Audit CLS vs Mean below to inspect live ranking drift
if mean pooling is mistakenly substituted.
Tip: drag and drop a file onto this zone or press Ctrl/⌘+V anywhere outside an input to replace the candidate passages.
Live Pooling Audit (Model-Card [CLS] vs Mean Pooling)
| Passage | CLS rank | CLS cos | Mean rank | Mean cos | Delta (CLS − Mean) |
|---|
Query → Candidate Cosine Ranking
- Waiting for live model inference…
Pairwise Candidate Cosine Heatmap
Cosine heatmap renders after embedding runs.
See inside — 768-d vector sparkline & 16-bin histogram
Inspect the actual L2-normalized 768-d [CLS] vector emitted by
Alibaba-NLP/gte-base-en-v1.5 with truncation slice markers (128d,
256d, 512d), real countNonFinite() health checks, and top-magnitude
coordinates.
Embed texts above to inspect vector coordinates.
Why it matters — 8K-context retrieval without a GPU
Most compact browser embedders clip at 512 tokens. GTE-Base EN v1.5 brings an
8,192-token rotary attention window and 768-d semantic fidelity into
146.54 MB of CPU WASM q8 weights under an Apache-2.0 license — indexing entire
technical RFCs, multi-clause contracts, and long support threads in one local pass with zero data egress.
- No 512-token blind spots: encode multi-page runbooks and policy appendices directly in browser memory.
- Compressible 768-d index vectors: evaluate
768d → 128dslicing,int8(4×), and1-bit binary(32×) trade-offs live. - End-to-end 8K RAG: retrieve Top-K long chunks with GTE-Base v1.5, then rerank jointly with an 8K ALiBi cross-encoder.
Use-case ladder
-
Basics — 8K Rotary Scaling & 768d → 1-Bit Quantization Lab:
benchmark real WASM token latency up to 2,048–4,096 tokens, compare 512-tok cutoff vs 8K needle recall,
and measure
768d → 512d → 256d → 128d → int8 → 1-bit binaryretention. - Practical — Long-Doc RAG Chunker, Topic Clusterer & Duplicate Audit: cancellable FIFO batch indexing, RFC 4180 ragged CSV/JSON/MD/TXT upload, cosine threshold slider, and OWASP formula-safe exports.
- Wild — 2D PCA Semantic Constellation & Adversarial Stress Lab: keyboard-navigable 2D PCA map + 5 adversarial probes (negation, antonyms, overlap trap, long-tail needle at depth, paraphrase invariance) + custom A/B/C tester.
-
Multi-model — 184.8 MB 8K Bi-Encoder + 8K Cross-Encoder RAG Studio:
chain
Alibaba-NLP/gte-base-en-v1.5(146.54 MB) withjinaai/jina-reranker-v1-turbo-en(38.30 MB) to inspect live Spearmanρand rank-shift bump charts.
How the API works
import { pipeline } from "@huggingface/transformers";
const extractor = await pipeline(
"feature-extraction",
"Alibaba-NLP/gte-base-en-v1.5",
{ device: "wasm", dtype: "q8" },
);
extractor.tokenizer.model_max_length = 8192;
const output = await extractor(
["How does RoPE extend context?", "Rotary embeddings encode relative offsets up to 8,192 tokens."],
{ pooling: "cls", normalize: true },
);
// output.dims -> [2, 768] L2-normalized float32 embeddings