Abhaykoul commited on
Commit
c19eead
·
verified ·
1 Parent(s): c965fad

Update README with vortexa core API and Indian examples for nano tier

Browse files
Files changed (1) hide show
  1. README.md +70 -69
README.md CHANGED
@@ -14,6 +14,7 @@ tags:
14
  - ultra-lightweight
15
  - code-search
16
  - retrieval
 
17
  pipeline_tag: feature-extraction
18
  metrics:
19
  - spearman_cosine
@@ -78,12 +79,13 @@ model-index:
78
 
79
  <div align="center">
80
 
81
- # 🚀 vtx-embed-1M
82
 
83
- **The world's most compact 100% data-free distilled embedding model.**
84
- Native 4-Bit quantization · 0.57 MB RAM · 1.05M Parameters · 1.14M Tokens/sec CPU Latency
85
 
86
- [![HuggingFace](https://img.shields.io/badge/🤗%20HuggingFace-VTXAI%2Fvtx--embed--1M-blue)](https://huggingface.co/VTXAI/vtx-embed-1M)
 
87
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
88
  [![Python 3.8+](https://img.shields.io/badge/Python-3.8%2B-blue)](https://python.org)
89
 
@@ -91,87 +93,86 @@ Native 4-Bit quantization · 0.57 MB RAM · 1.05M Parameters · 1.14M Tokens/sec
91
 
92
  ---
93
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  ## 📄 Model Details
95
 
96
  | Property | Value |
97
  | :--- | :--- |
98
- | **Model Type** | Native 4-Bit Data-Less Distilled Embedding (LF4) |
99
- | **Total Parameters** | **1.05M (1,048,576 parameters)** |
100
  | **Tensor Storage Format** | `lf4` — 4-bit per-block with FP16 scale + zero |
101
- | **In-RAM Memory** | **0.57 MB (570 KB)** |
102
- | **On-Disk Size** | **0.57 MB (570 KB)** |
103
  | **Vocabulary Size** | 16,384 |
104
  | **Max Sequence Length** | 512 tokens |
105
- | **Output Dimensions** | 64 *(Matryoshka: also 32)* |
106
  | **Pooling** | SIF IDF-weighted + PC-1 removal |
107
- | **Distillation Type** | 100% Data-Free SVD Subspace Reconstruction |
108
  | **License** | MIT |
109
 
110
  ---
111
 
112
- ## 📊 MTEB Benchmark Results (Exact Empirical Scores)
113
-
114
- All scores below were produced by running evaluation across all benchmark tasks directly against `vtx-embed-1M`:
115
 
116
- ### Semantic Textual Similarity (STS)
117
-
118
- | Dataset | Metric | **vtx-embed-1M (0.57 MB)** | **vtx-embed-7M (4.72 MB)** | MiniLM-L6-v2 (90 MB) | bge-small-en-v1.5 (134 MB) |
119
- | :--- | :---: | :---: | :---: | :---: | :---: |
120
- | **STSBenchmark** | Spearman ρ | **0.7149** | **0.7918** | 0.8284 | 0.8278 |
121
- | **SICK-R** | Spearman ρ | **0.5916** | **0.6294** | 0.7572 | 0.7460 |
122
-
123
- ### Classification
124
-
125
- | Dataset | Metric | **vtx-embed-1M (0.57 MB)** | **vtx-embed-7M (4.72 MB)** | MiniLM-L6-v2 (90 MB) | bge-small-en-v1.5 (134 MB) |
126
- | :--- | :---: | :---: | :---: | :---: | :---: |
127
- | **Banking77Classification** | Accuracy | **0.8384** | **0.7043** | 0.7451 | 0.7884 |
128
- | **AmazonCounterfactualClassification** | Accuracy | **0.7731** | **0.6679** | 0.7371 | 0.7279 |
129
-
130
- ### Clustering
131
-
132
- | Dataset | Metric | **vtx-embed-1M (0.57 MB)** | **vtx-embed-7M (4.72 MB)** | MiniLM-L6-v2 (90 MB) | bge-small-en-v1.5 (134 MB) |
133
- | :--- | :---: | :---: | :---: | :---: | :---: |
134
- | **TwentyNewsgroupsClustering** | V-Measure | **0.2511** | **0.2936** | 0.3529 | 0.4419 |
135
- | **RedditClustering** | V-Measure | **0.3762** | **0.3880** | 0.4342 | 0.5376 |
136
 
137
  ---
138
 
139
- ## Efficiency & Throughput Benchmark
140
-
141
- *Evaluated directly on CPU execution over 1,158 codebase files (900k+ tokens):*
142
 
143
- | Model | RAM Size | Throughput | Single File Latency | Tool Routing Accuracy |
144
- | :--- | :-: | :-: | :-: | :-: |
145
- | **vtx-embed-1M (64-dim)** | **0.57 MB** | **1,139,267 Tokens/sec** | **0.682 ms** | **100.0% (20/20)** |
146
- | **vtx-embed-7M (256-dim)** | **4.72 MB** | 878,578 Tokens/sec | 0.841 ms | **100.0% (20/20)** |
147
- | LiquidAI/LFM2.5-Embedding-350M | ~700 MB | ~137 texts/sec | 7.30 ms | — |
148
- | sentence-transformers/all-MiniLM-L6-v2 | 90 MB | ~80 texts/sec | 12.4 ms | — |
149
-
150
- > **vtx-embed-1M is 157× smaller than MiniLM-L6-v2 while achieving 0.8384 Banking77 Accuracy and 100% Agent Tool Search Accuracy.**
151
-
152
- ---
153
-
154
- ## 💻 Quickstart
155
-
156
- ### Installation
157
-
158
- ```bash
159
- pip install numpy tokenizers safetensors huggingface_hub
160
- ```
161
-
162
- ### Python Inference
163
 
164
  ```python
165
- from vortex_embed.src.lf4_v4_5 import VortexEmbedV4_5
166
-
167
- # Load 1M model from Hugging Face
168
- model = VortexEmbedV4_5.from_pretrained("VTXAI/vtx-embed-1M")
169
-
170
- sentences = ["Execute terminal command", "Run bash shell process in background"]
171
- embeddings = model.encode(sentences, normalize=True) # (2, 64) float32
172
-
173
- sim = (embeddings[0] * embeddings[1]).sum()
174
- print(f"Similarity: {sim:.4f}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  ```
176
 
177
  ---
@@ -179,8 +180,8 @@ print(f"Similarity: {sim:.4f}")
179
  ## 📜 Citation
180
 
181
  ```bibtex
182
- @misc{vtx-embed-1M,
183
- title = {vtx-embed-1M: Data-Free Matrix Distillation for Sub-Megabyte Embeddings},
184
  author = {VTXAI},
185
  year = {2026},
186
  url = {https://huggingface.co/VTXAI/vtx-embed-1M}
@@ -191,4 +192,4 @@ print(f"Similarity: {sim:.4f}")
191
 
192
  ## 📄 License
193
 
194
- MIT License
 
14
  - ultra-lightweight
15
  - code-search
16
  - retrieval
17
+ - vortexa
18
  pipeline_tag: feature-extraction
19
  metrics:
20
  - spearman_cosine
 
79
 
80
  <div align="center">
81
 
82
+ # 🚀 vtx-embed-1M (`nano`)
83
 
84
+ **The world's most memory-efficient static embedding model powering [vortexa](https://github.com/OEvortex/vortexa).**
85
+ Native 4-Bit quantization · 0.57 MB RAM · 1.05M Parameters · Matryoshka MRL · Sub-millisecond CPU latency
86
 
87
+ [![HuggingFace](https://img.shields.io/badge/🤗%20HuggingFace-VTXAI%2Fvtx-embed-1M-blue)](https://huggingface.co/VTXAI/vtx-embed-1M)
88
+ [![GitHub Vortexa](https://img.shields.io/badge/GitHub-OEvortex%2Fvortexa-black?logo=github)](https://github.com/OEvortex/vortexa)
89
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
90
  [![Python 3.8+](https://img.shields.io/badge/Python-3.8%2B-blue)](https://python.org)
91
 
 
93
 
94
  ---
95
 
96
+ ## ⚡ Integration with Vortexa
97
+
98
+ This model powers **[vortexa](https://github.com/OEvortex/vortexa)** — a standalone codebase indexing and semantic search engine designed for AI agents and developers.
99
+
100
+ `vortexa` builds a persistent, hybrid search index over source code using:
101
+ - **Dense Retrieval**: Driven natively by `vtx-embed-1M` (on-the-fly LF4 4-bit dequantization, SIF+PC pooling, Matryoshka truncation).
102
+ - **Sparse Retrieval**: BM25 keyword scoring for exact symbol matches.
103
+ - **AST-Aware Chunking**: Tree-sitter powered chunking respecting function and class boundaries.
104
+ - **LMDB Storage**: Fast, persistent vector and document chunk storage.
105
+
106
+ ---
107
+
108
  ## 📄 Model Details
109
 
110
  | Property | Value |
111
  | :--- | :--- |
112
+ | **Model Name / Tier** | **vtx-embed-1M** (`"nano"`) |
113
+ | **Total Parameters** | **1.05M** |
114
  | **Tensor Storage Format** | `lf4` — 4-bit per-block with FP16 scale + zero |
115
+ | **In-RAM Memory** | **0.57 MB** |
116
+ | **On-Disk Size** | **0.57 MB** |
117
  | **Vocabulary Size** | 16,384 |
118
  | **Max Sequence Length** | 512 tokens |
119
+ | **Output Dimensions** | 64 *(Matryoshka supported)* |
120
  | **Pooling** | SIF IDF-weighted + PC-1 removal |
121
+ | **Primary Engine Integration** | [OEvortex/vortexa](https://github.com/OEvortex/vortexa) |
122
  | **License** | MIT |
123
 
124
  ---
125
 
126
+ ## 📊 Official Benchmark Results
 
 
127
 
128
+ | Dataset | Metric | **vtx-embed-1M (0.57 MB)** | MiniLM-L6-v2 (90 MB) | bge-small-en-v1.5 (134 MB) |
129
+ | :--- | :---: | :---: | :---: | :---: |
130
+ | **STSBenchmark** | Spearman ρ | **0.7149** | 0.8284 | 0.8278 |
131
+ | **SICK-R** | Spearman ρ | **0.5916** | 0.7572 | 0.7460 |
132
+ | **Banking77Classification** | Accuracy | **0.8384** | 0.7451 | 0.7884 |
133
+ | **AmazonCounterfactual** | Accuracy | **0.7731** | 0.7371 | 0.7279 |
134
+ | **TwentyNewsgroups** | V-Measure | **0.2511** | 0.3529 | 0.4419 |
135
+ | **RedditClustering** | V-Measure | **0.3762** | 0.4342 | 0.5376 |
 
 
 
 
 
 
 
 
 
 
 
 
136
 
137
  ---
138
 
139
+ ## 💻 Quickstart Usage
 
 
140
 
141
+ ### Native Vortexa Core API
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  ```python
144
+ from vortexa.core.inference import VortexEmbedInference, similarity
145
+
146
+ # Load model using the "nano" model alias
147
+ model = VortexEmbedInference("nano")
148
+
149
+ queries = [
150
+ "What is the capital of India?",
151
+ "Explain gravity and general relativity",
152
+ ]
153
+ documents = [
154
+ "The capital of India is New Delhi.",
155
+ "Gravity is a fundamental interaction that causes mutual attraction between all things with mass or energy.",
156
+ ]
157
+
158
+ # 1. Encode queries and documents
159
+ query_embeddings = model.encode(queries)
160
+ document_embeddings = model.encode(documents)
161
+
162
+ # 2. Compute similarity matrix directly
163
+ similarity_matrix = query_embeddings @ document_embeddings.T
164
+ print("Similarity Matrix:")
165
+ print(similarity_matrix)
166
+ # Example output:
167
+ # [[0.82, 0.12],
168
+ # [0.11, 0.74]]
169
+
170
+ # 3. Use built-in model similarity method
171
+ scores = model.similarity(query_embeddings, document_embeddings)
172
+
173
+ # 4. Single query against document list lookup
174
+ scores_single = model.similarity("What is the capital of India?", documents)
175
+ print("Single query scores:", scores_single)
176
  ```
177
 
178
  ---
 
180
  ## 📜 Citation
181
 
182
  ```bibtex
183
+ @misc{vtx-embed-1m},
184
+ title = {vtx-embed-1M: Native 4-Bit Embeddings for Standalone Codebase Indexing},
185
  author = {VTXAI},
186
  year = {2026},
187
  url = {https://huggingface.co/VTXAI/vtx-embed-1M}
 
192
 
193
  ## 📄 License
194
 
195
+ MIT License — free for commercial and research use.