Merge pull request #30 from manmohan659/feat/modal-inference

fix(chat-api): support Modal inference URL pattern
This commit is contained in:
Manmohan 2026-04-16 17:36:56 -04:00 committed by GitHub
commit 5b6eff82e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,9 +84,15 @@ class InferenceClient:
}
client = self._get_client()
# If the base_url already ends with a path (e.g. Modal endpoint URL),
# use it directly. Otherwise append /generate for the local service.
url = self.base_url
if not url.endswith("/generate"):
url = f"{url}/generate"
async with client.stream(
"POST",
f"{self.base_url}/generate",
url,
headers=self.headers,
json=payload,
) as response: