diff --git a/llm/__init__.py b/llm/__init__.py index c7e7467a..8778152f 100644 --- a/llm/__init__.py +++ b/llm/__init__.py @@ -222,10 +222,10 @@ def get_key( if explicit_key: # User specified a key that's not an alias, use that return explicit_key - # Finally try environment variable + # Environment variable overrides stored key if env_var and os.environ.get(env_var): return os.environ[env_var] - # Stored key over-rides environment variables over-ride the default key + # Finally try stored key if key_alias in stored_keys: return stored_keys[key_alias] # Couldn't find it