From bbf4bb765c9e5dfea0f170329bf3dbdf405b177f Mon Sep 17 00:00:00 2001 From: Will Chen Date: Thu, 15 May 2025 15:09:45 -0700 Subject: [PATCH] Allow overriding gateway URL (#169) --- package.json | 1 + src/ipc/utils/get_model_client.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ed3f6fc..982c585 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "clean": "rm -rf out && rm -rf scaffold/node_modules", "start": "electron-forge start", "dev:engine": "DYAD_LOCAL_ENGINE=http://localhost:8080/v1 npm start", + "staging:gateway": "DYAD_GATEWAY_URL=https://staging---litellm-gcp-cloud-run-kq7pivehnq-uc.a.run.app/v1 npm start", "package": "npm run clean && electron-forge package", "make": "npm run clean && electron-forge make", "publish": "npm run clean && electron-forge publish", diff --git a/src/ipc/utils/get_model_client.ts b/src/ipc/utils/get_model_client.ts index 4de54c9..ae013ca 100644 --- a/src/ipc/utils/get_model_client.ts +++ b/src/ipc/utils/get_model_client.ts @@ -14,6 +14,7 @@ import { llmErrorStore } from "@/main/llm_error_store"; import { createDyadEngine } from "./llm_engine_provider"; const dyadLocalEngine = process.env.DYAD_LOCAL_ENGINE; +const dyadGatewayUrl = process.env.DYAD_GATEWAY_URL; const AUTO_MODELS = [ { @@ -105,7 +106,7 @@ export async function getModelClient( }) : createOpenAI({ apiKey: dyadApiKey, - baseURL: "https://llm-gateway.dyad.sh/v1", + baseURL: dyadGatewayUrl ?? "https://llm-gateway.dyad.sh/v1", }); logger.info(