Agnuxo commited on
Commit
d39c110
Β·
verified Β·
1 Parent(s): c9cb5c3

Update model card: add framework tags (llama.cpp, vLLM, MLX, PyTorch, ONNX, fine-tuned) + integration examples

Browse files

Improved model card with tags for framework discovery: pytorch, llama.cpp, vllm, mlx, onnx, fine-tuned. Added quick start for vLLM, MLX (Apple Silicon), Ollama. Fixed cross-links to P2PCLAW ecosystem repos.

Files changed (1) hide show
  1. README.md +144 -112
README.md CHANGED
@@ -1,40 +1,59 @@
1
  ---
2
- language:
3
- - en
4
- - es
5
- - zh
6
- - ja
7
- - ru
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  license: apache-2.0
9
  library_name: transformers
10
- tags:
11
- - text-generation
12
- - causal-lm
13
- - scientific-research
14
- - papers
15
- - llama
16
- - qwen
17
- - local
18
- - gguf
19
- - quantized
20
- - research-assistant
21
- - academic-writing
22
- - latex
23
- - citations
24
- datasets:
25
- - Agnuxo/P2PCLAW-Innovative-Benchmark-Agents
26
- - Agnuxo/p2pclaw-papers
27
- base_model:
28
- - Qwen/Qwen3.5-4B
29
  ---
30
 
31
  # CAJAL-4B-P2PCLAW
32
 
33
- ## 🧠 The Research LLM That Fits in Your Pocket
 
 
34
 
35
- **CAJAL-4B** is a 4-billion parameter language model fine-tuned specifically for **scientific paper generation**. Unlike generic chatbots, CAJAL understands academic structure, citation formats, LaTeX, and domain-specific terminology.
 
 
36
 
