@huggingface/inference 3.1.4-test → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -102,7 +102,6 @@ __export(tasks_exports, {
102
102
 
103
103
  // src/config.ts
104
104
  var HF_HUB_URL = "https://huggingface.co";
105
- var HF_INFERENCE_API_URL = "https://api-inference.huggingface.co";
106
105
 
107
106
  // src/providers/fal-ai.ts
108
107
  var FAL_AI_API_BASE_URL = "https://fal.run";
@@ -230,7 +229,7 @@ function isUrl(modelOrUrl) {
230
229
 
231
230
  // package.json
232
231
  var name = "@huggingface/inference";
233
- var version = "3.1.4-test";
232
+ var version = "3.1.4";
234
233
 
235
234
  // src/lib/makeRequestOptions.ts
236
235
  var HF_HUB_INFERENCE_PROXY_TEMPLATE = `${HF_HUB_URL}/api/inference-proxy/{{PROVIDER}}`;
@@ -377,7 +376,8 @@ function makeUrl(params) {
377
376
  return baseUrl;
378
377
  }
379
378
  default: {
380
- const url = params.forceTask ? `${HF_INFERENCE_API_URL}/pipeline/${params.forceTask}/${params.model}` : `${HF_INFERENCE_API_URL}/models/${params.model}`;
379
+ const baseUrl = HF_HUB_INFERENCE_PROXY_TEMPLATE.replaceAll("{{PROVIDER}}", "hf-inference");
380
+ const url = params.forceTask ? `${baseUrl}/pipeline/${params.forceTask}/${params.model}` : `${baseUrl}/models/${params.model}`;
381
381
  if (params.taskHint === "text-generation" && params.chatCompletion) {
382
382
  return url + `/v1/chat/completions`;
383
383
  }
package/dist/index.js CHANGED
@@ -43,7 +43,6 @@ __export(tasks_exports, {
43
43
 
44
44
  // src/config.ts
45
45
  var HF_HUB_URL = "https://huggingface.co";
46
- var HF_INFERENCE_API_URL = "https://api-inference.huggingface.co";
47
46
 
48
47
  // src/providers/fal-ai.ts
49
48
  var FAL_AI_API_BASE_URL = "https://fal.run";
@@ -171,7 +170,7 @@ function isUrl(modelOrUrl) {
171
170
 
172
171
  // package.json
173
172
  var name = "@huggingface/inference";
174
- var version = "3.1.4-test";
173
+ var version = "3.1.4";
175
174
 
176
175
  // src/lib/makeRequestOptions.ts
177
176
  var HF_HUB_INFERENCE_PROXY_TEMPLATE = `${HF_HUB_URL}/api/inference-proxy/{{PROVIDER}}`;
@@ -318,7 +317,8 @@ function makeUrl(params) {
318
317
  return baseUrl;
319
318
  }
320
319
  default: {
321
- const url = params.forceTask ? `${HF_INFERENCE_API_URL}/pipeline/${params.forceTask}/${params.model}` : `${HF_INFERENCE_API_URL}/models/${params.model}`;
320
+ const baseUrl = HF_HUB_INFERENCE_PROXY_TEMPLATE.replaceAll("{{PROVIDER}}", "hf-inference");
321
+ const url = params.forceTask ? `${baseUrl}/pipeline/${params.forceTask}/${params.model}` : `${baseUrl}/models/${params.model}`;
322
322
  if (params.taskHint === "text-generation" && params.chatCompletion) {
323
323
  return url + `/v1/chat/completions`;
324
324
  }
@@ -1,3 +1,2 @@
1
1
  export declare const HF_HUB_URL = "https://huggingface.co";
2
- export declare const HF_INFERENCE_API_URL = "https://api-inference.huggingface.co";
3
2
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,2BAA2B,CAAC;AACnD,eAAO,MAAM,oBAAoB,yCAAyC,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,2BAA2B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huggingface/inference",
3
- "version": "3.1.4-test",
3
+ "version": "3.1.4",
4
4
  "packageManager": "pnpm@8.10.5",
5
5
  "license": "MIT",
6
6
  "author": "Tim Mikeladze <tim.mikeladze@gmail.com>",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "type": "module",
41
41
  "dependencies": {
42
- "@huggingface/tasks": "^0.15.3"
42
+ "@huggingface/tasks": "^0.15.4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "18.13.0"
package/src/config.ts CHANGED
@@ -1,2 +1 @@
1
1
  export const HF_HUB_URL = "https://huggingface.co";
2
- export const HF_INFERENCE_API_URL = "https://api-inference.huggingface.co";
@@ -1,5 +1,5 @@
1
1
  import type { WidgetType } from "@huggingface/tasks";
2
- import { HF_HUB_URL, HF_INFERENCE_API_URL } from "../config";
2
+ import { HF_HUB_URL } from "../config";
3
3
  import { FAL_AI_API_BASE_URL, FAL_AI_SUPPORTED_MODEL_IDS } from "../providers/fal-ai";
4
4
  import { REPLICATE_API_BASE_URL, REPLICATE_SUPPORTED_MODEL_IDS } from "../providers/replicate";
5
5
  import { SAMBANOVA_API_BASE_URL, SAMBANOVA_SUPPORTED_MODEL_IDS } from "../providers/sambanova";
@@ -90,7 +90,7 @@ export async function makeRequestOptions(
90
90
  provider === "fal-ai" && authMethod === "provider-key" ? `Key ${accessToken}` : `Bearer ${accessToken}`;
91
91
  }
92
92
 
93
- // e.g. @huggingface/inference@3.1.3
93
+ // e.g. @huggingface/inference/3.1.3
94
94
  const ownUserAgent = `${packageName}/${packageVersion}`;
95
95
  headers["User-Agent"] = [ownUserAgent, typeof navigator !== "undefined" ? navigator.userAgent : undefined]
96
96
  .filter((x) => x !== undefined)
@@ -244,9 +244,10 @@ function makeUrl(params: {
244
244
  return baseUrl;
245
245
  }
246
246
  default: {
247
+ const baseUrl = HF_HUB_INFERENCE_PROXY_TEMPLATE.replaceAll("{{PROVIDER}}", "hf-inference");
247
248
  const url = params.forceTask
248
- ? `${HF_INFERENCE_API_URL}/pipeline/${params.forceTask}/${params.model}`
249
- : `${HF_INFERENCE_API_URL}/models/${params.model}`;
249
+ ? `${baseUrl}/pipeline/${params.forceTask}/${params.model}`
250
+ : `${baseUrl}/models/${params.model}`;
250
251
  if (params.taskHint === "text-generation" && params.chatCompletion) {
251
252
  return url + `/v1/chat/completions`;
252
253
  }