Update model card: add framework tags (llama.cpp, vLLM, MLX, PyTorch, ONNX, fine-tuned) + integration examples
Browse filesImproved 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.
README.md
CHANGED
|
@@ -1,40 +1,59 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
-
|
| 4 |
-
-
|
| 5 |
-
-
|
| 6 |
-
-
|
| 7 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
license: apache-2.0
|
| 9 |
library_name: transformers
|
| 10 |
-
|
| 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 |
-
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
**
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
| 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 |
-
|
| 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 |
|
| 117 |
-
| Citation accuracy |
|
| 118 |
-
| LaTeX correctness |
|
| 119 |
-
| Methodology detail |
|
| 120 |
-
| Literature review |
|
|
|
|
|
|
|
| 121 |
|
| 122 |
-
|
| 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 |
-
|
| 134 |
|
| 135 |
## ποΈ Training Details
|
| 136 |
|
| 137 |
-
- **Base model
|
| 138 |
-
- **Fine-tuning
|
| 139 |
-
- **Dataset
|
| 140 |
-
- **Context length
|
| 141 |
-
- **Training hardware
|
| 142 |
-
- **License
|
|
|
|
|
|
|
| 143 |
|
| 144 |
## π¬ Example Outputs
|
| 145 |
|
| 146 |
### Example 1: Abstract Generation
|
| 147 |
|
| 148 |
-
**Prompt
|
| 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
|
| 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 |
-
|
|
| 196 |
-
|
|
| 197 |
-
|
|
| 198 |
-
|
|
| 199 |
-
|
|
|
|
|
|
|
|
| 200 |
|
| 201 |
## β οΈ Limitations
|
| 202 |
|
| 203 |
-
1. **Domain specificity
|
| 204 |
-
2. **Hallucination risk
|
| 205 |
-
3. **Language
|
| 206 |
-
4. **Length
|
| 207 |
-
5. **Recency
|
|
|
|
|
|
|
| 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
|
| 216 |
-
title
|
| 217 |
-
|
| 218 |
journal = {arXiv preprint},
|
| 219 |
-
eprint
|
| 220 |
-
year
|
| 221 |
-
url
|
| 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
|