@huggingface/inference 3.3.2 → 3.3.3

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/README.md CHANGED
@@ -125,7 +125,7 @@ for await (const output of hf.textGenerationStream({
125
125
 
126
126
  ### Text Generation (Chat Completion API Compatible)
127
127
 
128
- Using the `chatCompletion` method, you can generate text with models compatible with the OpenAI Chat Completion API. All models served by [TGI](https://api-inference.huggingface.co/framework/text-generation-inference) on Hugging Face support Messages API.
128
+ Using the `chatCompletion` method, you can generate text with models compatible with the OpenAI Chat Completion API. All models served by [TGI](https://huggingface.co/docs/text-generation-inference/) on Hugging Face support Messages API.
129
129
 
130
130
  [Demo](https://huggingface.co/spaces/huggingfacejs/streaming-chat-completion)
131
131
 
package/dist/index.cjs CHANGED
@@ -98,6 +98,7 @@ __export(tasks_exports, {
98
98
 
99
99
  // src/config.ts
100
100
  var HF_HUB_URL = "https://huggingface.co";
101
+ var HF_ROUTER_URL = "https://router.huggingface.co";
101
102
 
102
103
  // src/providers/fal-ai.ts
103
104
  var FAL_AI_API_BASE_URL = "https://fal.run";
@@ -124,7 +125,7 @@ function isUrl(modelOrUrl) {
124
125
 
125
126
  // package.json
126
127
  var name = "@huggingface/inference";
127
- var version = "3.3.2";
128
+ var version = "3.3.3";
128
129
 
129
130
  // src/providers/consts.ts
130
131
  var HARDCODED_MODEL_ID_MAPPING = {
@@ -188,7 +189,7 @@ async function getProviderModelId(params, args, options = {}) {
188
189
  }
189
190
 
190
191
  // src/lib/makeRequestOptions.ts
191
- var HF_HUB_INFERENCE_PROXY_TEMPLATE = `${HF_HUB_URL}/api/inference-proxy/{{PROVIDER}}`;
192
+ var HF_HUB_INFERENCE_PROXY_TEMPLATE = `${HF_ROUTER_URL}/{{PROVIDER}}`;
192
193
  var tasks = null;
193
194
  async function makeRequestOptions(args, options) {
194
195
  const { accessToken, endpointUrl, provider: maybeProvider, model: maybeModel, ...remainingArgs } = args;
package/dist/index.js CHANGED
@@ -43,6 +43,7 @@ __export(tasks_exports, {
43
43
 
44
44
  // src/config.ts
45
45
  var HF_HUB_URL = "https://huggingface.co";
46
+ var HF_ROUTER_URL = "https://router.huggingface.co";
46
47
 
47
48
  // src/providers/fal-ai.ts
48
49
  var FAL_AI_API_BASE_URL = "https://fal.run";
@@ -69,7 +70,7 @@ function isUrl(modelOrUrl) {
69
70
 
70
71
  // package.json
71
72
  var name = "@huggingface/inference";
72
- var version = "3.3.2";
73
+ var version = "3.3.3";
73
74
 
74
75
  // src/providers/consts.ts
75
76
  var HARDCODED_MODEL_ID_MAPPING = {
@@ -133,7 +134,7 @@ async function getProviderModelId(params, args, options = {}) {
133
134
  }
134
135
 
135
136
  // src/lib/makeRequestOptions.ts
136
- var HF_HUB_INFERENCE_PROXY_TEMPLATE = `${HF_HUB_URL}/api/inference-proxy/{{PROVIDER}}`;
137
+ var HF_HUB_INFERENCE_PROXY_TEMPLATE = `${HF_ROUTER_URL}/{{PROVIDER}}`;
137
138
  var tasks = null;
138
139
  async function makeRequestOptions(args, options) {
139
140
  const { accessToken, endpointUrl, provider: maybeProvider, model: maybeModel, ...remainingArgs } = args;
@@ -1,2 +1,3 @@
1
1
  export declare const HF_HUB_URL = "https://huggingface.co";
2
+ export declare const HF_ROUTER_URL = "https://router.huggingface.co";
2
3
  //# 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"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,2BAA2B,CAAC;AACnD,eAAO,MAAM,aAAa,kCAAkC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huggingface/inference",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "packageManager": "pnpm@8.10.5",
5
5
  "license": "MIT",
6
6
  "author": "Tim Mikeladze <tim.mikeladze@gmail.com>",
package/src/config.ts CHANGED
@@ -1 +1,2 @@
1
1
  export const HF_HUB_URL = "https://huggingface.co";
2
+ export const HF_ROUTER_URL = "https://router.huggingface.co";
@@ -1,4 +1,4 @@
1
- import { HF_HUB_URL } from "../config";
1
+ import { HF_HUB_URL, HF_ROUTER_URL } from "../config";
2
2
  import { FAL_AI_API_BASE_URL } from "../providers/fal-ai";
3
3
  import { NEBIUS_API_BASE_URL } from "../providers/nebius";
4
4
  import { REPLICATE_API_BASE_URL } from "../providers/replicate";
@@ -11,7 +11,7 @@ import { isUrl } from "./isUrl";
11
11
  import { version as packageVersion, name as packageName } from "../../package.json";
12
12
  import { getProviderModelId } from "./getProviderModelId";
13
13
 
14
- const HF_HUB_INFERENCE_PROXY_TEMPLATE = `${HF_HUB_URL}/api/inference-proxy/{{PROVIDER}}`;
14
+ const HF_HUB_INFERENCE_PROXY_TEMPLATE = `${HF_ROUTER_URL}/{{PROVIDER}}`;
15
15
 
16
16
  /**
17
17
  * Lazy-loaded from huggingface.co/api/tasks when needed