Electron ENV fix

Allow OPENAI_LIKE_API_* through Electron env variables.
This commit is contained in:
Shaan 2025-06-26 08:31:49 +06:00
parent 840f35cbbc
commit 2811be37bb
2 changed files with 6 additions and 2 deletions

View File

@ -16,7 +16,11 @@ export default class OpenAILikeProvider extends BaseProvider {
staticModels: ModelInfo[] = [];
getEnvDefinedModels(serverEnv: Record<string, string> = {}): ModelInfo[] {
const models = serverEnv[this.config.modelKey] || process.env[this.config.modelKey];
const models =
serverEnv[this.config.modelKey] ||
process.env[this.config.modelKey] ||
import.meta.env[this.config.modelKey] ||
'';
console.debug(`${this.name}: ${this.config.modelKey}=${models}`);
const mklabel = (model: string) => {

View File

@ -59,7 +59,7 @@ export default defineConfig((config) => {
],
envPrefix: [
'VITE_',
'OPENAI_LIKE_API_BASE_URL',
'OPENAI_LIKE_API_',
'OLLAMA_API_BASE_URL',
'LMSTUDIO_API_BASE_URL',
'TOGETHER_API_BASE_URL',