Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#OpenAI API Key
VITE_OPENAI_API_KEY = ''

#DeepSeek API Key
#OpenAI API Key
VITE_OPENAI_API_KEY = ''
#DeepSeek API Key
VITE_DEEPSEEK_API_KEY = ''

#Groq whisper API Key
VITE_GROQ_API_KEY = ''

#Function calling sources (optional)
VITE_JACKETT_API_KEY=''
VITE_JACKETT_URL=''
VITE_QB_URL=''
VITE_QB_USERNAME=''
VITE_QB_PASSWORD=''
#API Route API Key
VITE_API_ROUTE_API_KEY = ''

#Groq whisper API Key
VITE_GROQ_API_KEY = ''

#Function calling sources (optional)
VITE_JACKETT_API_KEY=''
VITE_JACKETT_URL=''
VITE_QB_URL=''
VITE_QB_USERNAME=''
VITE_QB_PASSWORD=''
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Alice is more than a chatbot; she’s built to feel present, responsive, emotion
<img width="817" height="504" alt="AliceVideo" src="https://github.com/user-attachments/assets/9e0ffee2-198a-43a0-9f9a-a003d221e31d" />
</a>
</p>

## ✨ Key Features

### 💻 Local and Cloud use
Expand Down Expand Up @@ -84,7 +83,7 @@ With the local STT model, you can set a **wake-up word** (like "Hey, Siri").

Fully customizable settings interface:

