claude-ollama-live

claude-ollama-live qualifies Claude Code (@anthropic-ai/claude-code) against Ollama Cloud and a loopback lmmock Anthropic Messages server in GitHub Actions.

Quick reference

Run the offline oracle test suite locally, or configure Claude Code in headless bare mode against Ollama Cloud (https://ollama.com) or a loopback lmmock endpoint.

npm test
export ANTHROPIC_BASE_URL=https://ollama.com
export ANTHROPIC_API_KEY=""
export ANTHROPIC_MODEL=glm-5.3-flash
export DISABLE_PROMPT_CACHING=1
claude --bare -p --output-format json --tools "" --setting-sources "" --no-session-persistence "Reply with exactly OLLAMA_CLAUDE_OK_107. Do not call any tools."
Setting or flag Value Purpose
Claude Code version @anthropic-ai/claude-code@2.1.316 Pinned npm package installed in a private prefix with a fresh temporary HOME and CLAUDE_CONFIG_DIR.
ANTHROPIC_BASE_URL https://ollama.com (or loopback lmmock origin) Direct Ollama Cloud Messages endpoint (/v1/messages) without a local Ollama daemon.
ANTHROPIC_MODEL & default slots glm-5.3-flash Pinned across ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU,FABLE}_MODEL.
DISABLE_PROMPT_CACHING 1 Disable unsupported Anthropic prompt-cache controls on Ollama's compatibility route.
Exact oracle token OLLAMA_CLAUDE_OK_107 Required exact text with exit 0, type=result, subtype=success, and is_error=false.

Runnable offline verification command and headless Claude Code invocation template:

npm test
# Local signed-in Ollama server alternative (Ollama 0.15.0+):
ollama launch claude --model glm-5.3-flash:cloud --yes -- -p "Reply with exactly OLLAMA_CLAUDE_OK_107. Do not call any tools."

Documentation pages

Source repository and releases