Skip to content

Commit 77c955b

Browse files
committed
fix(settings): restrict model selection for Deepinfra in production without API key
1 parent 4d3c2cf commit 77c955b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/SettingsModal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ export function SettingsModal() {
8181
{ id: 'custom', name: 'Other' }
8282
];
8383
case 'deepinfra':
84-
if (!isDev) {
84+
// In production without an API key, limit to free tier model
85+
if (!isDev && !localApiKey) {
8586
return [
8687
{ id: 'hexgrad/Kokoro-82M', name: 'hexgrad/Kokoro-82M' }
8788
];
8889
}
90+
// In dev or with an API key, allow all models
8991
return [
9092
{ id: 'hexgrad/Kokoro-82M', name: 'hexgrad/Kokoro-82M' },
9193
{ id: 'canopylabs/orpheus-3b-0.1-ft', name: 'canopylabs/orpheus-3b-0.1-ft' },
@@ -100,7 +102,7 @@ export function SettingsModal() {
100102
{ id: 'tts-1', name: 'TTS-1' }
101103
];
102104
}
103-
}, [localTTSProvider]);
105+
}, [localTTSProvider, localApiKey]);
104106

105107
const supportsCustom = useMemo(() => localTTSProvider !== 'openai', [localTTSProvider]);
106108

0 commit comments

Comments
 (0)