From 93f32d385576aff0b75917e55779f4eaf4b2fcac Mon Sep 17 00:00:00 2001 From: Joshua Vial Date: Thu, 21 Dec 2023 09:36:06 +1300 Subject: [PATCH] make benchmark listen to openai_api_base env var --- benchmark/benchmark.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 12979cda8..d091e813e 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -787,11 +787,10 @@ def run_test( chat_history_file=history_fname, ) - # Check if AIDER_DOCKER environment variable is set and create client accordingly if "OPENAI_API_BASE" in os.environ and "openrouter.ai" in os.environ["OPENAI_API_BASE"]: client = openai.OpenAI( api_key=os.environ["OPENAI_API_KEY"], - base_url=os.environ.get("OPENAI_API_BASE", "https://api.openai.com"), + base_url=os.environ.get("OPENAI_API_BASE"), default_headers={ "HTTP-Referer": "http://aider.chat", "X-Title": "Aider", @@ -800,6 +799,7 @@ def run_test( else: client = openai.OpenAI( api_key=os.environ["OPENAI_API_KEY"], + base_url=os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1"), ) main_model = models.Model.create(model_name, client)