File size: 2,991 Bytes
5cf587e 162bb78 5cf587e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | ---
license: other
license_name: snapkitty-tri-license
license_link: https://huggingface.co/Snapkitty/sovlm/blob/main/LICENSE.tri
tags:
- snapkitty
- machine-learning
- python
---
> Source: [github.com/SNAPKITTYWEST/sovlm](https://github.com/SNAPKITTYWEST/sovlm)
# sovlm





**Sovereign Statistical Language Model.**
N-grams + Kneser-Ney + BM25 Retrieval + QRNG sampling.
No training. No backprop. No GPU. Pure governance.
Part of the SnapKitty Collective sovereign AI stack.
---
## Install
```bash
pip install -e ".[dev]"
# or
uv pip install -e ".[dev]"
```
## Usage
```bash
# Build from your corpus (Lean proofs, Prolog, docs, anything)
sovlm build data/*.lean data/*.pl data/*.md --order 4
# Generate
sovlm generate -p "theorem main : " -m 200
# Stream
sovlm generate -p "The 49th Call is" --stream
# Quantum RNG sampling
sovlm generate -p "lemma " --qrng
# Serve HTTP API
sovlm serve --port 8080
```
## Python API
```python
from sovlm import Generator, build_from_paths
from pathlib import Path
# Build
d, ng, sg, inv, fz = build_from_paths([Path("corpus.md")], ...)
# Generate
gen = Generator(d, kn, sg, fz, inv, blender, sampler)
result = gen.generate("theorem xor_assoc : ", max_tokens=100)
```
## Architecture
| Component | Role |
|---|---|
| `Dictionary` | Vocabulary sovereignty β you own the tokens |
| `NGramIndex` | Local coherence β what follows what |
| `KneserNey` | Smoothing β handle unseen contexts |
| `SkipGramIndex` | Structural patterns at distance |
| `FuzzyPrefixIndex` | LSH near-miss β graceful degradation |
| `InvertedIndex + BM25` | Retrieval β what's relevant in corpus |
| `Blender` | Arbitration β Markov vs retrieval |
| `Sampler + QRNG` | Entropy β unbiased, quantum-seeded choice |
## SnapKitty Stack Integration
```
sovlm βββΊ abjad-machine (SUBLEQ address space)
βββΊ sovereign-transformer (plasma gate)
βββΊ the-49th-call (Lean 4 verified)
βββΊ bob-orchestrator (Byzantine council)
```
---
*Ahmad Ali Parr Β· SnapKitty Collective Β· 2026*
---
## License
Licensed under **SnapKitty Tri-License**. Full text: [LICENSE.tri](LICENSE.tri).
### πΌ Commercial License
Snapkitty code is free and open under **AGPL-3.0** for open-source use. Building a commercial product or service? A **proprietary commercial license** from Snapkitty Collective LLC lets you ship this code without the AGPL's source-sharing and network-use obligations.
**[β Get a commercial license](mailto:A.parr@belespritdaccord.uk?subject=Commercial%20license:%20sovlm)** Β· A.parr@belespritdaccord.uk
|