ereniko commited on
Commit
9cf70f4
Β·
verified Β·
1 Parent(s): 673b846

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +240 -3
README.md CHANGED
@@ -1,3 +1,240 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ base_model:
6
+ - CaaLM/CaaLM-v1
7
+ tags:
8
+ - gguf
9
+ - code
10
+ - prediction
11
+ - code execution
12
+ ---
13
+ # CaaLM/CaaLM-v1-GGUF
14
+
15
+ ![CaaLM-v1 Logo](https://cdn-uploads.huggingface.co/production/uploads/670562d6ac129959c16f84d4/lsYHkWaSlewMkpgEaOJNP.png)
16
+
17
+ ## Overview
18
+
19
+ This repository contains **official GGUF quantizations** of [CaaLM/CaaLM-v1](https://hf.co/CaaLM/CaaLM-v1), provided by CaaLM.
20
+
21
+ CaaLM-v1 is a 1.5B parameter model that predicts the output of code β€” without a compiler, runtime, or interpreter. It was trained on real programming languages (Python, JavaScript, Lua, COBOL) alongside 200 synthetically generated fake programming languages, enabling it to predict execution output even for languages it has never seen before.
22
+
23
+ - **Original model:** [CaaLM/CaaLM-v1](https://hf.co/CaaLM/CaaLM-v1)
24
+ - **Base model:** Qwen/Qwen2.5-1.5B
25
+ - **Architecture:** Qwen2
26
+ - **Parameters:** 1,543.7M
27
+ - **License:** Apache 2.0
28
+ - **Task:** Code output prediction (text-generation)
29
+
30
+ ---
31
+
32
+ ## Available Quants
33
+
34
+ All quantizations listed below are **official releases** from CaaLM.
35
+
36
+ | Filename | Quantization | Description | Recommended Use |
37
+ |---|---|---|---|
38
+ | `CaaLM-v1-F32.gguf` | F32 | Full 32-bit float | Maximum precision, highest VRAM |
39
+ | `CaaLM-v1-F16.gguf` | F16 | 16-bit float | High precision, large memory footprint |
40
+ | `CaaLM-v1-BF16.gguf` | BF16 | Brain float 16 | Good precision, modern hardware |
41
+ | `CaaLM-v1-Q8_0.gguf` | Q8_0 | 8-bit quantization | Near-lossless, recommended if you have the VRAM |
42
+ | `CaaLM-v1-Q6_K.gguf` | Q6_K | 6-bit K-quant | Excellent quality, good balance |
43
+ | `CaaLM-v1-Q5_K_M.gguf` | Q5_K_M | 5-bit K-quant (medium) | **Recommended** β€” great quality/size balance |
44
+ | `CaaLM-v1-Q5_K_S.gguf` | Q5_K_S | 5-bit K-quant (small) | Good quality, smaller than Q5_K_M |
45
+ | `CaaLM-v1-Q5_1.gguf` | Q5_1 | 5-bit legacy | Legacy format |
46
+ | `CaaLM-v1-Q5_0.gguf` | Q5_0 | 5-bit legacy | Legacy format |
47
+ | `CaaLM-v1-Q4_K_M.gguf` | Q4_K_M | 4-bit K-quant (medium) | **Recommended** β€” best 4-bit option |
48
+ | `CaaLM-v1-Q4_K_S.gguf` | Q4_K_S | 4-bit K-quant (small) | Smaller than Q4_K_M, slight quality drop |
49
+ | `CaaLM-v1-Q4_1.gguf` | Q4_1 | 4-bit legacy | Legacy format |
50
+ | `CaaLM-v1-Q4_0.gguf` | Q4_0 | 4-bit legacy | Legacy format, widely compatible |
51
+ | `CaaLM-v1-IQ4_XS.gguf` | IQ4_XS | 4-bit iQuant (extra small) | Smaller than Q4_K_S, competitive quality |
52
+ | `CaaLM-v1-IQ4_NL.gguf` | IQ4_NL | 4-bit iQuant (non-linear) | Good alternative to Q4_0 |
53
+ | `CaaLM-v1-Q3_K_L.gguf` | Q3_K_L | 3-bit K-quant (large) | Low memory, acceptable quality |
54
+ | `CaaLM-v1-Q3_K_M.gguf` | Q3_K_M | 3-bit K-quant (medium) | Low memory use |
55
+ | `CaaLM-v1-Q3_K_S.gguf` | Q3_K_S | 3-bit K-quant (small) | Very low memory use |
56
+ | `CaaLM-v1-IQ3_M.gguf` | IQ3_M | 3-bit iQuant (medium) | Better than Q3_K_M at similar size |
57
+ | `CaaLM-v1-IQ3_S.gguf` | IQ3_S | 3-bit iQuant (small) | Very small footprint |
58
+ | `CaaLM-v1-Q2_K.gguf` | Q2_K | 2-bit K-quant | Minimum quality, maximum compression |
59
+ | `CaaLM-v1-TQ2_0.gguf` | TQ2_0 | 2-bit ternary quant | Experimental ternary quantization |
60
+ | `CaaLM-v1-TQ1_0.gguf` | TQ1_0 | 1-bit ternary quant | Extreme compression, experimental |
61
+
62
+ ---
63
+
64
+ ## Which Quant Should I Use?
65
+
66
+ **By available memory:**
67
+
68
+ | Available VRAM / RAM | Recommended Quant |
69
+ |---|---|
70
+ | 6 GB+ | Q8_0 |
71
+ | 4 GB+ | Q5_K_M or Q6_K |
72
+ | 3 GB+ | Q4_K_M |
73
+ | 2 GB+ | Q3_K_M or IQ3_M |
74
+ | < 2 GB | Q2_K (quality will degrade) |
75
+
76
+ > **General guidance:** For most users, `Q4_K_M` or `Q5_K_M` offer the best trade-off between file size and output quality. If you need maximum fidelity, use `Q8_0` or `BF16`.
77
+
78
+ ---
79
+
80
+ ## Usage
81
+
82
+ ### llama.cpp
83
+
84
+ ```bash
85
+ ./llama-cli \
86
+ -m CaaLM-v1-Q4_K_M.gguf \
87
+ -p "Code:\na = 6\nb = 7\nprint(a * b)\n\nOutput:\n" \
88
+ --temp 0 \
89
+ -n 64
90
+ ```
91
+
92
+ ### Ollama
93
+
94
+ ```bash
95
+ # Create a Modelfile
96
+ cat > Modelfile <<EOF
97
+ FROM ./CaaLM-v1-Q4_K_M.gguf
98
+ PARAMETER temperature 0
99
+ PARAMETER stop "<|im_end|>"
100
+ SYSTEM "You predict the output of code snippets."
101
+ EOF
102
+
103
+ ollama create caalm-v1 -f Modelfile
104
+ ollama run caalm-v1
105
+ ```
106
+
107
+ ### Python (llama-cpp-python)
108
+
109
+ ```python
110
+ from llama_cpp import Llama
111
+
112
+ llm = Llama(
113
+ model_path="CaaLM-v1-Q4_K_M.gguf",
114
+ n_ctx=512,
115
+ )
116
+
117
+ def predict_output(code: str) -> str:
118
+ prompt = f"Code:\n{code}\n\nOutput:\n"
119
+ result = llm(
120
+ prompt,
121
+ max_tokens=128,
122
+ temperature=0,
123
+ stop=["<|im_end|>", "\n\n\n"],
124
+ )
125
+ return result["choices"][0]["text"].strip()
126
+
127
+ # Real language
128
+ print(predict_output("a = 6\nb = 7\nprint(a * b)"))
129
+ # β†’ 42
130
+
131
+ # Novel fake language
132
+ print(predict_output("STORE X := 10\nSTORE Y := 5\nSPEAK X + Y"))
133
+ # β†’ 15
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Input Format
139
+
140
+ Always use the following prompt format β€” the model completes the `Output:` section:
141
+
142
+ ```
143
+ Code:
144
+ <your code here>
145
+
146
+ Output:
147
+ ```
148
+
149
+ ### Example β€” Python
150
+
151
+ ```
152
+ Code:
153
+ a = 10
154
+ b = 20
155
+ print(a + b)
156
+
157
+ Output:
158
+ 30
159
+ ```
160
+
161
+ ### Example β€” Novel Fake Language (never seen during training)
162
+
163
+ ```
164
+ Code:
165
+ SCRIBBLE @x BECOMES 7
166
+ SCRIBBLE @y BECOMES 3
167
+ YELL @x + @y
168
+
169
+ Output:
170
+ 10
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Performance
176
+
177
+ **Overall benchmark accuracy: 96.2% (50/52 tests)**
178
+
179
+ | Category | Accuracy | Passed/Total |
180
+ |---|---|---|
181
+ | Real: Python | 100% | 10/10 |
182
+ | Real: JavaScript | 100% | 8/8 |
183
+ | Real: Lua | 100% | 6/6 |
184
+ | Real: COBOL | 75% | 3/4 |
185
+ | Novel Fake: Tier 1 (assign + print) | 100% | 8/8 |
186
+ | Novel Fake: Tier 2 (conditionals) | 86% | 6/7 |
187
+ | Novel Fake: Tier 3 (loops) | 100% | 4/4 |
188
+ | Edge Cases | 100% | 5/5 |
189
+
190
+ For full benchmark details and known failure cases, see the [original model card](https://hf.co/CaaLM/CaaLM-v1).
191
+
192
+ ---
193
+
194
+ ## Supported Operations
195
+
196
+ The model reliably handles:
197
+
198
+ - Variable assignment and arithmetic
199
+ - Print / output statements
200
+ - Conditionals (if/else)
201
+ - While loops with accumulator patterns
202
+ - String output
203
+ - Basic error behavior (empty output when conditions not met)
204
+
205
+ It does **not** reliably handle: functions, recursion, file I/O, complex data structures, pipes, or multi-line string manipulation.
206
+
207
+ ---
208
+
209
+ ## Limitations
210
+
211
+ - No actual code execution β€” outputs are predictions, not guarantees
212
+ - If-without-else edge cases may produce hallucinated else branches
213
+ - COBOL numeric padding format is inconsistent
214
+ - Long programs may degrade in accuracy as state complexity grows
215
+ - Context window is limited to ~512 tokens
216
+ - Quantization at Q3 and below may introduce additional errors vs. the original model
217
+
218
+ ---
219
+
220
+ ## Model Lineage
221
+
222
+ | Model | Base | Description |
223
+ |---|---|---|
224
+ | LaaLM-v1 | T5-base | Fine-tuned to simulate Linux shell commands |
225
+ | LaaLM-exp-v1 | Qwen 3B | Conversational Linux terminal emulation |
226
+ | **CaaLM-v1** | **Qwen 1.5B** | **Language-agnostic code output prediction (this model)** |
227
+
228
+ ---
229
+
230
+ ## License
231
+
232
+ Apache 2.0 β€” inherited from the Qwen 2.5 base model and the original CaaLM-v1.
233
+
234
+ ---
235
+
236
+ ## Links
237
+
238
+ - **Original model:** [CaaLM/CaaLM-v1](https://hf.co/CaaLM/CaaLM-v1)
239
+ - **Demo Space:** [CaaLM-v1-Demo](https://hf.co/spaces/CaaLM/CaaLM-v1-Demo)
240
+ - **Base model:** [Qwen/Qwen2.5-1.5B](https://huggingface.co/Qwen/Qwen2.5-1.5B)