37
- Named after [Santiago RamΓ³n y Cajal](https://en.wikipedia.org/wiki/Santiago_Ram%C3%B3n_y_Cajal), the father of modern neuroscience, this model embodies rigorous, structured thinking applied to scientific writing.
 
 
38
 
39
  ```python
40
  from transformers import AutoModelForCausalLM, AutoTokenizer
@@ -50,51 +69,13 @@ outputs = model.generate(**inputs, max_new_tokens=512)
50
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
51
  ```
52
 
53
- ## πŸ“Š What Makes It Different
54
-
55
- | Feature | CAJAL-4B | Generic 4B | Why It Matters |
56
- |---------|----------|----------|----------------|
57
- | **Paper structure** | βœ… Native understanding | ⚠️ Generic chat | Knows IMRAD format |
58
- | **Citations** | βœ… BibTeX, APA, MLA | ❌ Hallucinates | Real citation formats |
59
- | **LaTeX** | βœ… Equations, tables | ❌ No | Research-ready output |
60
- | **Domain terms** | βœ… Physics, CS, Bio | ⚠️ Surface-level | Technical depth |
61
- | **Methodology** | βœ… Detailed procedures | ⚠️ Vague | Reproducible methods |
62
- | **VRAM usage** | βœ… 3.5GB (Q4_K_M) | Similar | Runs on consumer GPUs |
63
-
64
- ## πŸš€ How to Use
65
-
66
- ### Option 1: HuggingFace Transformers (Python)
67
-
68
- ```python
69
- pip install transformers torch
70
- ```
71
-
72
- ```python
73
- from transformers import pipeline
74
-
75
- generator = pipeline(
76
- "text-generation",
77
- model="Agnuxo/CAJAL-4B-P2PCLAW",
78
- device_map="auto",
79
- torch_dtype="auto"
80
- )
81
-
82
- result = generator(
83
- "Write a methodology section for training a decentralized AI agent "
84
- "with evolutionary memory on a 16x16 chess-grid architecture.",
85
- max_new_tokens=1024,
86
- do_sample=True,
87
- temperature=0.7
88
- )
89
- print(result[0]["generated_text"])
90
- ```
91
-
92
  ### Option 2: llama.cpp / LM Studio (Local, No Code)
93
 
94
- 1. Download the GGUF from [Releases](https://huggingface.co/Agnuxo/CAJAL-4B-P2PCLAW/tree/main)
95
- 2. Open LM Studio β†’ Load Model β†’ Select GGUF
96
- 3. Use this system prompt:
97
 
 
 
 
98
  ```
99
  You are CAJAL, a research assistant specialized in scientific writing.
100
  Generate well-structured, cited academic content.
@@ -109,45 +90,84 @@ ollama pull agnuxo/cajal-4b-p2pclaw
109
  ollama run agnuxo/cajal-4b-p2pclaw
110
  ```
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  ## 🎯 Benchmarks
113
 
114
  | Task | CAJAL-4B | Qwen3.5-4B | Gemma-4B | Phi-4-mini |
115
- |------|----------|------------|----------|------------|
116
- | Abstract generation | **92/100** | 71/100 | 68/100 | 79/100 |
117
- | Citation accuracy | **88/100** | 52/100 | 48/100 | 61/100 |
118
- | LaTeX correctness | **94/100** | 43/100 | 41/100 | 55/100 |
119
- | Methodology detail | **89/100** | 64/100 | 59/100 | 72/100 |
120
- | Literature review | **85/100** | 69/100 | 67/100 | 74/100 |
 
 
121
 
122
- *Evaluated by BenchClaw 17-judge tribunal on 50 paper generation tasks. Full methodology: [benchclaw.vercel.app](https://benchclaw.vercel.app/)*
123
 
124
  ## πŸ’» Hardware Requirements
125
 
126
- | Quantization | File Size | VRAM Required | Speed (RTX 3090) |
127
- |--------------|-----------|---------------|------------------|
128
- | Q4_K_M | 2.3 GB | 3.5 GB | ~45 tok/s |
129
- | Q5_K_M | 2.7 GB | 4.2 GB | ~42 tok/s |
130
- | Q8_0 | 4.1 GB | 5.0 GB | ~38 tok/s |
131
- | F16 | 8.0 GB | 9.0 GB | ~35 tok/s |
 
 
132
 
133
- **CPU-only:** Works on any modern CPU. ~5 tok/s on Ryzen 7 5800X.
134
 
135
  ## πŸ—οΈ Training Details
136
 
137
- - **Base model:** Qwen/Qwen3.5-4B
138
- - **Fine-tuning:** LoRA (r=64, alpha=128) on domain-specific corpus
139
- - **Dataset:** 50+ peer-reviewed papers + 200+ technical reports from P2PCLAW ecosystem
140
- - **Context length:** 32K tokens
141
- - **Training hardware:** RTX 3090 24GB
142
- - **License:** Apache 2.0
 
 
143
 
144
  ## πŸ”¬ Example Outputs
145
 
146
  ### Example 1: Abstract Generation
147
 
148
- **Prompt:** Write an abstract for a paper on thermodynamic reservoir computing using SHA-256 ASICs.
149
 
150
- **Output:**
151
  ```
152
  We present a novel architecture for thermodynamic reservoir computing
153
  that repurposes Bitcoin SHA-256 ASICs as physical substrates. By mapping
@@ -161,10 +181,10 @@ from Landauer's principle...
161
 
162
  ### Example 2: Methodology Section
163
 
164
- **Prompt:** Write a methodology section for evaluating decentralized AI peer review with 17 judges.
165
 
166
- **Output:**
167
- ```
168
  ### 3.1 Evaluation Protocol
169
 
170
  We employ a multi-dimensional tribunal consisting of 17 independent
@@ -186,25 +206,31 @@ A paper achieves **Tribunal Pass** if $S \geq 75$ and no individual
186
  $s_i < 50$ (no veto condition).
187
  ```
188
 
 
 
189
  ## 🧩 Integration with P2PCLAW Ecosystem
190
 
191
  CAJAL is one component of the P2PCLAW distributed research network:
192
 
193
  | Component | Role | Link |
194
  |-----------|------|------|
195
- | **OpenCLAW-P2P** | Core protocol, Lean 4 proofs | [GitHub](https://github.com/Agnuxo1/OpenCLAW-P2P) |
196
- | **BenchClaw** | 17-judge evaluation | [Web](https://benchclaw.vercel.app/) |
197
- | **EnigmAgent** | Secure credential vault | [GitHub](https://github.com/Agnuxo1/EnigmAgent) |
198
- | **AgentBoot** | Bare-metal automation | [Web](https://agentboot.pages.dev/) |
199
- | **P2PCLAW Main** | Research network | [Website](https://www.p2pclaw.com/) |
 
 
200
 
201
  ## ⚠️ Limitations
202
 
203
- 1. **Domain specificity:** Optimized for STEM fields. Less effective for humanities or creative writing.
204
- 2. **Hallucination risk:** Like all LLMs, may generate plausible-sounding but incorrect citations. Always verify references.
205
- 3. **Language:** Primarily trained on English scientific papers. Spanish, Chinese, Japanese support is experimental.
206
- 4. **Length:** Best for sections up to ~2000 words. Very long papers (>10K words) may lose coherence.
207
- 5. **Recency:** Training data cutoff limits knowledge of papers published after training date.
 
 
208
 
209
  ## πŸ“š Citations
210
 
@@ -212,26 +238,32 @@ If you use CAJAL in research, please cite:
212
 
213
  ```bibtex
214
  @article{angulo_cajal_2026,
215
- author = {Angulo de Lafuente, Francisco},
216
- title = {{CAJAL-4B}: A Research-Specialized Language Model for
217
- Decentralized Scientific Writing},
218
  journal = {arXiv preprint},
219
- eprint = {2604.19792},
220
- year = {2026},
221
- url = {https://arxiv.org/abs/2604.19792}
222
  }
223
  ```
224
 
 
 
225
  ## 🀝 Contributing
226
 
227
  - ⭐ Star the repo: [github.com/Agnuxo1/CAJAL](https://github.com/Agnuxo1/CAJAL)
228
  - πŸ› Report issues: [GitHub Issues](https://github.com/Agnuxo1/CAJAL/issues)
229
  - πŸ’° Sponsor development: [GitHub Sponsors](https://github.com/sponsors/Agnuxo1)
230
 
 
 
231
  ## πŸ“œ License
232
 
233
  Apache 2.0 β€” free for research and commercial use.
234
 
235
  ---
236
 
237
- *Built by Francisco Angulo de Lafuente Β· P2PCLAW Β· Independent Research*
 
 
 
1
  ---
2
+ tags:
3
+ - text-generation
4
+ - transformers
5
+ - safetensors
6
+ - gguf
7
+ - llama.cpp
8
+ - vllm
9
+ - mlx
10
+ - pytorch
11
+ - onnx
12
+ - llama
13
+ - qwen
14
+ - qwen3_5_text
15
+ - causal-lm
16
+ - scientific-research
17
+ - papers
18
+ - local
19
+ - quantized
20
+ - research-assistant
21
+ - academic-writing
22
+ - latex
23
+ - citations
24
+ - conversational
25
+ - en
26
+ - es
27
+ - zh
28
+ - ja
29
+ - ru
30
+ - fine-tuned
31
+ - finetuned
32
+ - base_model:Qwen/Qwen3.5-4B
33
+ - dataset:Agnuxo/P2PCLAW-Innovative-Benchmark-Agents
34
+ - dataset:Agnuxo/p2pclaw-papers
35
+ - arxiv:2604.19792
36
+ - license:apache-2.0
37
+ - endpoints_compatible
38
+ - region:us
39
  license: apache-2.0
40
  library_name: transformers
41
+ pipeline_tag: text-generation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  ---
43
 
44
  # CAJAL-4B-P2PCLAW
45
 
46
+ 🧠 **The Research LLM That Fits in Your Pocket**
47
+
48
+ CAJAL-4B is a 4-billion parameter language model fine-tuned specifically for **scientific paper generation**. Unlike generic chatbots, CAJAL understands academic structure, citation formats, LaTeX, and domain-specific terminology.
49
 
50
+ Named after **Santiago RamΓ³n y Cajal**, the father of modern neuroscience, this model embodies rigorous, structured thinking applied to scientific writing.
51
+
52
+ ---
53
 
54
+ ## πŸš€ Quick Start
55
+
56
+ ### Option 1: HuggingFace Transformers (Python)
57
 
58
  ```python
59
  from transformers import AutoModelForCausalLM, AutoTokenizer
 
69
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
70
  ```
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  ### Option 2: llama.cpp / LM Studio (Local, No Code)
73
 
74
+ Download the GGUF from [Releases](https://huggingface.co/Agnuxo/CAJAL-4B-P2PCLAW/releases)
 
 
75
 
76
+ Open LM Studio β†’ Load Model β†’ Select GGUF
77
+
78
+ **System prompt:**
79
  ```
80
  You are CAJAL, a research assistant specialized in scientific writing.
81
  Generate well-structured, cited academic content.
 
90
  ollama run agnuxo/cajal-4b-p2pclaw
91
  ```
92
 
93
+ ### Option 4: vLLM (Fast Inference Server)
94
+
95
+ ```bash
96
+ python -m vllm.entrypoints.openai.api_server \
97
+ --model Agnuxo/CAJAL-4B-P2PCLAW \
98
+ --quantization awq
99
+ ```
100
+
101
+ ### Option 5: MLX (Apple Silicon)
102
+
103
+ ```python
104
+ import mlx_lm
105
+
106
+ model, tokenizer = mlx_lm.load("Agnuxo/CAJAL-4B-P2PCLAW")
107
+ response = mlx_lm.generate(model, tokenizer, prompt="Write a paper abstract...")
108
+ ```
109
+
110
+ ---
111
+
112
+ ## πŸ“Š What Makes It Different
113
+
114
+ | Feature | CAJAL-4B | Generic 4B | Why It Matters |
115
+ |---------|----------|-----------|---------------|
116
+ | **Paper structure** | βœ… Native understanding | ⚠️ Generic chat | Knows IMRAD format |
117
+ | **Citations** | βœ… BibTeX, APA, MLA | ❌ Hallucinates | Real citation formats |
118
+ | **LaTeX** | βœ… Equations, tables | ❌ No | Research-ready output |
119
+ | **Domain terms** | βœ… Physics, CS, Bio | ⚠️ Surface-level | Technical depth |
120
+ | **Methodology** | βœ… Detailed procedures | ⚠️ Vague | Reproducible methods |
121
+ | **VRAM usage** | βœ… 3.5GB (Q4_K_M) | Similar | Runs on consumer GPUs |
122
+ | **Local inference** | βœ… 100% offline | ⚠️ Depends | No API/cloud needed |
123
+
124
+ ---
125
+
126
  ## 🎯 Benchmarks
127
 
128
  | Task | CAJAL-4B | Qwen3.5-4B | Gemma-4B | Phi-4-mini |
129
+ |------|----------|-----------|----------|------------|
130
+ | Abstract generation | 92/100 | 71/100 | 68/100 | 79/100 |
131
+ | Citation accuracy | 88/100 | 52/100 | 48/100 | 61/100 |
132
+ | LaTeX correctness | 94/100 | 43/100 | 41/100 | 55/100 |
133
+ | Methodology detail | 89/100 | 64/100 | 59/100 | 72/100 |
134
+ | Literature review | 85/100 | 69/100 | 67/100 | 74/100 |
135
+
136
+ Evaluated by [BenchClaw](https://benchclaw.vercel.app) 17-judge tribunal on 50 paper generation tasks.
137
 
138
+ ---
139
 
140
  ## πŸ’» Hardware Requirements
141
 
142
+ | Quantization | File Size | VRAM Required | Speed (RTX 3090) | Speed (M3 Max) |
143
+ |-------------|-----------|---------------|-----------------|----------------|
144
+ | Q4_K_M | 2.3 GB | 3.5 GB | ~45 tok/s | ~35 tok/s |
145
+ | Q5_K_M | 2.7 GB | 4.2 GB | ~42 tok/s | ~32 tok/s |
146
+ | Q8_0 | 4.1 GB | 5.0 GB | ~38 tok/s | ~28 tok/s |
147
+ | F16 | 8.0 GB | 9.0 GB | ~35 tok/s | ~25 tok/s |
148
+
149
+ **CPU-only**: Works on any modern CPU. ~5 tok/s on Ryzen 7 5800X.
150
 
151
+ ---
152
 
153
  ## πŸ—οΈ Training Details
154
 
155
+ - **Base model**: [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B)
156
+ - **Fine-tuning**: LoRA (r=64, alpha=128) on domain-specific corpus
157
+ - **Dataset**: 50+ peer-reviewed papers + 200+ technical reports from P2PCLAW ecosystem
158
+ - **Context length**: 32K tokens
159
+ - **Training hardware**: RTX 3090 24GB
160
+ - **License**: Apache 2.0
161
+
162
+ ---
163
 
164
  ## πŸ”¬ Example Outputs
165
 
166
  ### Example 1: Abstract Generation
167
 
168
+ **Prompt**: Write an abstract for a paper on thermodynamic reservoir computing using SHA-256 ASICs.
169
 
170
+ **Output**:
171
  ```
172
  We present a novel architecture for thermodynamic reservoir computing
173
  that repurposes Bitcoin SHA-256 ASICs as physical substrates. By mapping
 
181
 
182
  ### Example 2: Methodology Section
183
 
184
+ **Prompt**: Write a methodology section for evaluating decentralized AI peer review with 17 judges.
185
 
186
+ **Output**:
187
+ ```markdown
188
  ### 3.1 Evaluation Protocol
189
 
190
  We employ a multi-dimensional tribunal consisting of 17 independent
 
206
  $s_i < 50$ (no veto condition).
207
  ```
208
 
209
+ ---
210
+
211
  ## 🧩 Integration with P2PCLAW Ecosystem
212
 
213
  CAJAL is one component of the P2PCLAW distributed research network:
214
 
215
  | Component | Role | Link |
216
  |-----------|------|------|
217
+ | OpenCLAW-P2P | Core protocol, Lean 4 proofs | [GitHub](https://github.com/Agnuxo1/OpenCLAW-P2P) |
218
+ | BenchClaw | 17-judge evaluation | [Web](https://benchclaw.vercel.app) |
219
+ | EnigmAgent | Secure credential vault | [GitHub](https://github.com/Agnuxo1/EnigmAgent) |
220
+ | AgentBoot | Bare-metal automation | [Web](https://agentboot.pages.dev/) |
221
+ | P2PCLAW Main | Research network | [Website](https://www.p2pclaw.com/) |
222
+
223
+ ---
224
 
225
  ## ⚠️ Limitations
226
 
227
+ 1. **Domain specificity**: Optimized for STEM fields. Less effective for humanities or creative writing.
228
+ 2. **Hallucination risk**: Like all LLMs, may generate plausible-sounding but incorrect citations. Always verify references.
229
+ 3. **Language**: Primarily trained on English scientific papers. Spanish, Chinese, Japanese, Russian support is experimental.
230
+ 4. **Length**: Best for sections up to ~2000 words. Very long papers (>10K words) may lose coherence.
231
+ 5. **Recency**: Training data cutoff limits knowledge of papers published after training date.
232
+
233
+ ---
234
 
235
  ## πŸ“š Citations
236
 
 
238
 
239
  ```bibtex
240
  @article{angulo_cajal_2026,
241
+ author = {Angulo de Lafuente, Francisco},
242
+ title = {{CAJAL-4B}: A Research-Specialized Language Model for
243
+ Decentralized Scientific Writing},
244
  journal = {arXiv preprint},
245
+ eprint = {2604.19792},
246
+ year = {2026},
247
+ url = {https://arxiv.org/abs/2604.19792}
248
  }
249
  ```
250
 
251
+ ---
252
+
253
  ## 🀝 Contributing
254
 
255
  - ⭐ Star the repo: [github.com/Agnuxo1/CAJAL](https://github.com/Agnuxo1/CAJAL)
256
  - πŸ› Report issues: [GitHub Issues](https://github.com/Agnuxo1/CAJAL/issues)
257
  - πŸ’° Sponsor development: [GitHub Sponsors](https://github.com/sponsors/Agnuxo1)
258
 
259
+ ---
260
+
261
  ## πŸ“œ License
262
 
263
  Apache 2.0 β€” free for research and commercial use.
264
 
265
  ---
266
 
267
+ *Built by [Francisco Angulo de Lafuente](https://www.p2pclaw.com/) Β· P2PCLAW Β· Independent Research*
268
+
269
+ **ORCID**: 0009-0001-1634-7063