feat(#21): Implement Ollama integration #104

Merged
jason.woltje merged 2 commits from feature/21-ollama into develop 2026-01-30 01:42:36 +00:00
Owner

Summary

Adds local LLM capabilities via Ollama integration.

New Endpoints

  • GET /api/llm/health - Ollama health check
  • GET /api/llm/models - List available models
  • POST /api/llm/chat - Chat completion (supports streaming via SSE)
  • POST /api/llm/embed - Generate embeddings

Features

  • Uses official ollama npm package
  • Streaming responses via Server-Sent Events
  • Configurable via env vars (OLLAMA_HOST, OLLAMA_TIMEOUT)
  • Health check on module initialization

Configuration

OLLAMA_HOST=http://localhost:11434
OLLAMA_TIMEOUT=120000

Test Coverage

  • 15 tests passing
  • 86.66% line coverage

QA Checklist

  • Health endpoint returns status when Ollama running
  • Chat completion works (non-streaming)
  • Streaming works (SSE events)
  • Embeddings return vectors
  • Graceful handling when Ollama not available

Closes #21

## Summary Adds local LLM capabilities via Ollama integration. ## New Endpoints - `GET /api/llm/health` - Ollama health check - `GET /api/llm/models` - List available models - `POST /api/llm/chat` - Chat completion (supports streaming via SSE) - `POST /api/llm/embed` - Generate embeddings ## Features - Uses official `ollama` npm package - Streaming responses via Server-Sent Events - Configurable via env vars (OLLAMA_HOST, OLLAMA_TIMEOUT) - Health check on module initialization ## Configuration ```env OLLAMA_HOST=http://localhost:11434 OLLAMA_TIMEOUT=120000 ``` ## Test Coverage - 15 tests passing - 86.66% line coverage ## QA Checklist - [ ] Health endpoint returns status when Ollama running - [ ] Chat completion works (non-streaming) - [ ] Streaming works (SSE events) - [ ] Embeddings return vectors - [ ] Graceful handling when Ollama not available Closes #21
jason.woltje added 1 commit 2026-01-30 01:29:09 +00:00
- Add Ollama client library (ollama npm package)
- Create LlmService for chat completion and embeddings
- Support streaming responses via Server-Sent Events
- Add configuration via env vars (OLLAMA_HOST, OLLAMA_TIMEOUT)
- Create endpoints: GET /llm/health, GET /llm/models, POST /llm/chat, POST /llm/embed
- Replace old OllamaModule with new LlmModule
- Add comprehensive tests with >85% coverage

Closes #21
jason.woltje added 1 commit 2026-01-30 01:42:25 +00:00
jason.woltje merged commit a75265e535 into develop 2026-01-30 01:42:36 +00:00
jason.woltje deleted branch feature/21-ollama 2026-01-30 01:42:37 +00:00
Sign in to join this conversation.