-
Notifications
You must be signed in to change notification settings - Fork 1
AI Enhancement
AI Enhancement post-processes dictated text with an LLM — fixing punctuation, formatting, and following custom prompts. It shares the on-device Gemma model with Read Aloud.
AIService routes to the selected provider. The on-device option (AIProvider.localLLM) is the recommended default for new users — no API key, fully private.
flowchart LR
EN[AIEnhancementService.makeRequest] --> P{selectedProvider}
P -->|localLLM| LLM[LocalLLMModelManager.generate<br/>on-device Gemma]
P -->|ollama| OL[OllamaService]
P -->|localCLI| CLI[LocalCLIService]
P -->|anthropic| AN[AnthropicLLMClient]
P -->|other cloud| OAI[OpenAILLMClient-compatible]
| Provider kind | Key needed | Notes |
|---|---|---|
| On-Device (Gemma) | No | Recommended default; shares the Read Aloud model |
| Ollama | No | Local server |
| Local CLI | No | Shell out to a local command |
| Anthropic / OpenAI / Gemini / Groq / Mistral / … | Yes | Cloud |
When selectedProvider == .localLLM, makeRequest calls LocalLLMModelManager.shared.generate(...) (the same model and loader used by Smart Reading). connectedProviders reports the on-device provider as ready when the GGUF is downloaded (LocalLLMModelManager.isModelDownloaded).
The AI Models screen shows a provider picker; selecting On-Device shows the shared LocalLLMModelCardView (download / progress / installed / delete) — the same card used in Read Aloud settings, so model management looks the same everywhere.
AIEnhancementService builds a system message from the active prompt plus optional context (selected text, clipboard, screen capture, custom vocabulary). Power Mode can swap prompts per app/URL.
See: On-Device LLM · Model Management