@@ -229,8 +229,8 @@ def animate_count(placeholder, label: str, icon: str, target: int, duration: flo
229229 # Local development can keep using the LiteLLM gateway. Cloud deployments
230230 # can bypass it and call any OpenAI-compatible endpoint directly (for
231231 # example OpenRouter) by setting OPENAI_BASE_URL / OPENAI_API_KEY.
232- gateway_url = os .getenv ("LLM_BASE_URL" , "" ) or os . getenv ( " LLM_GATEWAY_URL" , "" )
233- gateway_key = os . getenv ( "LLM_API_KEY " , "" ) or os .getenv ("LLM_GATEWAY_API_KEY" , "" )
232+ gateway_url = os .getenv ("LLM_GATEWAY_URL" , "" )
233+ gateway_key = st . session_state . get ( "llm_gateway_session_token " , "" ) or os .getenv ("LLM_GATEWAY_API_KEY" , "" )
234234 direct_url = os .getenv ("OPENAI_BASE_URL" , "" )
235235 direct_key = os .getenv ("OPENAI_API_KEY" , "" )
236236 gateway_enabled = (
@@ -249,8 +249,8 @@ def animate_count(placeholder, label: str, icon: str, target: int, duration: flo
249249 llm_base_url = gateway_url or direct_url or "https://openrouter.ai/api/v1"
250250 llm_api_key = gateway_key or direct_key
251251 llm_model = (
252- os .getenv ("LLM_MODEL " , "" )
253- or os .getenv ("LLM_GATEWAY_MODEL " , "" )
252+ ( "" if st . session_state . get ( "llm_gateway_session_token" ) else os .getenv ("LLM_GATEWAY_MODEL " , "" ) )
253+ or os .getenv ("LLM_MODEL " , "" )
254254 or os .getenv ("OPENAI_MODEL" , "" )
255255 or os .getenv ("OPENAI_MODEL_ID" , "" )
256256 or "openrouter/free"
0 commit comments