Alibrown commited on
Commit
8ec4c18
·
verified ·
1 Parent(s): b198f15

Update app/providers.py

Browse files
Files changed (1) hide show
  1. app/providers.py +5 -5
app/providers.py CHANGED
@@ -179,17 +179,17 @@ class OpenRouterProvider(BaseProvider):
179
 
180
 
181
  class HuggingFaceProvider(BaseProvider):
182
- """HuggingFace Inference API — new router endpoint (hf-inference).
183
 
184
- Old endpoint /models/{model}/v1/ is deprecated/410 for most models.
185
- New endpoint: router.huggingface.co/hf-inference/v1/chat/completions
186
- base_url in .pyfun must be: https://router.huggingface.co/hf-inference/v1
187
  """
188
 
189
  async def complete(self, prompt: str, model: str = None, max_tokens: int = 512) -> str:
190
  m = model or self.model
191
  data = await self._post(
192
- f"{self.base_url}/chat/completions", # model im payload, nicht in URL!
193
  headers={
194
  "Authorization": f"Bearer {self.key}",
195
  "content-type": "application/json",
 
179
 
180
 
181
  class HuggingFaceProvider(BaseProvider):
182
+ """HuggingFace Inference API — OpenAI-compatible serverless endpoint.
183
 
184
+ base_url in .pyfun: https://api-inference.huggingface.co/v1
185
+ Model goes in payload, not in URL.
186
+ Free tier: max ~8B models. PRO required for 70B+.
187
  """
188
 
189
  async def complete(self, prompt: str, model: str = None, max_tokens: int = 512) -> str:
190
  m = model or self.model
191
  data = await self._post(
192
+ f"{self.base_url}/chat/completions",
193
  headers={
194
  "Authorization": f"Bearer {self.key}",
195
  "content-type": "application/json",