Mayank2027 commited on
Commit
1e5ceb7
·
verified ·
1 Parent(s): 1b5d584

Update backend/model_router.py

Browse files
Files changed (1) hide show
  1. backend/model_router.py +3 -6
backend/model_router.py CHANGED
@@ -8,13 +8,10 @@ openrouter_keys = os.environ.get("OPENROUTER_KEYS", "").split(",")
8
 
9
  POLLINATIONS_URL = "https://text.pollinations.ai/"
10
 
11
- # Helper to create an AsyncOpenAI client that ignores environment proxies
12
  def _make_client(base_url: str, api_key: str) -> AsyncOpenAI:
13
- # Create an httpx client that explicitly disables proxies
14
- http_client = httpx.AsyncClient(
15
- proxies=None, # ← critical fix
16
- transport=httpx.AsyncHTTPTransport(retries=1)
17
- )
18
  return AsyncOpenAI(
19
  base_url=base_url,
20
  api_key=api_key,
 
8
 
9
  POLLINATIONS_URL = "https://text.pollinations.ai/"
10
 
11
+ # Helper that creates an AsyncOpenAI client ignoring environment proxies
12
  def _make_client(base_url: str, api_key: str) -> AsyncOpenAI:
13
+ # trust_env=False prevents reading HTTP_PROXY/HTTPS_PROXY from the environment
14
+ http_client = httpx.AsyncClient(trust_env=False)
 
 
 
15
  return AsyncOpenAI(
16
  base_url=base_url,
17
  api_key=api_key,