Merge Ollama fallback pattern with identity.json approach. Store endpoint/fallback/prose_model to eliminate curl probes. Same pattern as claudetools_root/vault_path (working). Next: coord message rollout to populate fields on all machines.
3.8 KiB
3.8 KiB
Proposal: Centralize Machine-Specific Config in identity.json
Problem
Machine-specific settings are scattered across scripts with repeated detection logic:
- Ollama endpoint probed with curl on every use
- Python interpreter tried in sequence (
py,python3,python) - Hostname detection (
$COMPUTERNAMEvshostname) - Platform-specific path guessing
Solution
Store all machine-specific config in identity.json. Scripts read once, no probing.
Proposed Schema (Full)
{
"user": "mike",
"full_name": "Mike Swanson",
"email": "mike@azcomputerguru.com",
"role": "admin",
"machine": "GURU-5070",
"platform": "windows",
"architecture": "amd64",
"paths": {
"claudetools_root": "D:/claudetools",
"vault_path": "D:/vault"
},
"python": {
"command": "py"
},
"ollama": {
"endpoint": "http://localhost:11434",
"fallback": "http://100.101.122.4:11434",
"prose_model": "qwen3:8b"
},
"mode": "general",
"last_updated": "2026-05-26T19:00:00Z"
}
Ollama Integration (Current vs Proposed)
Current (OLLAMA.md pattern):
if curl -s -m 2 http://localhost:11434/api/tags >/dev/null 2>&1; then
OLLAMA="http://localhost:11434"
else
OLLAMA="http://100.101.122.4:11434" # Beast via Tailscale
fi
Proposed:
OLLAMA=$(jq -r '.ollama.endpoint // "http://100.101.122.4:11434"' "$IDENTITY_PATH")
Validation script (run during onboarding or manually):
# .claude/scripts/validate-ollama.sh
ENDPOINT=$(jq -r '.ollama.endpoint' .claude/identity.json)
if ! curl -s -m 2 "$ENDPOINT/api/tags" >/dev/null 2>&1; then
echo "[WARNING] Ollama endpoint $ENDPOINT unreachable"
FALLBACK=$(jq -r '.ollama.fallback' .claude/identity.json)
echo "Trying fallback: $FALLBACK"
if curl -s -m 2 "$FALLBACK/api/tags" >/dev/null 2>&1; then
echo "Fallback works. Update identity.json endpoint to: $FALLBACK"
fi
fi
Per-Machine Config Examples
GURU-5070 (Mike's primary, Windows):
{
"ollama": {
"endpoint": "http://localhost:11434",
"fallback": "http://100.101.122.4:11434",
"prose_model": "qwen3:8b"
},
"python": {"command": "py"},
"platform": "windows"
}
GURU-BEAST-ROG (always-on Ollama host):
{
"ollama": {
"endpoint": "http://localhost:11434",
"fallback": "http://localhost:11434",
"prose_model": "qwen3:14b"
},
"python": {"command": "python3"},
"platform": "windows"
}
GURU-KALI (no local Ollama, remote only):
{
"ollama": {
"endpoint": "http://100.101.122.4:11434",
"fallback": "http://100.101.122.4:11434",
"prose_model": "qwen3:14b"
},
"python": {"command": "python3"},
"platform": "linux"
}
Howard-Home (local Ollama):
{
"ollama": {
"endpoint": "http://localhost:11434",
"fallback": "http://100.101.122.4:11434",
"prose_model": "qwen3:14b"
},
"python": {"command": "python3"},
"platform": "windows"
}
Migration Path
- Add fields to identity.json template in CLAUDE.md onboarding
- Send coord message to all machines: "Update identity.json with Ollama/Python config"
- Each machine runs validation script, auto-detects, writes config
- Update syncro.md, OLLAMA.md, sync.sh to read from identity.json
- Remove detection logic from scripts
Benefits
- Faster: No curl probe on every Ollama call (saves 2 seconds)
- Explicit: Machine declares "I use local Ollama" vs "I use remote"
- Auditable:
cat .claude/identity.jsonshows full machine config - Consistent: Same pattern as
claudetools_root/vault_path(already working) - Offline-safe: Scripts work without network probe (use declared endpoint)
Rollout
Use coord API to send migration instructions to each machine (same pattern as claudetools_root rollout today).