fix: default API key to EMPTY for local endpoints

This commit is contained in:
sora 2026-08-03 07:11:41 +00:00
parent 5fdf75e349
commit eb0309baad

View File

@ -47,9 +47,8 @@ class OpenAICompatibleAPI(ModelAPI):
config=config, config=config,
) )
# use service prefix to lookup api_key # use service prefix to lookup api_key; default to 'EMPTY' for local endpoints
self.api_key = api_key or os.environ.get('EVALSCOPE_API_KEY', None) self.api_key = api_key or os.environ.get('EVALSCOPE_API_KEY') or 'EMPTY'
assert self.api_key, f'API key for {model_name} not found'
# use service prefix to lookup base_url # use service prefix to lookup base_url
self.base_url = base_url or os.environ.get('EVALSCOPE_BASE_URL', None) self.base_url = base_url or os.environ.get('EVALSCOPE_BASE_URL', None)