Skip to content

AI Enhancement

thefourCraft edited this page Jun 21, 2026 · 1 revision

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.

Providers

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]
Loading
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

On-device routing

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).

Model management in the UI

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.

Prompts & context

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

Clone this wiki locally