bit-ttt-engine 0.6.0__cp310-cp310-win_amd64.whl → 0.6.2__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bit_ttt_engine-0.6.0.dist-info → bit_ttt_engine-0.6.2.dist-info}/METADATA +58 -31
- bit_ttt_engine-0.6.2.dist-info/RECORD +9 -0
- bit_ttt_engine-0.6.2.dist-info/licenses/LICENSE +21 -0
- cortex_rust/cortex_rust.cp310-win_amd64.pyd +0 -0
- bit_ttt_engine-0.6.0.dist-info/RECORD +0 -8
- /bit_ttt_engine-0.6.0.dist-info/licenses/LICENSE → /LICENSE +0 -0
- {bit_ttt_engine-0.6.0.dist-info → bit_ttt_engine-0.6.2.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bit-ttt-engine
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Programming Language :: Rust
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
@@ -10,6 +10,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Summary: 1.58-bit Quantization + Test-Time Training (TTT) Implementation in Pure Rust
|
|
12
12
|
Keywords: llm,rust,ttt,quantization,ai
|
|
13
|
+
Home-Page: https://github.com/imonoonoko/Bit-TTT-Engine
|
|
13
14
|
Author: imonoonoko
|
|
14
15
|
License: MIT
|
|
15
16
|
Requires-Python: >=3.8
|
|
@@ -21,14 +22,13 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
|
21
22
|
[](LICENSE)
|
|
22
23
|
[](https://pypi.org/project/bit-ttt-engine/)
|
|
23
24
|
|
|
24
|
-
**
|
|
25
|
-
|
|
26
|
-
This package provides Python bindings for the Bit-TTT Engine, allowing you to run ultra-light ternary LLMs with real-time adaptation.
|
|
25
|
+
**4-bit Quantization + Test-Time Training (TTT)** Implementation in Pure Rust.
|
|
27
26
|
|
|
28
27
|
## ✨ Features
|
|
29
|
-
1. **
|
|
30
|
-
2. **Adaptive (TTT)**: Learns *while* inferring
|
|
28
|
+
1. **Fast**: **40 tokens/second** on GPU (RTX 4060 Ti).
|
|
29
|
+
2. **Adaptive (TTT)**: Learns *while* inferring - unique to Bit-TTT!
|
|
31
30
|
3. **Pure Rust**: High performance with minimal dependencies.
|
|
31
|
+
4. **Easy**: Load GGUF models directly.
|
|
32
32
|
|
|
33
33
|
## 🚀 Installation
|
|
34
34
|
|
|
@@ -36,13 +36,60 @@ This package provides Python bindings for the Bit-TTT Engine, allowing you to ru
|
|
|
36
36
|
pip install bit-ttt-engine
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
## 💻
|
|
39
|
+
## 💻 Quick Start (GGUF Models)
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from cortex_rust import GgufModel
|
|
43
|
+
|
|
44
|
+
# Load model
|
|
45
|
+
model = GgufModel("model.gguf", tokenizer="tokenizer.json")
|
|
46
|
+
|
|
47
|
+
# Generate text
|
|
48
|
+
output = model.generate(
|
|
49
|
+
"Hello, how are you?",
|
|
50
|
+
max_tokens=50,
|
|
51
|
+
temperature=0.7
|
|
52
|
+
)
|
|
53
|
+
print(output)
|
|
54
|
+
|
|
55
|
+
# Streaming output
|
|
56
|
+
model.generate_with_callback(
|
|
57
|
+
"Tell me a story",
|
|
58
|
+
lambda t: print(t, end="", flush=True),
|
|
59
|
+
max_tokens=100
|
|
60
|
+
)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 🧠 TTT (Test-Time Training)
|
|
64
|
+
|
|
65
|
+
**TTT makes the model adapt during inference** - something no other local LLM can do!
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from cortex_rust import GgufModel
|
|
69
|
+
|
|
70
|
+
model = GgufModel("model.gguf", tokenizer="tokenizer.json")
|
|
71
|
+
|
|
72
|
+
# Enable TTT
|
|
73
|
+
model.enable_ttt(layers=4, learning_rate=0.1)
|
|
74
|
+
|
|
75
|
+
# Without TTT: Pass 1 == Pass 2 (same output)
|
|
76
|
+
# With TTT: Pass 1 != Pass 2 (model is learning!)
|
|
77
|
+
|
|
78
|
+
out1 = model.generate("My name is Alice.", max_tokens=20)
|
|
79
|
+
out2 = model.generate("My name is Alice.", max_tokens=20)
|
|
80
|
+
print(f"Different: {out1 != out2}") # True!
|
|
81
|
+
|
|
82
|
+
# TTT controls
|
|
83
|
+
model.disable_ttt()
|
|
84
|
+
model.reset_ttt_state()
|
|
85
|
+
print(model.ttt_enabled) # False
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 🏗️ Legacy API (BitLlama)
|
|
40
89
|
|
|
41
90
|
```python
|
|
42
91
|
import cortex_rust
|
|
43
|
-
import json
|
|
44
92
|
|
|
45
|
-
# Initialize Configuration
|
|
46
93
|
config = cortex_rust.BitLlamaConfig(
|
|
47
94
|
vocab_size=32000,
|
|
48
95
|
hidden_dim=512,
|
|
@@ -50,34 +97,14 @@ config = cortex_rust.BitLlamaConfig(
|
|
|
50
97
|
inner_lr=0.001
|
|
51
98
|
)
|
|
52
99
|
|
|
53
|
-
# Initialize Model (Inference)
|
|
54
100
|
model = cortex_rust.BitLlama(
|
|
55
101
|
config=config,
|
|
56
102
|
checkpoint_path="path/to/model.safetensors",
|
|
57
|
-
device="cpu",
|
|
103
|
+
device="cpu",
|
|
58
104
|
tokenizer_path="path/to/tokenizer.json"
|
|
59
105
|
)
|
|
60
106
|
|
|
61
|
-
|
|
62
|
-
output = model.generate(prompt="Hello, world!", max_tokens=50)
|
|
63
|
-
print(output)
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## 🏗️ Training (TTT)
|
|
67
|
-
|
|
68
|
-
```python
|
|
69
|
-
trainer = cortex_rust.PyTrainer(
|
|
70
|
-
config=config,
|
|
71
|
-
checkpoint_path="path/to/model.safetensors",
|
|
72
|
-
device="cuda"
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
# Single training step
|
|
76
|
-
loss = trainer.train_step(input_ids=[...], targets=[...])
|
|
77
|
-
print(f"Loss: {loss}")
|
|
78
|
-
|
|
79
|
-
# Save checkpoint
|
|
80
|
-
trainer.save_checkpoint("model_updated.safetensors")
|
|
107
|
+
output = model.generate(prompt="Hello!", max_tokens=50)
|
|
81
108
|
```
|
|
82
109
|
|
|
83
110
|
## 📖 Documentation
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
LICENSE,sha256=JJLZ3h6-sbZqpBjH8srqgZ40NaAKhVqh2oXOM6E2Mak,1088
|
|
2
|
+
bit_ttt_engine-0.6.2.dist-info\METADATA,sha256=p4eog3pP24VjOz964Uu3Ji2V5i_ylwfrNhttA79o1p8,3268
|
|
3
|
+
bit_ttt_engine-0.6.2.dist-info\WHEEL,sha256=GCQ19ZBvayuBQJpz6xNbc8p6I5GMQcns9k4vQBQ8VH8,97
|
|
4
|
+
bit_ttt_engine-0.6.2.dist-info\licenses\LICENSE,sha256=JJLZ3h6-sbZqpBjH8srqgZ40NaAKhVqh2oXOM6E2Mak,1088
|
|
5
|
+
cortex_rust\__init__.py,sha256=USDgfYs5sRU8A4mPwD_Ir4XXHDvnoM-FcUQRUoNVl_g,127
|
|
6
|
+
cortex_rust\__init__.pyi,sha256=pKbj_GxWbSkFTKWmE_32O55dC6PCuDj9up0vRX0aNX4,3069
|
|
7
|
+
cortex_rust\cortex_rust.cp310-win_amd64.pyd,sha256=NAo1Yh1NZNe-6LJBlEBtD1fg9g4zBfuadrXPvZ698Lo,8478208
|
|
8
|
+
cortex_rust\py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
bit_ttt_engine-0.6.2.dist-info\RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 imonoonoko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
bit_ttt_engine-0.6.0.dist-info\METADATA,sha256=v8VzacdRn_nPfu6dY_wAAAwz7CO1D0QCaI8O57WARrc,2707
|
|
2
|
-
bit_ttt_engine-0.6.0.dist-info\WHEEL,sha256=GCQ19ZBvayuBQJpz6xNbc8p6I5GMQcns9k4vQBQ8VH8,97
|
|
3
|
-
bit_ttt_engine-0.6.0.dist-info\licenses\LICENSE,sha256=JJLZ3h6-sbZqpBjH8srqgZ40NaAKhVqh2oXOM6E2Mak,1088
|
|
4
|
-
cortex_rust\__init__.py,sha256=USDgfYs5sRU8A4mPwD_Ir4XXHDvnoM-FcUQRUoNVl_g,127
|
|
5
|
-
cortex_rust\__init__.pyi,sha256=pKbj_GxWbSkFTKWmE_32O55dC6PCuDj9up0vRX0aNX4,3069
|
|
6
|
-
cortex_rust\cortex_rust.cp310-win_amd64.pyd,sha256=Ju1IOk94UUfl4uBtIHMFbV0mJriBcQftdKNQW_EswPo,7783424
|
|
7
|
-
cortex_rust\py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
bit_ttt_engine-0.6.0.dist-info\RECORD,,
|
|
File without changes
|
|
File without changes
|