theaniketgiri commited on
Commit
5674cfc
·
1 Parent(s): b583357

Fix API_KEY priority to ensure LiteLLM proxy tracking works

Browse files
Files changed (1) hide show
  1. inference.py +4 -3
inference.py CHANGED
@@ -45,9 +45,10 @@ import urllib.error
45
 
46
  API_BASE_URL: str = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
47
  API_KEY: str = (
48
- os.getenv("HF_TOKEN")
49
- or os.getenv("API_KEY")
50
- or os.getenv("OPENAI_API_KEY", "")
 
51
  )
52
  MODEL_NAME: str = os.getenv("MODEL_NAME", "")
53
  ENV_SERVER_URL: str = os.getenv("ENV_SERVER_URL", "http://localhost:8000")
 
45
 
46
  API_BASE_URL: str = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
47
  API_KEY: str = (
48
+ os.getenv("API_KEY")
49
+ or os.getenv("HF_TOKEN")
50
+ or os.getenv("OPENAI_API_KEY")
51
+ or "missing-api-key"
52
  )
53
  MODEL_NAME: str = os.getenv("MODEL_NAME", "")
54
  ENV_SERVER_URL: str = os.getenv("ENV_SERVER_URL", "http://localhost:8000")