* LLM provider selection between OpenAI, OpenRouter, DeepSeek, Z.ai(coding plan), Minimax(token plan), Ollama, LM Studio
* LLM provider selection between OpenAI, OpenRouter, API Route, DeepSeek, Z.ai(coding plan), Minimax(token plan), Ollama, LM Studio
* Cloud or local TTS, STT, Embeddings
* Model choice & parameters (temperature, top\_p, history, etc)
* Prompt and summarization tuning
Expand Down Expand Up @@ -131,7 +130,7 @@ Follow the [Setup Instructions](https://github.com/pmbstyle/Alice/blob/main/docs
* **Frontend:** [Vue.js](https://vuejs.org/), [TailwindCSS](https://tailwindcss.com/)
* **Desktop Shell:** [Electron](https://www.electronjs.org/)
* **State Management:** [Pinia](https://pinia.vuejs.org/)
* **AI APIs:** [OpenAI](https://platform.openai.com/), [OpenRouter](https://openrouter.ai/), [DeepSeek](https://platform.deepseek.com/), [Groq](https://console.groq.com/)
* **AI APIs:** [OpenAI](https://platform.openai.com/), [OpenRouter](https://openrouter.ai/), [API Route](https://www.api-route.com/), [DeepSeek](https://platform.deepseek.com/), [Groq](https://console.groq.com/)
* **Backend:** [Go](https://go.dev/)
* **Vector search engine**: [hnswlib-node](https://github.com/nmslib/hnswlib)
* **Local storage**: [better-sqlite3](https://github.com/WiseLibs/better-sqlite3)
Expand Down
9 changes: 8 additions & 1 deletion docs/setupInstructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Run in your terminal `xattr -cr "/Applications/Alice AI App.app"`

# AI Provider Setup

Alice supports OpenAI, OpenRouter, DeepSeek, MiniMax, Z.ai, and local LLM inference.
Alice supports OpenAI, OpenRouter, API Route, DeepSeek, MiniMax, Z.ai, and local LLM inference.

## OpenAI (Default)

Expand All @@ -37,6 +37,13 @@ Alice supports OpenAI, OpenRouter, DeepSeek, MiniMax, Z.ai, and local LLM infere
- Select "AI Provider" in Core Settings as DeepSeek
- Use the default base URL `https://api.deepseek.com`
- DeepSeek powers chat inference only; cloud TTS/STT/embeddings still require OpenAI or local voice and memory mode

## API Route (Alternative)

- Get an API key from [API Route](https://www.api-route.com/api-keys)
- Select "AI Provider" in Core Settings as API Route
- Alice loads the models available to your account from the API Route endpoint
- API Route powers chat inference only; cloud TTS/STT/embeddings still require OpenAI or local voice and memory mode
- No image generation support (use OpenAI provider for image-gen)

## Local Ollama / LM studio
Expand Down
1 change: 1 addition & 0 deletions electron/main/securityBoundaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const BUILT_IN_HTTP_BASE_URLS = [
'https://api.z.ai',
'https://api.minimax.io',
'https://api.deepseek.com',
'https://global.api-route.com',
'http://localhost:11434',
'http://localhost:1234',
]
Expand Down
2 changes: 2 additions & 0 deletions electron/main/settingsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface AppSettings {
VITE_ZAI_API_KEY?: string
VITE_MINIMAX_API_KEY?: string
VITE_DEEPSEEK_API_KEY?: string
VITE_API_ROUTE_API_KEY?: string
VITE_GROQ_API_KEY?: string
sttProvider?: 'openai' | 'groq' | 'transformers'
aiProvider?:
Expand All @@ -35,6 +36,7 @@ export interface AppSettings {
| 'zai'
| 'minimax'
| 'deepseek'
| 'api-route'
| 'codex'

// Transformers STT settings
Expand Down
1 change: 1 addition & 0 deletions electron/main/settingsSecurity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const SECRET_SETTING_KEYS = [
'VITE_ZAI_API_KEY',
'VITE_MINIMAX_API_KEY',
'VITE_DEEPSEEK_API_KEY',
'VITE_API_ROUTE_API_KEY',
'VITE_GROQ_API_KEY',
'VITE_GOOGLE_API_KEY',
'VITE_JACKETT_API_KEY',
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/securityBoundaries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('security boundaries', () => {
'https://api.openai.com/v1/models',
'https://openrouter.ai/api/v1/models',
'https://api.minimax.io/v1/models',
'https://global.api-route.com/v1/models',
]) {
expect(validateHttpBridgeUrl(url, origins)).toBe(url)
}
Expand Down
6 changes: 5 additions & 1 deletion src/__tests__/settingsSecurity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ describe('settings secret boundaries', () => {
it('keeps secrets out of the public settings record', () => {
const result = splitSecretSettings({
VITE_OPENAI_API_KEY: 'sk-test',
VITE_API_ROUTE_API_KEY: 'sk-route',
VITE_QB_PASSWORD: '',
aiProvider: 'openai',
})

expect(result.publicSettings).toEqual({ aiProvider: 'openai' })
expect(result.secrets).toEqual({ VITE_OPENAI_API_KEY: 'sk-test' })
expect(result.secrets).toEqual({
VITE_OPENAI_API_KEY: 'sk-test',
VITE_API_ROUTE_API_KEY: 'sk-route',
})
expect(result.hadSecretFields).toBe(true)
expect(hasSecretValues(result.secrets)).toBe(true)
})
Expand Down
5 changes: 5 additions & 0 deletions src/components/settings/AssistantSettingsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
(currentSettings.aiProvider === 'deepseek' &&
currentSettings.VITE_DEEPSEEK_API_KEY &&
currentSettings.deepseekBaseUrl) ||
(currentSettings.aiProvider === 'api-route' &&
currentSettings.VITE_API_ROUTE_API_KEY) ||
(currentSettings.aiProvider === 'ollama' &&
currentSettings.ollamaBaseUrl) ||
(currentSettings.aiProvider === 'lm-studio' &&
Expand Down Expand Up @@ -312,6 +314,8 @@
(currentSettings.aiProvider === 'deepseek' &&
currentSettings.VITE_DEEPSEEK_API_KEY &&
currentSettings.deepseekBaseUrl) ||
(currentSettings.aiProvider === 'api-route' &&
currentSettings.VITE_API_ROUTE_API_KEY) ||
(currentSettings.aiProvider === 'ollama' &&
currentSettings.ollamaBaseUrl) ||
(currentSettings.aiProvider === 'lm-studio' &&
Expand Down Expand Up @@ -526,6 +530,7 @@ const getProviderDisplayName = (provider: string): string => {
zai: 'Z.ai',
minimax: 'MiniMax',
deepseek: 'DeepSeek',
'api-route': 'API Route',
}
return providerNames[provider] || provider
}
Expand Down
23 changes: 23 additions & 0 deletions src/components/settings/CoreSettingsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<option value="zai">Z.ai (Coding Plan)</option>
<option value="minimax">MiniMax</option>
<option value="deepseek">DeepSeek</option>
<option value="api-route">API Route</option>
<option value="codex">ChatGPT Codex</option>
<option value="ollama">Ollama (Local)</option>
<option value="lm-studio">LM Studio (Local)</option>
Expand Down Expand Up @@ -215,6 +216,28 @@
Required for DeepSeek chat models.
</p>
</div>
<div v-if="currentSettings.aiProvider === 'api-route'">
<label for="api-route-key" class="block mb-1 text-sm"
>API Route API Key *</label
>
<input
id="api-route-key"
type="password"
v-model="currentSettings.VITE_API_ROUTE_API_KEY"
class="input focus:outline-none w-full"
autocomplete="new-password"
placeholder="sk-..."
/>
<p class="text-xs text-gray-400 mt-1">
Required for API Route chat models.
<a
href="https://www.api-route.com/api-keys"
target="_blank"
class="link"
>Get an API key</a
>.
</p>
</div>
<div v-if="currentSettings.aiProvider === 'deepseek'">
<label for="deepseek-url" class="block mb-1 text-sm"
>DeepSeek Base URL *</label
Expand Down
60 changes: 58 additions & 2 deletions src/components/wizard/OnboardingWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@test-zai="testZAIKey"
@test-minimax="testMiniMaxKey"
@test-deepseek="testDeepSeekKey"
@test-api-route="testAPIRouteKey"
@test-codex="testCodexAuth"
@test-ollama="testOllamaConnection"
@test-lmstudio="testLMStudioConnection"
Expand Down Expand Up @@ -83,6 +84,7 @@ import {
type AIProviderKey,
} from '../../services/llmProviders/providerCatalog'
import { listDeepSeekModelsForConfig } from '../../services/llmProviders/deepseek'
import { listAPIRouteModelsForConfig } from '../../services/llmProviders/apiRoute'
import { listCodexModels } from '../../services/llmProviders/codex'
import { listMiniMaxModelsForConfig } from '../../services/llmProviders/minimax'
import { listOpenAIModelsForConfig } from '../../services/llmProviders/openai'
Expand Down Expand Up @@ -125,6 +127,7 @@ const formData = reactive({
VITE_ZAI_API_KEY: '',
VITE_MINIMAX_API_KEY: '',
VITE_DEEPSEEK_API_KEY: '',
VITE_API_ROUTE_API_KEY: '',
codexAuthConnected: false,
codexAccountLabel: '',
aiProvider: 'openai' as AIProviderKey,
Expand All @@ -151,6 +154,7 @@ const isTesting = reactive({
zai: false,
minimax: false,
deepseek: false,
apiRoute: false,
codex: false,
ollama: false,
lmStudio: false,
Expand All @@ -162,6 +166,7 @@ const testResult = reactive({
zai: { success: false, error: '' },
minimax: { success: false, error: '' },
deepseek: { success: false, error: '' },
apiRoute: { success: false, error: '' },
codex: { success: false, error: '' },
ollama: { success: false, error: '' },
lmStudio: { success: false, error: '' },
Expand Down Expand Up @@ -196,6 +201,7 @@ const canContinue = computed(() => {
formData.aiProvider === 'zai' ||
formData.aiProvider === 'minimax' ||
formData.aiProvider === 'deepseek' ||
formData.aiProvider === 'api-route' ||
formData.aiProvider === 'codex') &&
!formData.VITE_OPENAI_API_KEY.trim()
) {
Expand Down Expand Up @@ -277,6 +283,17 @@ const fetchAvailableModels = async () => {
baseURL = formData.minimaxBaseUrl
} else if (formData.aiProvider === 'deepseek') {
baseURL = formData.deepseekBaseUrl
} else if (formData.aiProvider === 'api-route') {
const models = await listAPIRouteModelsForConfig(
formData.VITE_API_ROUTE_API_KEY
)
formData.availableModels = models.map(model => model.id)

if (formData.availableModels.length > 0) {
formData.assistantModel = formData.availableModels[0]
formData.summarizationModel = formData.availableModels[0]
}
return
} else if (formData.aiProvider === 'codex') {
const models = await listCodexModels()
formData.availableModels = models.map(model => model.id)
Expand Down Expand Up @@ -502,11 +519,40 @@ const testDeepSeekKey = async () => {
}
}

const testAPIRouteKey = async () => {
if (!formData.VITE_API_ROUTE_API_KEY.trim()) {
testResult.apiRoute.error = 'API Key cannot be empty.'
testResult.apiRoute.success = false
return
}

isTesting.apiRoute = true
testResult.apiRoute.error = ''
testResult.apiRoute.success = false

try {
await fetchAvailableModels()
testResult.apiRoute.success = true
} catch (e: any) {
testResult.apiRoute.error = 'API key is invalid or has no permissions.'
if (e.message?.includes('401')) {
testResult.apiRoute.error = 'Invalid API key - please check your key.'
} else if (e.message?.includes('429')) {
testResult.apiRoute.error =
'Rate limit exceeded - please try again later.'
}
} finally {
isTesting.apiRoute = false
}
}

const syncCodexStatus = async () => {
const status = await window.aliceIPC.invoke('codex-auth:status')
const connected = Boolean(status?.connected)
formData.codexAuthConnected = connected
formData.codexAccountLabel = connected ? status.accountLabel || 'Connected' : ''
formData.codexAccountLabel = connected
? status.accountLabel || 'Connected'
: ''
testResult.codex.success = connected
testResult.codex.error = connected
? ''
Expand Down Expand Up @@ -549,7 +595,9 @@ const testCodexAuth = async () => {
function handleCodexStatus(status: any) {
const connected = Boolean(status?.connected)
formData.codexAuthConnected = connected
formData.codexAccountLabel = connected ? status.accountLabel || 'Connected' : ''
formData.codexAccountLabel = connected
? status.accountLabel || 'Connected'
: ''
testResult.codex.success = connected
testResult.codex.error = connected
? ''
Expand Down Expand Up @@ -656,6 +704,8 @@ const resetTestResults = () => {
testResult.minimax.error = ''
testResult.deepseek.success = false
testResult.deepseek.error = ''
testResult.apiRoute.success = false
testResult.apiRoute.error = ''
testResult.codex.success = false
testResult.codex.error = ''
testResult.ollama.success = false
Expand Down Expand Up @@ -687,6 +737,12 @@ const isCurrentProviderTested = () => {
Boolean(formData.assistantModel) &&
Boolean(formData.summarizationModel)
)
} else if (formData.aiProvider === 'api-route') {
return (
testResult.apiRoute.success &&
Boolean(formData.assistantModel) &&
Boolean(formData.summarizationModel)
)
} else if (formData.aiProvider === 'codex') {
return (
testResult.codex.success &&
Expand Down
Loading
Loading