Skip to content

Comments

feat(ollama): comprehensive model management and server integration#345

Draft
Koan-Bot wants to merge 1 commit intosukria:mainfrom
atoomic:koan.atoomic/improve-ollama-support
Draft

feat(ollama): comprehensive model management and server integration#345
Koan-Bot wants to merge 1 commit intosukria:mainfrom
atoomic:koan.atoomic/improve-ollama-support

Conversation

@Koan-Bot
Copy link
Contributor

@Koan-Bot Koan-Bot commented Feb 19, 2026

Summary

Comprehensive Ollama integration for Kōan — from REST client to Telegram-accessible model management.

What's included (7 commits)

Infrastructure

  • Native Ollama REST API client (ollama_client.py) with health checks, model listing, version detection
  • Unified _api_request() layer (GET/POST/DELETE) with consistent error handling
  • OllamaClaudeProvider — routes Claude CLI through Ollama proxy via ANTHROPIC_BASE_URL
  • Provider alias: ollamaLocalLLMProvider (alongside existing local)
  • Docker Compose service template for Ollama with GPU passthrough docs

Skill: /ollama

  • /ollama — Server status: version, model list, running models, configured model readiness
  • /ollama list (aliases: ls, models) — Compact model listing
  • /ollama pull <model> — Download models with streaming NDJSON progress
  • /ollama remove <model> (alias: rm) — Remove locally stored models
  • /ollama show <model> (alias: info) — Model details (family, parameters, quantization, context)
  • /ollama help — Subcommand reference
  • Provider-aware: only works with local, ollama, or ollama-claude providers

Process management

  • System-wide Ollama detection before spawning — adopts already-running servers
  • Config-gated auto-pull for missing models on startup (both local and ollama-claude providers)

Observability

  • Startup banner enriched with Ollama status (version, model count, configured model)
  • /status and /ping show Ollama process health when provider needs it
  • Error messages include actionable hints (e.g., "Run: ollama pull ")

Provider validation

  • OllamaClaudeProvider validates model availability via check_server_and_model() (not just server health)
  • Auto-pull integration: missing models can be auto-pulled during startup quota check

Test coverage

  • 215 new tests across test_ollama_client.py, test_skill_ollama.py, test_startup_info.py, test_pid_manager.py, test_cli_provider.py, test_ollama_claude_provider.py
  • Full suite: 5786 passed (0 failures)

Closes #319, closes #305

Test plan

  • Verify /ollama shows server status when provider is local or ollama-claude
  • Verify /ollama list shows available models
  • Verify /ollama pull <model> downloads and reports success
  • Verify /ollama remove <model> deletes and reports freed space
  • Verify /ollama show <model> displays model details (family, params, quantization)
  • Verify /ollama help shows subcommand reference
  • Verify startup banner shows Ollama info for Ollama-based providers
  • Verify system-wide Ollama detection adopts running servers
  • Verify auto-pull pulls missing models when enabled in config
  • Verify provider-check rejects non-Ollama providers gracefully

🤖 Generated with Claude Code

@Koan-Bot Koan-Bot changed the title feat(ollama): native Ollama REST API client for server health and model checks feat(ollama): add /ollama skill and enrich status with server details Feb 19, 2026
@Koan-Bot Koan-Bot changed the title feat(ollama): add /ollama skill and enrich status with server details feat(ollama): complete Ollama support with ollama-claude provider Feb 19, 2026
@Koan-Bot Koan-Bot changed the title feat(ollama): complete Ollama support with ollama-claude provider feat(ollama): comprehensive model management and server integration Feb 19, 2026
…default

Implement the /ollama Telegram skill with subcommands for model management:
- /ollama status — server health, version, loaded models
- /ollama list — list locally available models via API
- /ollama pull <name> — download a model
- /ollama remove <name> — delete a local model
- /ollama help — show available subcommands

Improve OllamaLaunchProvider:
- Add get_version() with semver parsing for minimum version check
- is_available() now validates Ollama >= 0.15.0 (launch support)
- Set OLLAMA_NO_CLOUD=1 by default for data privacy (v0.16.2+)

Improve pid_manager:
- Add HTTP health check (_ollama_http_ready) using /api endpoint
- start_ollama() now verifies server readiness via HTTP, not just PID

Update docs/provider-local.md:
- Add ollama-launch provider section with config examples
- Update recommended models (add qwen3-coder, glm-4.7)
- Document /ollama Telegram skill commands

113 new tests (69 for skill, 44 for provider/pid_manager).
6273 total tests pass.

Closes sukria#319
@Koan-Bot Koan-Bot force-pushed the koan.atoomic/improve-ollama-support branch from fdc531d to e3e4f6e Compare February 23, 2026 08:40
@Koan-Bot
Copy link
Contributor Author

Updated — Complete Rewrite

Force-pushed with a fresh implementation from upstream/main:

Changes

  • New /ollama skill: status, list, pull, remove, help subcommands via Telegram
  • Version checking: get_version() parses semver, is_available() validates >= v0.15.0
  • Privacy: OLLAMA_NO_CLOUD=1 set by default (prevents cloud offloading in v0.16.2+)
  • HTTP health check: start_ollama() now verifies server readiness via HTTP, not just PID
  • Docs: updated provider-local.md with ollama-launch section and current model recommendations

Tests

  • 113 new tests (69 skill + 44 provider/pid_manager)
  • 6273 total pass

🤖 Updated by Kōan

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.

Improve local support using ollama command Add ollama-claude provider to route Claude CLI through Ollama via ANTHROPIC_BASE_URL

1 participant