Skip to content

Ollama Integration + Model Setup #32

Description

@Omoshirokunai

What

Connect the side panel to a local Ollama/llamafile server. Implement model selection, streaming responses, and graceful offline fallback.

Model Selection & Download

Auto-Download (Current Sprint 2)

  • Add setup modal: "Download qwen2.5 (~400MB)?"
  • Download + launch llamafile binary on first-use
  • Seamless for users, zero manual steps
  • Setup wizard on first-use: "Connect to local AI model"
  • Model selector populated from GET /api/tags endpoint

Acceptance Criteria

  • Prompt input field at bottom of side panel: placeholder "Ask or reply..."
  • Model dropdown get models from GET localhost:11434/api/tags
    • Shows model names (e.g., "qwen2.5:0.5b", "neural-chat:7b")
    • Default selection: first model in list
  • Send only on explicit action: Enter key or Send button click
    • No auto-send; no character limit auto-trigger
  • POST request to localhost:11434/api/generate
  • Response streams into timeline in real-time as ai_suggestion event
  • "Use" button: records ai_interaction with acceptance: 'fully_accepted'
  • "Dismiss" button: records ai_interaction with acceptance: 'rejected'
  • Error handling:
    • Ollama not reachable: show "Local model unavailable. Check Ollama is running."
    • Network error: retry (max 3 attempts)
    • Response timeout (>5s): cancel and show "Response took too long"
  • llamafile tested and documented:
    • Same endpoint works (localhost:11434/api/generate)
    • Note any differences (e.g., model loading time)

Metadata

Metadata

Labels

CoreFoundation extension functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions