Skip to content

Add Ollama-backed Claude launcher with kimi-k2.7-code:cloud model#1

Open
S0fiane wants to merge 1 commit into
masterfrom
claude/ollama-claude-launch-1yd9mm
Open

Add Ollama-backed Claude launcher with kimi-k2.7-code:cloud model#1
S0fiane wants to merge 1 commit into
masterfrom
claude/ollama-claude-launch-1yd9mm

Conversation

@S0fiane

@S0fiane S0fiane commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Adds an executable claude Python script that launches an interactive
chat session using a local Ollama model (default: kimi-k2.7-code:cloud).
Includes a Modelfile to configure the model with a data science system prompt.

Usage:
ollama launch claude --model kimi-k2.7-code:cloud
./claude --model kimi-k2.7-code:cloud [--pull] [--list-models]

https://claude.ai/code/session_011UHAX9MTWWpV1v1tGeFqCi


Note

Low Risk
New standalone tooling with no changes to app auth, data paths, or production services; only local HTTP to Ollama.

Overview
Adds a local dev assistant that talks to Ollama instead of a hosted API: an executable claude script plus an optional Modelfile to bake in the same data-science/Pandas system prompt and model params.

The claude entrypoint checks that Ollama is up, can list or pull models, then runs an interactive REPL that streams chat via /api/chat (default model kimi-k2.7-code:cloud). The Modelfile layers that system prompt, temperature 0.2, and num_ctx 16384 on top of the base model when you create a custom Ollama image.

Reviewed by Cursor Bugbot for commit 3d8202f. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds an executable `claude` Python script that launches an interactive
chat session using a local Ollama model (default: kimi-k2.7-code:cloud).
Includes a Modelfile to configure the model with a data science system prompt.

Usage:
    ollama launch claude --model kimi-k2.7-code:cloud
    ./claude --model kimi-k2.7-code:cloud [--pull] [--list-models]

https://claude.ai/code/session_011UHAX9MTWWpV1v1tGeFqCi

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3d8202f. Configure here.

Comment thread claude
print("\nModel ready.")
except urllib.error.URLError as e:
print(f"\nFailed to pull model: {e}", file=sys.stderr)
sys.exit(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull failures still report ready

High Severity

pull_model always prints that the model is ready after the NDJSON stream ends, even when Ollama never sent a status of success or emitted an error object in the stream. main then starts the REPL as if the pull succeeded, so missing or mistyped models (including the default cloud model) can fail only after a misleading success message.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3d8202f. Configure here.

Comment thread claude
break
except urllib.error.URLError as e:
print(f"\nError communicating with Ollama: {e}", file=sys.stderr)
sys.exit(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chat errors terminate whole REPL

Medium Severity

On a URLError while streaming a reply, stream_chat calls sys.exit(1) instead of returning an error to the REPL. A transient network or Ollama glitch during one turn ends the entire interactive session instead of reporting the failure and allowing another prompt.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3d8202f. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants