Skip to content

feat: ollama executor for local skill generation#78

Merged
harlan-zw merged 1 commit into
mainfrom
feat/ollama-executor
May 29, 2026
Merged

feat: ollama executor for local skill generation#78
harlan-zw merged 1 commit into
mainfrom
feat/ollama-executor

Conversation

@harlan-zw
Copy link
Copy Markdown
Collaborator

@harlan-zw harlan-zw commented May 29, 2026

🔗 Linked issue

No linked issue.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Skilld could only generate skills through a CLI (claude/gemini/codex) or a pi-ai API key. This adds ollama:<name> as a third backend: one-shot local completions via Ollama's /api/chat, so generation is free, offline, and needs no key.

pi-ai has no Ollama provider, and its OpenAI-compatible path can't set num_ctx. That matters because Ollama defaults to a ~4k context and silently truncates our ~16k-token synthesis prompts, so the executor calls /api/chat directly and sets num_ctx to 32768 (override with OLLAMA_NUM_CTX, host with OLLAMA_HOST).

Discovery lists locally-pulled models via /api/tags, then filters out embedding-only models through /api/show since those 500 on /api/chat. Discovered models show up in skilld config and -m ollama:<name>. The run streams NDJSON deltas to the progress UI and captures token counts.

Verified against a live Ollama: discovery listed local models, embeddinggemma was filtered out, and a streamed completion returned correct text with token usage. Typecheck and lint clean, 866 unit tests pass.

Add `ollama:<name>` models as a generation backend: one-shot local
completions via Ollama's /api/chat (no agentic tool loop, free, offline).
pi-ai has no first-class Ollama provider and its OpenAI-compat path can't
set num_ctx, the knob that prevents silent prompt truncation, so we talk
to /api/chat directly.

- NDJSON streaming with onProgress deltas + token-count capture
- discovery via /api/tags, capability-filtered via /api/show to drop
  embedding-only models (they 500 on /api/chat); appended to
  getAvailableModels and selectable in config / -m ollama:<name>
- num_ctx defaults to 32768 (override OLLAMA_NUM_CTX), host via OLLAMA_HOST
@harlan-zw harlan-zw merged commit eb97ade into main May 29, 2026
1 check passed
@harlan-zw harlan-zw deleted the feat/ollama-executor branch May 29, 2026 05:46
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.

1 participant