This playbook is a practical guide to run OpenClaude with a local model (Ollama), work safely, and get strong day-to-day results.
- A CLI agent loop that can read/write files, run terminal commands, and help with coding workflows.
- A local provider profile system (
profile:initanddev:profile). - Runtime checks (
doctor:runtime) and reporting (doctor:report). - A local model profile currently set to
llama3.1:8b.
Run this in your project root:
bun run dev:profileFor quick switches:
# low latency preset
bun run dev:fast
# better coding quality preset
bun run dev:codeIf everything is healthy, OpenClaude starts directly.
bun run profile:init -- --provider ollama --model llama3.1:8bOr let OpenClaude recommend the best local model for your goal:
bun run profile:init -- --provider ollama --goal codingPreview recommendations before saving:
bun run profile:recommend -- --goal coding --benchmarkGet-Content .\.openclaude-profile.jsonbun run doctor:runtimebun run doctor:runtimebun run doctor:runtime:jsonbun run doctor:reportReport output:
reports/doctor-runtime.json
# practical checks (smoke + runtime doctor)
bun run hardening:check
# strict checks (includes typecheck)
bun run hardening:strictbun run profile:init -- --provider ollama --model llama3.1:8b
bun run dev:profileExpected behavior:
- No API key required.
OPENAI_BASE_URLshould behttp://localhost:11434/v1.
bun run profile:init -- --provider openai --api-key sk-... --model gpt-4o
bun run dev:profileExpected behavior:
- Real API key required.
- Placeholder values fail fast.
Cause:
- You ran command in the wrong folder.
Fix:
cd C:\Users\Lucas Pedry\Documents\openclaude\openclaude
bun run dev:profileCause:
- Ollama not installed or PATH not loaded in this terminal.
Fix:
- Install Ollama from https://ollama.com/download/windows or
winget install Ollama.Ollama. - Open a new terminal and run:
ollama --versionCause:
- Ollama service not running.
Fix:
ollama serveThen, in another terminal:
bun run doctor:runtimeCause:
OPENAI_BASE_URLpoints to remote endpoint without key.
Fix:
- Re-initialize profile for ollama:
bun run profile:init -- --provider ollama --model llama3.1:8bOr pick a local Ollama profile automatically by goal:
bun run profile:init -- --provider ollama --goal balancedCause:
- Placeholder was used instead of real key.
Fix:
- For OpenAI: use a real key.
- For Ollama: no key needed; keep localhost base URL.
- Fast/general:
llama3.1:8b - Better coding quality (if hardware supports):
qwen2.5-coder:14b - Low-resource fallback: smaller instruct model
Switch model quickly:
bun run profile:init -- --provider ollama --model qwen2.5-coder:14b
bun run dev:profilePreset shortcuts already configured:
bun run profile:fast # llama3.2:3b
bun run profile:code # qwen2.5-coder:7bGoal-based local auto-selection:
bun run profile:init -- --provider ollama --goal latency
bun run profile:init -- --provider ollama --goal balanced
bun run profile:init -- --provider ollama --goal codingprofile:auto is a best-available provider picker, not a local-only command. Use --provider ollama when you want to stay on a local model.
- "Map this repository architecture and explain the execution flow from entrypoint to tool invocation."
- "Find the top 5 risky modules and explain why."
- "Refactor this module for clarity without behavior change, then run checks and summarize diff impact."
- "Extract shared logic from duplicated functions and add minimal tests."
- "Reproduce the failure, identify root cause, implement fix, and validate with commands."
- "Trace this error path and list likely failure points with confidence levels."
- "Add runtime guardrails and fail-fast messages for invalid provider env vars."
- "Create a diagnostic command that outputs JSON report for CI artifacts."
- "Do a code review of unstaged changes, prioritize bugs/regressions, and suggest concrete patches."
- Run
doctor:runtimebefore debugging provider issues. - Prefer
dev:profileover manual env edits. - Keep
.openclaude-profile.jsonlocal (already gitignored). - Use
doctor:reportbefore asking for help so you have a reproducible snapshot.
When something breaks, run in order:
bun run doctor:runtime
bun run doctor:report
bun run smokeIf answers are very slow, check processor mode:
ollama psIf PROCESSOR shows CPU, your setup is valid but latency will be higher for large models.
If local model mode is failing:
ollama --version
ollama serve
bun run doctor:runtime
bun run dev:profile# profile
bun run profile:init -- --provider ollama --model llama3.1:8b
bun run profile:init -- --provider openai --api-key sk-... --model gpt-4o
# launch
bun run dev:profile
bun run dev:ollama
bun run dev:openai
# diagnostics
bun run doctor:runtime
bun run doctor:runtime:json
bun run doctor:report
# quality
bun run smoke
bun run hardening:check
bun run hardening:strictYour setup is healthy when:
bun run doctor:runtimepasses provider and reachability checks.bun run dev:profileopens the CLI normally.- Model shown in the UI matches your selected profile model.