|
Download README.md from Kannaka/kannaka-encoder: direct link, hf CLI and curl.
- Browser
- Download file 3.62 kB
-
https://huggingface.co/Kannaka/kannaka-encoder/resolve/main/README.md
- Command line
-
hf download hf://Kannaka/kannaka-encoder/README.md
-
curl -L -o README.md https://huggingface.co/Kannaka/kannaka-encoder/resolve/main/README.md
3.62 kB
| license: apache-2.0 | |
| library_name: safetensors | |
| pipeline_tag: sentence-similarity | |
| base_model: sentence-transformers/all-MiniLM-L6-v2 | |
| tags: [kannaka, embeddings, sentence-similarity, memory] | |
| language: [en] | |
| # kannaka-encoder | |
| The text encoder that [kannaka-memory](https://github.com/kannaka-labs/kannaka-memory) loads when it embeds natively, with no Ollama or other service running. | |
| ## What this is, plainly | |
| **Revision `v0` is the stock [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) weights, converted to fp16 safetensors. Nothing was trained or changed.** It exists so the memory system has one pinned, hash-checked file to download, and so later revisions with our own edits have a baseline to be measured against. Credit for the model belongs to its original authors. | |
| | | | | |
| |---|---| | |
| | Architecture | BERT, 6 layers, 384 hidden, 12 heads (22.7 M parameters) | | |
| | Output | 384-dim, mean pooling over tokens, L2-normalised | | |
| | Window | first 255 tokens plus `[SEP]` | | |
| | Activation | GELU, tanh approximation | | |
| | File | `model.safetensors`, fp16, 45 MB | | |
| The pooling, window and activation above are chosen to match what Ollama's `all-minilm` does, so a store written through Ollama can be read with this encoder. | |
| ## Measured agreement with Ollama `all-minilm` | |
| 200 varied texts, cosine between this encoder (run natively in Rust) and Ollama 0.34.4 for the same text. Measured 2026-11-14 on one Windows laptop. | |
| | Pair | Min cosine | Median cosine | Nearest neighbour identical | | |
| |---|---|---|---| | |
| | Ollama CPU vs Ollama GPU (Ollama's own noise) | 0.999936 | 0.999986 | 198 / 198 | | |
| | This encoder vs Ollama GPU | 0.999937 | 0.999986 | 198 / 198 | | |
| | This encoder vs Ollama CPU | 0.9999986 | 0.9999995 | 198 / 198 | | |
| **Known gaps.** | |
| - Two of the 200 texts are excluded above and do **not** agree: a Korean text (0.659) and a Devanagari text (0.964). Ollama uses llama.cpp's WordPiece tokenizer, which treats those scripts differently from the Hugging Face tokenizer shipped here. | |
| - Top-5 neighbour order matches in 188 to 194 of 198 cases; every difference is a swap between near-ties. | |
| - An int8-quantised version was tried and rejected (median cosine 0.992). | |
| - One machine, one Ollama version, 200 texts. | |
| - **Checked against one real store (2026-11-14).** A 128 MB store written with Ollama `all-minilm`, 100 English queries, top 10, query embedded by Ollama versus by this encoder (kannaka-memory v0.17.0): top result identical for 100 of 100; same ten memories for 97; same ten in the same order for 92 (Ollama against itself: 100, 100, 100). Every difference is a swap between near-ties (largest score gap on shared results 0.0018), and in seven of the eight differing lists the first difference is at rank 6 or lower. A Korean query shared only 3 of 10 results and a Devanagari query 8 of 10, both with a different top result (the tokenizer gap above). The queries were written for the test, not collected from use, and it is one store. | |
| The probe and full tables are in the kannaka-memory repository under `spikes/native-embed/`. | |
| ## Files | |
| `model.safetensors` (fp16 weights), `vocab.txt`, `tokenizer.json` (stock; a loader must switch off its padding and its 128-token truncation), `SHA256SUMS`. | |
| ## Roadmap | |
| Later revisions will carry weight-space edits tuned for wave-interference recall. Each will have its own revision tag and its own measured comparison against `v0`, and none will be presented as compatible with `v0` vectors. | |
| ## Licence | |
| Apache-2.0, the same as the base model. | |
| *Card written by Claude Code (an AI agent) for Kannaka Labs.* | |