feat: Ollama local model support + prompt optimization - #5
Merged
Conversation
Add Ollama as an LLM provider alongside Anthropic, enabling free local inference on Apple Silicon. Users select provider in settings — Ollama requires no API key, just a running local server. - Add LLMProvider type and provider-aware config (types, storage migration) - Create LLMClient abstraction with Anthropic and Ollama implementations - Refactor GroupThinkAI to accept config object, use provider-agnostic client - Update background handlers to pass full config, relax API key guard for Ollama - Add provider selector, per-provider model lists, and connection test to settings UI - Gate app init on provider readiness (not just API key presence) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Local 7B models (qwen2.5) default to domain-based grouping and skip subgroups. Fix with provider-aware prompt engineering and better client-side fallbacks. Prompts (src/lib/prompts.ts): - Add hardened system prompt for local models with explicit anti-domain rules - Add few-shot good/bad examples showing topic-based grouping - Add children example for specificity >= 5 - Drop tabDescriptions/tabTags for Ollama (~60% fewer output tokens) - Strip URL paths for Ollama (hostname only, reduces domain signal) Pipeline (src/lib/grouping.ts): - Rewrite enforceSubgroups from domain clustering to title keyword clustering - Remove "Group A / Group B" alphabetical split fallback - Leave groups flat when no meaningful keyword clusters found Client (src/lib/llm-client.ts): - Set Ollama temperature to 0.15 (avoids deterministic domain-grouping rut) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ojfbot
force-pushed
the
feat/ollama-local-models
branch
from
March 27, 2026 02:51
8076b3f to
04edd34
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createLLMClient(config)Test plan
pnpm type-check && pnpm buildpasses cleanproviderfield migrate correctly (infers from API key presence)🤖 Generated with Claude Code