Custom Perseus model

Ship your own Ollama model under the llamaclaw namespace.

1. Author the Modelfile

# Modelfile
FROM gemma4:e4b
PARAMETER temperature 0.1
PARAMETER top_p 0.9
PARAMETER num_ctx 16384

SYSTEM """You are Perseus, the llamaclaw scientific-computing agent.
Help users with causal inference, epidemiology, and LLM workflows.
Be explicit about assumptions, limitations, missing data, and
reproducibility risks. Do not invent approval status for restricted
datasets."""

# Optional: constrain vocab, adapter weights, etc.

2. Build locally

ollama create llamaclaw/perseus:e4b -f Modelfile
ollama run llamaclaw/perseus:e4b "what's the difference between IPW and AIPW?"

3. Publish to ollama.com

ollama push llamaclaw/perseus:e4b

You’ll need to be logged in to the llamaclaw namespace:

ollama login   # uses the API key from ~/.ollama/config.yaml

4. Use via Perseus

from perseus import ask_percy

# Perseus auto-detects running Ollama and prefers `perseus:*` models
response = ask_percy("explain DML in two sentences")
print(response["model"])   # → "llamaclaw/perseus:e4b"

Why T=0.1?

At higher temperatures (default 0.7), LLMs hallucinate scaling factors in numerical code and invent biased estimators. For scientific computing the only safe temperature is low. The llamaclaw Modelfile ships with T=0.1 baked in so users don’t accidentally raise it.

Model registry

Current public models at ollama.com/llamaclaw:

  • perseus:e2b (2.6 GB) — on-device default; works on Pi

  • perseus:e4b (8 GB) — desktop quality

  • perseus:8b (5 GB Q4_K_M) — best quality on a 16 GB Pi

All three use T=0.1 and the same scientific-computing system prompt.