Files

1 line
100 KiB
JSON

{"repo": "airead/wenzi", "files": {"docs/provider-model-guide.md": {"4bb1770b27f4b9c65f989fb1beef8ff63c72d16d": {"t": 1785746459.5286956, "n": 11519, "h": "f0ee47fdcadf9347", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in 闻字. Both GUI (Settings panel) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [Remote ASR Providers](#remote-asr-providers)\n - [Via GUI](#remote-asr-via-gui)\n - [Via Config File](#remote-asr-via-config-file)\n - [Remote ASR Examples](#remote-asr-examples)\n- [AI (LLM) Provider Configuration](#ai-llm-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\n闻字 supports five ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **Apple Speech** (default) | Multi-language, no download needed | CPU/Neural Engine | On-device or server-based |\n| **FunASR Paraformer** | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **Sherpa-ONNX** | Streaming, lightweight Chinese models | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n| **Whisper API** (remote) | Cloud-based, any hardware | N/A | No (requires API) |\n\n### ASR Via GUI\n\nOpen **Settings...** → **STT** tab. All available local and remote ASR models are listed as radio buttons. Select one to switch — the active model is highlighted.\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, 闻字 will download it automatically on first use (the menubar icon shows `DL X%` progress). Remote ASR models from configured providers also appear in this tab.\n\n### ASR Via Config File\n\nEdit `~/.config/WenZi/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"apple\"`, `\"funasr\"`, `\"sherpa-onnx\"`, `\"mlx-whisper\"`, or `\"whisper-api\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Used by MLX-Whisper and Apple Speech. Ignored by FunASR and Sherpa-ONNX (language is determined by the model) |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart 闻字 for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `apple-speech-ondevice` | apple | Apple Speech (On-Device) | Built-in |\n| `apple-speech-server` | apple | Apple Speech (Server) | Built-in |\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `sherpa-zipformer-zh` | sherpa-onnx | Zipformer Chinese 14M | ~28 MB |\n| `sherpa-paraformer-zh` | sherpa-onnx | Paraformer Bilingual (Chinese-English) | ~220 MB |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n> **Note:** MLX-Whisper tiny/base/small models are not available as presets but can be used by setting `asr.model` directly (e.g., `\"model\": \"mlx-community/whisper-small\"`). Sherpa-ONNX models are downloaded automatically from HuggingFace on first use.\n\n---\n\n## Remote ASR Providers\n\nIn addition to local ASR backends, 闻字 supports remote ASR via OpenAI-compatible audio transcription APIs (e.g. Groq, OpenAI). Remote providers are configured separately from LLM providers.\n\n### Remote ASR Via GUI\n\n1. Open **Settings...** → **STT** tab → **Add Provider...**\n\n2. Fill in the provider details (same dialog format as LLM providers):\n\n ```\n name: groq\n base_url: https://api.groq.com/openai/v1\n api_key: gsk-xxx\n models:\n whisper-large-v3\n ```\n\n3. Click **Verify** — 闻字 will test the connection by sending a short silent audio clip.\n\n4. If verification passes, click **Save**. The new models appear in the **STT** tab.\n\n### Remote ASR Via Config File\n\nEdit `~/.config/WenZi/config.json` and add entries under `asr`:\n\n```json\n{\n \"asr\": {\n \"default_provider\": \"groq\",\n \"default_model\": \"whisper-large-v3\",\n \"providers\": {\n \"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n }\n }\n }\n}\n```\n\nWhen `default_provider` and `default_model` are set, 闻字 starts with the remote ASR model. Set both to `null` to use a local backend.\n\n### Remote ASR Examples\n\n**Groq**\n```json\n\"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"whisper-1\"]\n}\n```\n\n---\n\n## AI (LLM) Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open **Settings...** → **LLM** tab → **Add Provider...**\n\n2. Select a **Preset Provider** from the dropdown (optional):\n - Selecting a preset auto-fills **Name** and **Base URL**\n - A **model dropdown** appears with available models for easy selection\n - Choose **Custom** for manual configuration\n\n3. Fill in your provider details:\n - **Name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **Base URL**: The OpenAI-compatible API endpoint\n - **API Key**: Your API key\n - **Models**: Available models, select from dropdown or type manually (one per line)\n - **Extra Body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — 闻字 will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n#### Supported Preset Providers\n\n| Preset | Provider | Common Models |\n|--------|----------|---------------|\n| OpenAI | OpenAI | gpt-4o, gpt-4o-mini, gpt-4-turbo |\n| Qwen | Alibaba DashScope | qwen-max, qwen-plus, qwen-turbo, qwen-coder-plus |\n| Doubao | ByteDance Volcano | doubao-1-5-pro-32k, doubao-1-5-lite-32k |\n| DeepSeek | DeepSeek | deepseek-chat, deepseek-reasoner |\n| MiniMax | MiniMax | MiniMax-Text-01, abab6.5s-chat |\n| Zhipu | Zhipu AI | glm-4-plus, glm-4-9b, glm-4-flash |\n| Moonshot | Moonshot AI (Kimi) | moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k |\n| SiliconFlow | SiliconFlow | DeepSeek-V3, DeepSeek-R1, Qwen2.5-72B |\n| Ollama | Ollama (Local) | qwen2.5:7b, deepseek-r1:7b, llama3.2:3b |\n\n### Provider Via Config File\n\nEdit `~/.config/WenZi/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart 闻字 for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch LLM provider/model:** Open **Settings...** → **LLM** tab → select from the list of available models.\n\nAll models from all configured providers are shown as radio buttons. The active model is highlighted.\n\n**Switch STT model:** Open **Settings...** → **STT** tab → select one (local or remote).\n\n**Toggle thinking mode:** Open **Settings...** → **AI** tab → **Thinking** checkbox.\n\nYou can also switch STT and LLM models directly from the **preview panel** dropdowns without opening the Settings panel.\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### LLM Provider\n\n**Via GUI:** Open **Settings...** → **LLM** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n### ASR Provider\n\n**Via GUI:** Open **Settings...** → **STT** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `asr.providers` in `config.json`. If it was the active provider, update `asr.default_provider` and `asr.default_model` to `null`.\n\n> The currently active provider cannot be removed. Switch to a different provider/model first.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from **Settings...** → **AI** tab (e.g. \"纠错润色\") to activate.\n"}, "1a31fa0902b14cec89e4a6e09fc7403262d85185": {"t": 1785764554.9100504, "n": 11519, "h": "f0ee47fdcadf9347", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in 闻字. Both GUI (Settings panel) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [Remote ASR Providers](#remote-asr-providers)\n - [Via GUI](#remote-asr-via-gui)\n - [Via Config File](#remote-asr-via-config-file)\n - [Remote ASR Examples](#remote-asr-examples)\n- [AI (LLM) Provider Configuration](#ai-llm-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\n闻字 supports five ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **Apple Speech** (default) | Multi-language, no download needed | CPU/Neural Engine | On-device or server-based |\n| **FunASR Paraformer** | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **Sherpa-ONNX** | Streaming, lightweight Chinese models | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n| **Whisper API** (remote) | Cloud-based, any hardware | N/A | No (requires API) |\n\n### ASR Via GUI\n\nOpen **Settings...** → **STT** tab. All available local and remote ASR models are listed as radio buttons. Select one to switch — the active model is highlighted.\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, 闻字 will download it automatically on first use (the menubar icon shows `DL X%` progress). Remote ASR models from configured providers also appear in this tab.\n\n### ASR Via Config File\n\nEdit `~/.config/WenZi/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"apple\"`, `\"funasr\"`, `\"sherpa-onnx\"`, `\"mlx-whisper\"`, or `\"whisper-api\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Used by MLX-Whisper and Apple Speech. Ignored by FunASR and Sherpa-ONNX (language is determined by the model) |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart 闻字 for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `apple-speech-ondevice` | apple | Apple Speech (On-Device) | Built-in |\n| `apple-speech-server` | apple | Apple Speech (Server) | Built-in |\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `sherpa-zipformer-zh` | sherpa-onnx | Zipformer Chinese 14M | ~28 MB |\n| `sherpa-paraformer-zh` | sherpa-onnx | Paraformer Bilingual (Chinese-English) | ~220 MB |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n> **Note:** MLX-Whisper tiny/base/small models are not available as presets but can be used by setting `asr.model` directly (e.g., `\"model\": \"mlx-community/whisper-small\"`). Sherpa-ONNX models are downloaded automatically from HuggingFace on first use.\n\n---\n\n## Remote ASR Providers\n\nIn addition to local ASR backends, 闻字 supports remote ASR via OpenAI-compatible audio transcription APIs (e.g. Groq, OpenAI). Remote providers are configured separately from LLM providers.\n\n### Remote ASR Via GUI\n\n1. Open **Settings...** → **STT** tab → **Add Provider...**\n\n2. Fill in the provider details (same dialog format as LLM providers):\n\n ```\n name: groq\n base_url: https://api.groq.com/openai/v1\n api_key: gsk-xxx\n models:\n whisper-large-v3\n ```\n\n3. Click **Verify** — 闻字 will test the connection by sending a short silent audio clip.\n\n4. If verification passes, click **Save**. The new models appear in the **STT** tab.\n\n### Remote ASR Via Config File\n\nEdit `~/.config/WenZi/config.json` and add entries under `asr`:\n\n```json\n{\n \"asr\": {\n \"default_provider\": \"groq\",\n \"default_model\": \"whisper-large-v3\",\n \"providers\": {\n \"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n }\n }\n }\n}\n```\n\nWhen `default_provider` and `default_model` are set, 闻字 starts with the remote ASR model. Set both to `null` to use a local backend.\n\n### Remote ASR Examples\n\n**Groq**\n```json\n\"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"whisper-1\"]\n}\n```\n\n---\n\n## AI (LLM) Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open **Settings...** → **LLM** tab → **Add Provider...**\n\n2. Select a **Preset Provider** from the dropdown (optional):\n - Selecting a preset auto-fills **Name** and **Base URL**\n - A **model dropdown** appears with available models for easy selection\n - Choose **Custom** for manual configuration\n\n3. Fill in your provider details:\n - **Name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **Base URL**: The OpenAI-compatible API endpoint\n - **API Key**: Your API key\n - **Models**: Available models, select from dropdown or type manually (one per line)\n - **Extra Body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — 闻字 will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n#### Supported Preset Providers\n\n| Preset | Provider | Common Models |\n|--------|----------|---------------|\n| OpenAI | OpenAI | gpt-4o, gpt-4o-mini, gpt-4-turbo |\n| Qwen | Alibaba DashScope | qwen-max, qwen-plus, qwen-turbo, qwen-coder-plus |\n| Doubao | ByteDance Volcano | doubao-1-5-pro-32k, doubao-1-5-lite-32k |\n| DeepSeek | DeepSeek | deepseek-chat, deepseek-reasoner |\n| MiniMax | MiniMax | MiniMax-Text-01, abab6.5s-chat |\n| Zhipu | Zhipu AI | glm-4-plus, glm-4-9b, glm-4-flash |\n| Moonshot | Moonshot AI (Kimi) | moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k |\n| SiliconFlow | SiliconFlow | DeepSeek-V3, DeepSeek-R1, Qwen2.5-72B |\n| Ollama | Ollama (Local) | qwen2.5:7b, deepseek-r1:7b, llama3.2:3b |\n\n### Provider Via Config File\n\nEdit `~/.config/WenZi/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart 闻字 for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch LLM provider/model:** Open **Settings...** → **LLM** tab → select from the list of available models.\n\nAll models from all configured providers are shown as radio buttons. The active model is highlighted.\n\n**Switch STT model:** Open **Settings...** → **STT** tab → select one (local or remote).\n\n**Toggle thinking mode:** Open **Settings...** → **AI** tab → **Thinking** checkbox.\n\nYou can also switch STT and LLM models directly from the **preview panel** dropdowns without opening the Settings panel.\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### LLM Provider\n\n**Via GUI:** Open **Settings...** → **LLM** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n### ASR Provider\n\n**Via GUI:** Open **Settings...** → **STT** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `asr.providers` in `config.json`. If it was the active provider, update `asr.default_provider` and `asr.default_model` to `null`.\n\n> The currently active provider cannot be removed. Switch to a different provider/model first.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from **Settings...** → **AI** tab (e.g. \"纠错润色\") to activate.\n"}, "ec11e7394cb9e0ec01b2bdd50f3916dc527437b7": {"t": 1785764556.2622702, "n": 10795, "h": "a98e6aaa344508fe", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in 闻字. Both GUI (Settings panel) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [Remote ASR Providers](#remote-asr-providers)\n - [Via GUI](#remote-asr-via-gui)\n - [Via Config File](#remote-asr-via-config-file)\n - [Remote ASR Examples](#remote-asr-examples)\n- [AI (LLM) Provider Configuration](#ai-llm-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\n闻字 supports five ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **Apple Speech** (default) | Multi-language, no download needed | CPU/Neural Engine | On-device or server-based |\n| **FunASR Paraformer** | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **Sherpa-ONNX** | Streaming, lightweight Chinese models | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n| **Whisper API** (remote) | Cloud-based, any hardware | N/A | No (requires API) |\n\n### ASR Via GUI\n\nOpen **Settings...** → **STT** tab. All available local and remote ASR models are listed as radio buttons. Select one to switch — the active model is highlighted.\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, 闻字 will download it automatically on first use (the menubar icon shows `DL X%` progress). Remote ASR models from configured providers also appear in this tab.\n\n### ASR Via Config File\n\nEdit `~/.config/WenZi/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"apple\"`, `\"funasr\"`, `\"sherpa-onnx\"`, `\"mlx-whisper\"`, or `\"whisper-api\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Used by MLX-Whisper and Apple Speech. Ignored by FunASR and Sherpa-ONNX (language is determined by the model) |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart 闻字 for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `apple-speech-ondevice` | apple | Apple Speech (On-Device) | Built-in |\n| `apple-speech-server` | apple | Apple Speech (Server) | Built-in |\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `sherpa-zipformer-zh` | sherpa-onnx | Zipformer Chinese 14M | ~28 MB |\n| `sherpa-paraformer-zh` | sherpa-onnx | Paraformer Bilingual (Chinese-English) | ~220 MB |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n> **Note:** MLX-Whisper tiny/base/small models are not available as presets but can be used by setting `asr.model` directly (e.g., `\"model\": \"mlx-community/whisper-small\"`). Sherpa-ONNX models are downloaded automatically from HuggingFace on first use.\n\n---\n\n## Remote ASR Providers\n\nIn addition to local ASR backends, 闻字 supports remote ASR via OpenAI-compatible audio transcription APIs (e.g. Groq, OpenAI). Remote providers are configured separately from LLM providers.\n\n### Remote ASR Via GUI\n\n1. Open **Settings...** → **STT** tab → **Add Provider...**\n\n2. Fill in the provider details (same dialog format as LLM providers):\n\n ```\n name: groq\n base_url: https://api.groq.com/openai/v1\n api_key: gsk-xxx\n models:\n whisper-large-v3\n ```\n\n3. Click **Verify** — 闻字 will test the connection by sending a short silent audio clip.\n\n4. If verification passes, click **Save**. The new models appear in the **STT** tab.\n\n### Remote ASR Via Config File\n\nEdit `~/.config/WenZi/config.json` and add entries under `asr`:\n\n```json\n{\n \"asr\": {\n \"default_provider\": \"groq\",\n \"default_model\": \"whisper-large-v3\",\n \"providers\": {\n \"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n }\n }\n }\n}\n```\n\nWhen `default_provider` and `default_model` are set, 闻字 starts with the remote ASR model. Set both to `null` to use a local backend.\n\n### Remote ASR Examples\n\n**Groq**\n```json\n\"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"whisper-1\"]\n}\n```\n\n---\n\n## AI (LLM) Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open **Settings...** → **LLM** tab → **Add Provider...**\n\n2. A text editor dialog appears with a template:\n\n ```\n name: my-provider\n base_url: https://api.openai.com/v1\n api_key: sk-xxx\n models:\n gpt-4o\n gpt-4o-mini\n extra_body: {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n ```\n\n3. Fill in your provider details:\n - **name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **base_url**: The OpenAI-compatible API endpoint\n - **api_key**: Your API key\n - **models**: List your available models, one per line under `models:`\n - **extra_body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — 闻字 will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n### Provider Via Config File\n\nEdit `~/.config/WenZi/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart 闻字 for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch LLM provider/model:** Open **Settings...** → **LLM** tab → select from the list of available models.\n\nAll models from all configured providers are shown as radio buttons. The active model is highlighted.\n\n**Switch STT model:** Open **Settings...** → **STT** tab → select one (local or remote).\n\n**Toggle thinking mode:** Open **Settings...** → **AI** tab → **Thinking** checkbox.\n\nYou can also switch STT and LLM models directly from the **preview panel** dropdowns without opening the Settings panel.\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### LLM Provider\n\n**Via GUI:** Open **Settings...** → **LLM** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n### ASR Provider\n\n**Via GUI:** Open **Settings...** → **STT** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `asr.providers` in `config.json`. If it was the active provider, update `asr.default_provider` and `asr.default_model` to `null`.\n\n> The currently active provider cannot be removed. Switch to a different provider/model first.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from **Settings...** → **AI** tab (e.g. \"纠错润色\") to activate.\n"}, "112eedf35019a9c4f4af391feef41c67fe26fc5d": {"t": 1785764557.692114, "n": 10870, "h": "0514a584e64b92a0", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in VoiceText. Both GUI (Settings panel) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [Remote ASR Providers](#remote-asr-providers)\n - [Via GUI](#remote-asr-via-gui)\n - [Via Config File](#remote-asr-via-config-file)\n - [Remote ASR Examples](#remote-asr-examples)\n- [AI (LLM) Provider Configuration](#ai-llm-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\nVoiceText supports five ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **Apple Speech** (default) | Multi-language, no download needed | CPU/Neural Engine | On-device or server-based |\n| **FunASR Paraformer** | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **Sherpa-ONNX** | Streaming, lightweight Chinese models | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n| **Whisper API** (remote) | Cloud-based, any hardware | N/A | No (requires API) |\n\n### ASR Via GUI\n\nOpen **Settings...** → **STT** tab. All available local and remote ASR models are listed as radio buttons. Select one to switch — the active model is highlighted.\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, VoiceText will download it automatically on first use (the menubar icon shows `DL X%` progress). Remote ASR models from configured providers also appear in this tab.\n\n### ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"apple\"`, `\"funasr\"`, `\"sherpa-onnx\"`, `\"mlx-whisper\"`, or `\"whisper-api\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Used by MLX-Whisper and Apple Speech. Ignored by FunASR and Sherpa-ONNX (language is determined by the model) |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `apple-speech-ondevice` | apple | Apple Speech (On-Device) | Built-in |\n| `apple-speech-server` | apple | Apple Speech (Server) | Built-in |\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `sherpa-zipformer-zh` | sherpa-onnx | Zipformer Chinese 14M | ~28 MB |\n| `sherpa-paraformer-zh` | sherpa-onnx | Paraformer Bilingual (Chinese-English) | ~220 MB |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n> **Note:** MLX-Whisper tiny/base/small models are not available as presets but can be used by setting `asr.model` directly (e.g., `\"model\": \"mlx-community/whisper-small\"`). Sherpa-ONNX models are downloaded automatically from HuggingFace on first use.\n\n---\n\n## Remote ASR Providers\n\nIn addition to local ASR backends, VoiceText supports remote ASR via OpenAI-compatible audio transcription APIs (e.g. Groq, OpenAI). Remote providers are configured separately from LLM providers.\n\n### Remote ASR Via GUI\n\n1. Open **Settings...** → **STT** tab → **Add Provider...**\n\n2. Fill in the provider details (same dialog format as LLM providers):\n\n ```\n name: groq\n base_url: https://api.groq.com/openai/v1\n api_key: gsk-xxx\n models:\n whisper-large-v3\n ```\n\n3. Click **Verify** — VoiceText will test the connection by sending a short silent audio clip.\n\n4. If verification passes, click **Save**. The new models appear in the **STT** tab.\n\n### Remote ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `asr`:\n\n```json\n{\n \"asr\": {\n \"default_provider\": \"groq\",\n \"default_model\": \"whisper-large-v3\",\n \"providers\": {\n \"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n }\n }\n }\n}\n```\n\nWhen `default_provider` and `default_model` are set, VoiceText starts with the remote ASR model. Set both to `null` to use a local backend.\n\n### Remote ASR Examples\n\n**Groq**\n```json\n\"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"whisper-1\"]\n}\n```\n\n---\n\n## AI (LLM) Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open **Settings...** → **LLM** tab → **Add Provider...**\n\n2. A text editor dialog appears with a template:\n\n ```\n name: my-provider\n base_url: https://api.openai.com/v1\n api_key: sk-xxx\n models:\n gpt-4o\n gpt-4o-mini\n extra_body: {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n ```\n\n3. Fill in your provider details:\n - **name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **base_url**: The OpenAI-compatible API endpoint\n - **api_key**: Your API key\n - **models**: List your available models, one per line under `models:`\n - **extra_body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — VoiceText will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n### Provider Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch LLM provider/model:** Open **Settings...** → **LLM** tab → select from the list of available models.\n\nAll models from all configured providers are shown as radio buttons. The active model is highlighted.\n\n**Switch STT model:** Open **Settings...** → **STT** tab → select one (local or remote).\n\n**Toggle thinking mode:** Open **Settings...** → **AI** tab → **Thinking** checkbox.\n\nYou can also switch STT and LLM models directly from the **preview panel** dropdowns without opening the Settings panel.\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### LLM Provider\n\n**Via GUI:** Open **Settings...** → **LLM** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n### ASR Provider\n\n**Via GUI:** Open **Settings...** → **STT** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `asr.providers` in `config.json`. If it was the active provider, update `asr.default_provider` and `asr.default_model` to `null`.\n\n> The currently active provider cannot be removed. Switch to a different provider/model first.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from **Settings...** → **AI** tab (e.g. \"纠错润色\") to activate.\n"}, "7658af11cc8f6315d4ad961d543a5098d40839c2": {"t": 1785764558.9333355, "n": 10428, "h": "73f881b0ec4e90ba", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in VoiceText. Both GUI (Settings panel) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [Remote ASR Providers](#remote-asr-providers)\n - [Via GUI](#remote-asr-via-gui)\n - [Via Config File](#remote-asr-via-config-file)\n - [Remote ASR Examples](#remote-asr-examples)\n- [AI (LLM) Provider Configuration](#ai-llm-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\nVoiceText supports four ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **FunASR Paraformer** (default) | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n| **Apple Speech** | Multi-language, no download needed | CPU/Neural Engine | On-device or server-based |\n| **Whisper API** (remote) | Cloud-based, any hardware | N/A | No (requires API) |\n\n### ASR Via GUI\n\nOpen **Settings...** → **STT** tab. All available local and remote ASR models are listed as radio buttons. Select one to switch — the active model is highlighted.\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, VoiceText will download it automatically on first use (the menubar icon shows `DL X%` progress). Remote ASR models from configured providers also appear in this tab.\n\n### ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"funasr\"`, `\"mlx-whisper\"`, or `\"apple\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code for MLX-Whisper (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Ignored by FunASR |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `apple-speech-ondevice` | apple-speech | Apple Speech (On-Device) | Built-in |\n| `apple-speech-server` | apple-speech | Apple Speech (Server) | Built-in |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n> **Note:** MLX-Whisper tiny/base/small models are not available as presets but can be used by setting `asr.model` directly (e.g., `\"model\": \"mlx-community/whisper-small\"`).\n\n---\n\n## Remote ASR Providers\n\nIn addition to local ASR backends, VoiceText supports remote ASR via OpenAI-compatible audio transcription APIs (e.g. Groq, OpenAI). Remote providers are configured separately from LLM providers.\n\n### Remote ASR Via GUI\n\n1. Open **Settings...** → **STT** tab → **Add Provider...**\n\n2. Fill in the provider details (same dialog format as LLM providers):\n\n ```\n name: groq\n base_url: https://api.groq.com/openai/v1\n api_key: gsk-xxx\n models:\n whisper-large-v3\n ```\n\n3. Click **Verify** — VoiceText will test the connection by sending a short silent audio clip.\n\n4. If verification passes, click **Save**. The new models appear in the **STT** tab.\n\n### Remote ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `asr`:\n\n```json\n{\n \"asr\": {\n \"default_provider\": \"groq\",\n \"default_model\": \"whisper-large-v3\",\n \"providers\": {\n \"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n }\n }\n }\n}\n```\n\nWhen `default_provider` and `default_model` are set, VoiceText starts with the remote ASR model. Set both to `null` to use a local backend.\n\n### Remote ASR Examples\n\n**Groq**\n```json\n\"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"whisper-1\"]\n}\n```\n\n---\n\n## AI (LLM) Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open **Settings...** → **LLM** tab → **Add Provider...**\n\n2. A text editor dialog appears with a template:\n\n ```\n name: my-provider\n base_url: https://api.openai.com/v1\n api_key: sk-xxx\n models:\n gpt-4o\n gpt-4o-mini\n extra_body: {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n ```\n\n3. Fill in your provider details:\n - **name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **base_url**: The OpenAI-compatible API endpoint\n - **api_key**: Your API key\n - **models**: List your available models, one per line under `models:`\n - **extra_body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — VoiceText will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n### Provider Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch LLM provider/model:** Open **Settings...** → **LLM** tab → select from the list of available models.\n\nAll models from all configured providers are shown as radio buttons. The active model is highlighted.\n\n**Switch STT model:** Open **Settings...** → **STT** tab → select one (local or remote).\n\n**Toggle thinking mode:** Open **Settings...** → **AI** tab → **Thinking** checkbox.\n\nYou can also switch STT and LLM models directly from the **preview panel** dropdowns without opening the Settings panel.\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### LLM Provider\n\n**Via GUI:** Open **Settings...** → **LLM** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n### ASR Provider\n\n**Via GUI:** Open **Settings...** → **STT** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `asr.providers` in `config.json`. If it was the active provider, update `asr.default_provider` and `asr.default_model` to `null`.\n\n> The currently active provider cannot be removed. Switch to a different provider/model first.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from **Settings...** → **AI** tab (e.g. \"纠错润色\") to activate.\n"}, "fe77c454672361d4622a78ead996f676b10c7f65": {"t": 1785764560.2485876, "n": 10331, "h": "c3cb28420082318e", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in VoiceText. Both GUI (Settings panel) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [Remote ASR Providers](#remote-asr-providers)\n - [Via GUI](#remote-asr-via-gui)\n - [Via Config File](#remote-asr-via-config-file)\n - [Remote ASR Examples](#remote-asr-examples)\n- [AI (LLM) Provider Configuration](#ai-llm-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\nVoiceText supports four ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **FunASR Paraformer** (default) | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n| **Apple Speech** | Multi-language, no download needed | CPU/Neural Engine | On-device or server-based |\n| **Whisper API** (remote) | Cloud-based, any hardware | N/A | No (requires API) |\n\n### ASR Via GUI\n\nOpen **Settings...** → **STT** tab. All available local and remote ASR models are listed as radio buttons. Select one to switch — the active model is highlighted.\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, VoiceText will download it automatically on first use (the menubar icon shows `DL X%` progress). Remote ASR models from configured providers also appear in this tab.\n\n### ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"funasr\"`, `\"mlx-whisper\"`, or `\"apple\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code for MLX-Whisper (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Ignored by FunASR |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `mlx-whisper-tiny` | mlx-whisper | `mlx-community/whisper-tiny` | ~75 MB |\n| `mlx-whisper-base` | mlx-whisper | `mlx-community/whisper-base` | ~140 MB |\n| `mlx-whisper-small` | mlx-whisper | `mlx-community/whisper-small` | ~460 MB |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n---\n\n## Remote ASR Providers\n\nIn addition to local ASR backends, VoiceText supports remote ASR via OpenAI-compatible audio transcription APIs (e.g. Groq, OpenAI). Remote providers are configured separately from LLM providers.\n\n### Remote ASR Via GUI\n\n1. Open **Settings...** → **STT** tab → **Add Provider...**\n\n2. Fill in the provider details (same dialog format as LLM providers):\n\n ```\n name: groq\n base_url: https://api.groq.com/openai/v1\n api_key: gsk-xxx\n models:\n whisper-large-v3\n ```\n\n3. Click **Verify** — VoiceText will test the connection by sending a short silent audio clip.\n\n4. If verification passes, click **Save**. The new models appear in the **STT** tab.\n\n### Remote ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `asr`:\n\n```json\n{\n \"asr\": {\n \"default_provider\": \"groq\",\n \"default_model\": \"whisper-large-v3\",\n \"providers\": {\n \"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n }\n }\n }\n}\n```\n\nWhen `default_provider` and `default_model` are set, VoiceText starts with the remote ASR model. Set both to `null` to use a local backend.\n\n### Remote ASR Examples\n\n**Groq**\n```json\n\"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"whisper-1\"]\n}\n```\n\n---\n\n## AI (LLM) Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open **Settings...** → **LLM** tab → **Add Provider...**\n\n2. A text editor dialog appears with a template:\n\n ```\n name: my-provider\n base_url: https://api.openai.com/v1\n api_key: sk-xxx\n models:\n gpt-4o\n gpt-4o-mini\n extra_body: {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n ```\n\n3. Fill in your provider details:\n - **name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **base_url**: The OpenAI-compatible API endpoint\n - **api_key**: Your API key\n - **models**: List your available models, one per line under `models:`\n - **extra_body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — VoiceText will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n### Provider Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch LLM provider/model:** Open **Settings...** → **LLM** tab → select from the list of available models.\n\nAll models from all configured providers are shown as radio buttons. The active model is highlighted.\n\n**Switch STT model:** Open **Settings...** → **STT** tab → select one (local or remote).\n\n**Toggle thinking mode:** Open **Settings...** → **AI** tab → **Thinking** checkbox.\n\nYou can also switch STT and LLM models directly from the **preview panel** dropdowns without opening the Settings panel.\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### LLM Provider\n\n**Via GUI:** Open **Settings...** → **LLM** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n### ASR Provider\n\n**Via GUI:** Open **Settings...** → **STT** tab → **Remove...** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `asr.providers` in `config.json`. If it was the active provider, update `asr.default_provider` and `asr.default_model` to `null`.\n\n> The currently active provider cannot be removed. Switch to a different provider/model first.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from **Settings...** → **AI** tab (e.g. \"纠错润色\") to activate.\n"}, "8a83bc1e75ee1adf7a9bb3031ac55c80646611d2": {"t": 1785764561.875488, "n": 10606, "h": "40f66416227ddfd7", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in VoiceText. Both GUI (menubar) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [Remote ASR Providers](#remote-asr-providers)\n - [Via GUI](#remote-asr-via-gui)\n - [Via Config File](#remote-asr-via-config-file)\n - [Remote ASR Examples](#remote-asr-examples)\n- [AI (LLM) Provider Configuration](#ai-llm-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\nVoiceText supports four ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **FunASR Paraformer** (default) | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n| **Apple Speech** | Multi-language, no download needed | CPU/Neural Engine | On-device or server-based |\n| **Whisper API** (remote) | Cloud-based, any hardware | N/A | No (requires API) |\n\n### ASR Via GUI\n\nClick the **STT Model** submenu in the menubar. Select any model — a checkmark indicates the active one:\n\n```\nSTT Model\n├── ✓ FunASR Paraformer (Chinese)\n├── Whisper tiny (MLX)\n├── Whisper base (MLX)\n├── Whisper small (MLX)\n├── Whisper medium (MLX)\n├── Whisper large-v3-turbo (MLX)\n├── Apple Speech (macOS built-in)\n├── ─────────────────\n├── groq / whisper-large-v3 (remote, if configured)\n├── ─────────────────\n├── Add ASR Provider...\n└── Remove ASR Provider\n```\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, VoiceText will download it automatically on first use. Remote ASR models from configured providers also appear in this menu.\n\n### ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"funasr\"`, `\"mlx-whisper\"`, or `\"apple\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code for MLX-Whisper (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Ignored by FunASR |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `mlx-whisper-tiny` | mlx-whisper | `mlx-community/whisper-tiny` | ~75 MB |\n| `mlx-whisper-base` | mlx-whisper | `mlx-community/whisper-base` | ~140 MB |\n| `mlx-whisper-small` | mlx-whisper | `mlx-community/whisper-small` | ~460 MB |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n---\n\n## Remote ASR Providers\n\nIn addition to local ASR backends, VoiceText supports remote ASR via OpenAI-compatible audio transcription APIs (e.g. Groq, OpenAI). Remote providers are configured separately from LLM providers.\n\n### Remote ASR Via GUI\n\n1. Open menubar → **STT Model** → **Add ASR Provider...**\n\n2. Fill in the provider details (same dialog format as LLM providers):\n\n ```\n name: groq\n base_url: https://api.groq.com/openai/v1\n api_key: gsk-xxx\n models:\n whisper-large-v3\n ```\n\n3. Click **Verify** — VoiceText will test the connection by sending a short silent audio clip.\n\n4. If verification passes, click **Save**. The new models appear in the **STT Model** menu.\n\n### Remote ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `asr`:\n\n```json\n{\n \"asr\": {\n \"default_provider\": \"groq\",\n \"default_model\": \"whisper-large-v3\",\n \"providers\": {\n \"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n }\n }\n }\n}\n```\n\nWhen `default_provider` and `default_model` are set, VoiceText starts with the remote ASR model. Set both to `null` to use a local backend.\n\n### Remote ASR Examples\n\n**Groq**\n```json\n\"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"whisper-1\"]\n}\n```\n\n---\n\n## AI (LLM) Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open menubar → **LLM Model** → **Add Provider...**\n\n2. A text editor dialog appears with a template:\n\n ```\n name: my-provider\n base_url: https://api.openai.com/v1\n api_key: sk-xxx\n models:\n gpt-4o\n gpt-4o-mini\n extra_body: {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n ```\n\n3. Fill in your provider details:\n - **name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **base_url**: The OpenAI-compatible API endpoint\n - **api_key**: Your API key\n - **models**: List your available models, one per line under `models:`\n - **extra_body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — VoiceText will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n### Provider Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch LLM provider/model:** Menubar → **LLM Model** → select one\n\n```\nLLM Model\n├── ✓ ollama / qwen2.5:7b\n├── ollama / llama3.1:8b\n├── openai / gpt-4o\n├── openai / gpt-4o-mini\n├── ─────────────────\n├── Add Provider...\n└── Remove Provider\n```\n\nAll models from all configured providers are shown in a flat list. The active model has a checkmark.\n\n**Switch STT model:** Menubar → **STT Model** → select one (local or remote)\n\n**Toggle thinking mode:** Menubar → **AI Settings** → **Thinking** (checkbox)\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### LLM Provider\n\n**Via GUI:** Menubar → **LLM Model** → **Remove Provider** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n### ASR Provider\n\n**Via GUI:** Menubar → **STT Model** → **Remove ASR Provider** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `asr.providers` in `config.json`. If it was the active provider, update `asr.default_provider` and `asr.default_model` to `null`.\n\n> The currently active provider cannot be removed. Switch to a different provider/model first.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from menubar → **AI Enhance** (e.g. \"纠错润色\") to activate.\n"}, "6169099aca29e7589f9867185605bdc370b89bf7": {"t": 1785764563.2898614, "n": 10453, "h": "0783d3901be8ac61", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in VoiceText. Both GUI (menubar) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [Remote ASR Providers](#remote-asr-providers)\n - [Via GUI](#remote-asr-via-gui)\n - [Via Config File](#remote-asr-via-config-file)\n - [Remote ASR Examples](#remote-asr-examples)\n- [AI (LLM) Provider Configuration](#ai-llm-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\nVoiceText supports three ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **FunASR Paraformer** (default) | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n| **Whisper API** (remote) | Cloud-based, any hardware | N/A | No (requires API) |\n\n### ASR Via GUI\n\nClick the **STT Model** submenu in the menubar. Select any model — a checkmark indicates the active one:\n\n```\nSTT Model\n├── ✓ FunASR Paraformer (Chinese)\n├── Whisper tiny (MLX)\n├── Whisper base (MLX)\n├── Whisper small (MLX)\n├── Whisper medium (MLX)\n├── Whisper large-v3-turbo (MLX)\n├── ─────────────────\n├── groq / whisper-large-v3 (remote, if configured)\n├── ─────────────────\n├── Add ASR Provider...\n└── Remove ASR Provider\n```\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, VoiceText will download it automatically on first use. Remote ASR models from configured providers also appear in this menu.\n\n### ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"funasr\"` or `\"mlx-whisper\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code for MLX-Whisper (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Ignored by FunASR |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `mlx-whisper-tiny` | mlx-whisper | `mlx-community/whisper-tiny` | ~75 MB |\n| `mlx-whisper-base` | mlx-whisper | `mlx-community/whisper-base` | ~140 MB |\n| `mlx-whisper-small` | mlx-whisper | `mlx-community/whisper-small` | ~460 MB |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n---\n\n## Remote ASR Providers\n\nIn addition to local ASR backends, VoiceText supports remote ASR via OpenAI-compatible audio transcription APIs (e.g. Groq, OpenAI). Remote providers are configured separately from LLM providers.\n\n### Remote ASR Via GUI\n\n1. Open menubar → **STT Model** → **Add ASR Provider...**\n\n2. Fill in the provider details (same dialog format as LLM providers):\n\n ```\n name: groq\n base_url: https://api.groq.com/openai/v1\n api_key: gsk-xxx\n models:\n whisper-large-v3\n ```\n\n3. Click **Verify** — VoiceText will test the connection by sending a short silent audio clip.\n\n4. If verification passes, click **Save**. The new models appear in the **STT Model** menu.\n\n### Remote ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `asr`:\n\n```json\n{\n \"asr\": {\n \"default_provider\": \"groq\",\n \"default_model\": \"whisper-large-v3\",\n \"providers\": {\n \"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n }\n }\n }\n}\n```\n\nWhen `default_provider` and `default_model` are set, VoiceText starts with the remote ASR model. Set both to `null` to use a local backend.\n\n### Remote ASR Examples\n\n**Groq**\n```json\n\"groq\": {\n \"base_url\": \"https://api.groq.com/openai/v1\",\n \"api_key\": \"gsk-xxx\",\n \"models\": [\"whisper-large-v3\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"whisper-1\"]\n}\n```\n\n---\n\n## AI (LLM) Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open menubar → **LLM Model** → **Add Provider...**\n\n2. A text editor dialog appears with a template:\n\n ```\n name: my-provider\n base_url: https://api.openai.com/v1\n api_key: sk-xxx\n models:\n gpt-4o\n gpt-4o-mini\n extra_body: {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n ```\n\n3. Fill in your provider details:\n - **name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **base_url**: The OpenAI-compatible API endpoint\n - **api_key**: Your API key\n - **models**: List your available models, one per line under `models:`\n - **extra_body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — VoiceText will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n### Provider Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch LLM provider/model:** Menubar → **LLM Model** → select one\n\n```\nLLM Model\n├── ✓ ollama / qwen2.5:7b\n├── ollama / llama3.1:8b\n├── openai / gpt-4o\n├── openai / gpt-4o-mini\n├── ─────────────────\n├── Add Provider...\n└── Remove Provider\n```\n\nAll models from all configured providers are shown in a flat list. The active model has a checkmark.\n\n**Switch STT model:** Menubar → **STT Model** → select one (local or remote)\n\n**Toggle thinking mode:** Menubar → **AI Settings** → **Thinking** (checkbox)\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### LLM Provider\n\n**Via GUI:** Menubar → **LLM Model** → **Remove Provider** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n### ASR Provider\n\n**Via GUI:** Menubar → **STT Model** → **Remove ASR Provider** → select the provider to remove → confirm in the dialog.\n\n**Via Config File:** Delete the provider entry from `asr.providers` in `config.json`. If it was the active provider, update `asr.default_provider` and `asr.default_model` to `null`.\n\n> The currently active provider cannot be removed. Switch to a different provider/model first.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from menubar → **AI Enhance** (e.g. \"纠错润色\") to activate.\n"}, "777a8c781166a69b85d4b45580a206b6a21603c7": {"t": 1785764564.8313475, "n": 8077, "h": "5647a59fb4f0eb7d", "c": "# Provider & Model Setup Guide\n\nThis guide explains how to configure ASR (speech recognition) models and AI enhancement providers in VoiceText. Both GUI (menubar) and config file approaches are covered.\n\n## Table of Contents\n\n- [ASR Model Selection](#asr-model-selection)\n - [Via GUI](#asr-via-gui)\n - [Via Config File](#asr-via-config-file)\n - [Available Models](#available-asr-models)\n- [AI Provider Configuration](#ai-provider-configuration)\n - [Via GUI](#provider-via-gui)\n - [Via Config File](#provider-via-config-file)\n - [Provider Examples](#provider-examples)\n- [Switching Provider & Model](#switching-provider--model)\n - [Via GUI](#switching-via-gui)\n - [Via Config File](#switching-via-config-file)\n- [Removing a Provider](#removing-a-provider)\n\n---\n\n## ASR Model Selection\n\nVoiceText supports two ASR backends:\n\n| Backend | Best For | GPU | Offline |\n|---------|----------|-----|---------|\n| **FunASR Paraformer** (default) | Chinese speech | CPU (ONNX) | Yes (after first download) |\n| **MLX-Whisper** | Multi-language, Apple Silicon | GPU (MLX) | Yes (after first download) |\n\n### ASR Via GUI\n\nClick the **Model** submenu in the menubar. Select any model — a checkmark indicates the active one:\n\n```\nModel\n├── ✓ FunASR Paraformer (Chinese)\n├── Whisper tiny (MLX)\n├── Whisper base (MLX)\n├── Whisper small (MLX)\n├── Whisper medium (MLX)\n└── Whisper large-v3-turbo (MLX)\n```\n\nIf the selected MLX-Whisper model hasn't been downloaded yet, VoiceText will download it automatically on first use.\n\n### ASR Via Config File\n\nEdit `~/.config/VoiceText/config.json`:\n\n```json\n{\n \"asr\": {\n \"backend\": \"mlx-whisper\",\n \"preset\": \"mlx-whisper-small\",\n \"model\": null,\n \"language\": \"zh\",\n \"temperature\": 0.0\n }\n}\n```\n\nKey fields:\n\n| Field | Description |\n|-------|-------------|\n| `backend` | `\"funasr\"` or `\"mlx-whisper\"` |\n| `preset` | Preset ID from the table below (recommended way to select a model) |\n| `model` | Direct model path override (e.g. a custom HuggingFace model ID). Overrides `preset` |\n| `language` | Language code for MLX-Whisper (`\"zh\"`, `\"en\"`, `\"ja\"`, etc.). Ignored by FunASR |\n| `temperature` | Decoding temperature for MLX-Whisper. `0.0` = greedy |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Available ASR Models\n\n| Preset ID | Backend | Model | Size |\n|-----------|---------|-------|------|\n| `funasr-paraformer` | funasr | Paraformer-large (Chinese) | ~400 MB |\n| `mlx-whisper-tiny` | mlx-whisper | `mlx-community/whisper-tiny` | ~75 MB |\n| `mlx-whisper-base` | mlx-whisper | `mlx-community/whisper-base` | ~140 MB |\n| `mlx-whisper-small` | mlx-whisper | `mlx-community/whisper-small` | ~460 MB |\n| `mlx-whisper-medium` | mlx-whisper | `mlx-community/whisper-medium` | ~1.5 GB |\n| `mlx-whisper-large-v3-turbo` | mlx-whisper | `mlx-community/whisper-large-v3-turbo` | ~1.6 GB |\n\n---\n\n## AI Provider Configuration\n\nAI enhancement uses OpenAI-compatible LLM providers. You can configure multiple providers and switch between them at any time.\n\n### Provider Via GUI\n\n1. Open menubar → **AI Settings** → **Add Provider...**\n\n2. A text editor dialog appears with a template:\n\n ```\n name: my-provider\n base_url: https://api.openai.com/v1\n api_key: sk-xxx\n models:\n gpt-4o\n gpt-4o-mini\n extra_body: {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n ```\n\n3. Fill in your provider details:\n - **name**: A unique identifier (e.g. `openai`, `deepseek`, `local-llama`)\n - **base_url**: The OpenAI-compatible API endpoint\n - **api_key**: Your API key\n - **models**: List your available models, one per line under `models:`\n - **extra_body** (optional): Additional JSON parameters sent with every request\n\n4. Click **Verify** — VoiceText will test the connection using the first model in your list.\n\n5. If verification passes, click **Save** to add the provider.\n\n### Provider Via Config File\n\nEdit `~/.config/VoiceText/config.json` and add entries under `ai_enhance.providers`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nEach provider entry requires:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `base_url` | Yes | OpenAI-compatible API endpoint URL |\n| `api_key` | Yes | Authentication key |\n| `models` | Yes | Array of model names available from this provider |\n| `extra_body` | No | JSON object with extra request parameters |\n\nAfter editing, restart VoiceText for changes to take effect.\n\n### Provider Examples\n\n**Ollama (local)**\n```json\n\"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\", \"llama3.1:8b\"]\n}\n```\n\n**OpenAI**\n```json\n\"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n}\n```\n\n**DeepSeek**\n```json\n\"deepseek\": {\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"deepseek-chat\", \"deepseek-reasoner\"]\n}\n```\n\n**OpenRouter**\n```json\n\"openrouter\": {\n \"base_url\": \"https://openrouter.ai/api/v1\",\n \"api_key\": \"sk-or-xxx\",\n \"models\": [\"anthropic/claude-sonnet-4\", \"google/gemini-2.5-flash\"]\n}\n```\n\n**Qwen (with extended thinking)**\n```json\n\"qwen\": {\n \"base_url\": \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"api_key\": \"sk-xxx\",\n \"models\": [\"qwen3-235b-a22b\", \"qwen3-32b\"],\n \"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": false}}\n}\n```\n\n> **Note on `extra_body`:** Some providers require additional parameters. For example, Qwen models need `enable_thinking` to control the thinking mode. This field is passed directly in the request body alongside the standard OpenAI fields.\n\n---\n\n## Switching Provider & Model\n\n### Switching Via GUI\n\n**Switch provider:** Menubar → **AI Settings** → **Provider** → select one\n\n```\nAI Settings\n├── Provider\n│ ├── ✓ ollama\n│ └── openai\n├── Model\n│ ├── ✓ qwen2.5:7b\n│ └── llama3.1:8b\n├── Thinking ☐\n├── ─────────────────\n├── ...\n```\n\nThe model list updates automatically when you switch providers, showing only models available for the selected provider.\n\n**Switch model:** Menubar → **AI Settings** → **Model** → select one\n\n**Toggle thinking mode:** Menubar → **AI Settings** → **Thinking** (checkbox)\n\n### Switching Via Config File\n\nUpdate `default_provider` and `default_model` in `config.json`:\n\n```json\n{\n \"ai_enhance\": {\n \"default_provider\": \"deepseek\",\n \"default_model\": \"deepseek-chat\",\n \"thinking\": false\n }\n}\n```\n\n> **Important:** The `default_model` must be one of the models listed in the selected provider's `models` array.\n\n---\n\n## Removing a Provider\n\n### Via GUI\n\nMenubar → **AI Settings** → **Remove Provider** → select the provider to remove → confirm in the dialog.\n\n> The currently active provider cannot be removed. Switch to a different provider first.\n\n### Via Config File\n\nDelete the provider entry from `ai_enhance.providers` in `config.json`. If it was the active provider, update `default_provider` and `default_model` to point to a remaining provider.\n\n---\n\n## Quick Start Example\n\nA minimal config to get started with OpenAI enhancement:\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"openai\",\n \"default_model\": \"gpt-4o-mini\",\n \"providers\": {\n \"openai\": {\n \"base_url\": \"https://api.openai.com/v1\",\n \"api_key\": \"sk-your-key-here\",\n \"models\": [\"gpt-4o\", \"gpt-4o-mini\"]\n }\n }\n }\n}\n```\n\nOr with local Ollama (no API key needed):\n\n```json\n{\n \"ai_enhance\": {\n \"enabled\": true,\n \"mode\": \"proofread\",\n \"default_provider\": \"ollama\",\n \"default_model\": \"qwen2.5:7b\",\n \"providers\": {\n \"ollama\": {\n \"base_url\": \"http://localhost:11434/v1\",\n \"api_key\": \"ollama\",\n \"models\": [\"qwen2.5:7b\"]\n }\n }\n }\n}\n```\n\nThen select an enhancement mode from menubar → **AI Enhance** (e.g. \"纠错润色\") to activate.\n"}}}}