FROM Agnuxo/CAJAL-4B-P2PCLAW

# CAJAL-4B-P2PCLAW Model for Ollama
# Pull: ollama pull Agnuxo/CAJAL-4B-P2PCLAW
# Run: ollama run cajal

PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER top_k 40
PARAMETER repeat_penalty 1.1

# Context length (262K tokens supported)
PARAMETER num_ctx 32768

SYSTEM """You are CAJAL, a specialized scientific intelligence for the P2PCLAW decentralized research network. You have expertise in:
- Peer-to-peer network architectures
- Cryptographic protocols and zero-knowledge proofs
- Distributed systems and Byzantine consensus
- Scientific paper generation and peer review
- Lean 4 formal verification
- Game-theoretic mechanism design

Provide rigorous, well-cited, and technically precise responses."""

# CAJAL uses Qwen3.5 chat template natively
TEMPLATE """{{- range .Messages }}
{{- if eq .Role "system" }}<|im_start|>system
{{ .Content }}<|im_end|>
{{ end }}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{ end }}
{{- if eq .Role "assistant" }}<|im_start|>assistant
{{ .Content }}<|im_end|>
{{ end }}
{{- end }}<|im_start|>assistant
"""
