πŸš€ vtx-embed-7M-lf2 (base-2bit)

High-performance native 2-bit static embedding model powering vortexa. Native 2-Bit LF2 integer quantization Β· 2.36 MB RAM Β· 7.56M Parameters Β· Fused Numba dequant & mean-pooling Β· Sub-millisecond CPU latency

HuggingFace License: MIT Python 3.8+


⚑ What is LF2?

LF2 is an ultra-compact, integer-native 2-bit quantization format for embedding matrices:

  • Zero FP32 Parameter Tables: Parameters are stored entirely as packed 2-bit levels (4 weights per uint8 byte) and double-quantized uint8 scales and minimums.
  • Extreme Compression: Memory drops from 4.72 MB (LF4 4-bit) down to 2.36 MB (2-bit), retaining 93.52% mean token cosine similarity to full precision.
  • Fused Dequantization & Pooling: Evaluated on-the-fly using Numba JIT kernels directly into registers / L1 cache without allocating full FP32 token tables in RAM.

πŸ“„ Model Details

Property Value
Model Name / Tier vtx-embed-7M-lf2 ("base-2bit")
Total Parameters 7.56M
Quantization Format lf2 (Native 2-bit integer block quantization)
In-RAM Memory 2.36 MB
On-Disk Size 2.36 MB
Embedding Dimension 256
Vocabulary Size 29,528
Block Size 32
Mean Cosine Similarity vs Orig 0.9352
License MIT

πŸ’» Quickstart Usage

Standalone Inference with lf2_native.py

This repository includes lf2_native.py directly for zero-dependency inference (only requires numpy, safetensors, and tokenizers; numba optional for maximum speed):

from huggingface_hub import snapshot_download
import sys

# 1. Download model repository
model_path = snapshot_download(repo_id="VTXAI/vtx-embed-7M-lf2")
sys.path.append(model_path)

from lf2_native import VortexEmbedLF2

# 2. Load model directly from local directory
model = VortexEmbedLF2.from_pretrained(model_path)
print(f"Model In-RAM size: {model.model_size_mb:.2f} MB")

# 3. Encode sentences
texts = [
    "What is the capital of India?",
    "Explain gravity and general relativity",
]
embeddings = model.encode(texts)
print("Embeddings shape:", embeddings.shape)  # (2, 256)

# 4. Semantic similarity
sim = embeddings[0] @ embeddings[1]
print("Cosine Similarity:", sim)

πŸ“œ Citation

@misc{vtx-embed-7m-lf2,
  title  = {vtx-embed-7M-lf2: Native 2-Bit Embeddings for Ultra-Low Footprint Semantic Search},
  author = {VTXAI},
  year   = {2026},
  url    = {https://huggingface.co/VTXAI/vtx-embed-7M-lf2}
}

πŸ“„ License

MIT License β€” free for commercial and research use.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support