bit-ttt-engine 0.6.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bit-ttt-engine
3
- Version: 0.6.1
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
@@ -22,14 +22,13 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
22
22
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
23
23
  [![PyPI](https://img.shields.io/pypi/v/bit-ttt-engine.svg)](https://pypi.org/project/bit-ttt-engine/)
24
24
 
25
- **1.58-bit Quantization + Test-Time Training (TTT)** Implementation in Pure Rust.
26
-
27
- 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.
28
26
 
29
27
  ## ✨ Features
30
- 1. **Ultra-Light**: Runs large LLMs on cheap hardware using **1.58-bit (ternary) weights**.
31
- 2. **Adaptive (TTT)**: Learns *while* inferring, adapting to context in real-time.
28
+ 1. **Fast**: **40 tokens/second** on GPU (RTX 4060 Ti).
29
+ 2. **Adaptive (TTT)**: Learns *while* inferring - unique to Bit-TTT!
32
30
  3. **Pure Rust**: High performance with minimal dependencies.
31
+ 4. **Easy**: Load GGUF models directly.
33
32
 
34
33
  ## 🚀 Installation
35
34
 
@@ -37,13 +36,60 @@ This package provides Python bindings for the Bit-TTT Engine, allowing you to ru
37
36
  pip install bit-ttt-engine
38
37
  ```
39
38
 
40
- ## 💻 Usage
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)
41
89
 
42
90
  ```python
43
91
  import cortex_rust
44
- import json
45
92
 
46
- # Initialize Configuration
47
93
  config = cortex_rust.BitLlamaConfig(
48
94
  vocab_size=32000,
49
95
  hidden_dim=512,
@@ -51,34 +97,14 @@ config = cortex_rust.BitLlamaConfig(
51
97
  inner_lr=0.001
52
98
  )
53
99
 
54
- # Initialize Model (Inference)
55
100
  model = cortex_rust.BitLlama(
56
101
  config=config,
57
102
  checkpoint_path="path/to/model.safetensors",
58
- device="cpu", # or "cuda"
103
+ device="cpu",
59
104
  tokenizer_path="path/to/tokenizer.json"
60
105
  )
61
106
 
62
- # Generate Text
63
- output = model.generate(prompt="Hello, world!", max_tokens=50)
64
- print(output)
65
- ```
66
-
67
- ## 🏗️ Training (TTT)
68
-
69
- ```python
70
- trainer = cortex_rust.PyTrainer(
71
- config=config,
72
- checkpoint_path="path/to/model.safetensors",
73
- device="cuda"
74
- )
75
-
76
- # Single training step
77
- loss = trainer.train_step(input_ids=[...], targets=[...])
78
- print(f"Loss: {loss}")
79
-
80
- # Save checkpoint
81
- trainer.save_checkpoint("model_updated.safetensors")
107
+ output = model.generate(prompt="Hello!", max_tokens=50)
82
108
  ```
83
109
 
84
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.1.dist-info\METADATA,sha256=huxZqMaXS_Pp4UFFps1vn_PVktllcux8T-ua-b4V5is,2763
2
- bit_ttt_engine-0.6.1.dist-info\WHEEL,sha256=GCQ19ZBvayuBQJpz6xNbc8p6I5GMQcns9k4vQBQ8VH8,97
3
- bit_ttt_engine-0.6.1.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=v7NUfIbEVGnTu-ZmIa4yF4EUZ6YE_KKiUHhb_ctv2mE,8484864
7
- cortex_rust\py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- bit_ttt_engine-0.6.1.dist-info\RECORD,,