Skip to content

Commit e67d451

Browse files
SBrandeisjulien-c
andauthored
♻️ Rebrand: Inference API -> Inference Endpoints (serverless) (#458)
cc @julien-c @gary149 @Pierrci @osanseviero The Inference API is changing names and becoming part of the Inference Endpoints product (`Inference Endpoints (serverless)` ) This PR renames all references to `Inference API` as `Inference Endpoints (serverless) --------- Co-authored-by: Julien Chaumond <[email protected]>
1 parent 2ca74cc commit e67d451

File tree

23 files changed

+46
-46
lines changed

23 files changed

+46
-46
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ await inference.textToImage({
3737

3838
This is a collection of JS libraries to interact with the Hugging Face API, with TS types included.
3939

40-
- [@huggingface/inference](packages/inference/README.md): Use the Inference API to make calls to 100,000+ Machine Learning models, or your own [inference endpoints](https://hf.co/docs/inference-endpoints/)!
40+
- [@huggingface/inference](packages/inference/README.md): Use Inference Endpoints (serverless) to make calls to 100,000+ Machine Learning models
4141
- [@huggingface/hub](packages/hub/README.md): Interact with huggingface.co to create or delete repos and commit / download files
4242
- [@huggingface/agents](packages/agents/README.md): Interact with HF models through a natural language interface
4343

4444

45-
With more to come, like `@huggingface/endpoints` to manage your HF Endpoints!
46-
4745
We use modern features to avoid polyfills and dependencies, so the libraries will only work on modern browsers / Node.js >= 18 / Bun / Deno.
4846

4947
The libraries are still very young, please help us by opening issues!
@@ -128,7 +126,7 @@ await inference.imageToText({
128126
model: 'nlpconnect/vit-gpt2-image-captioning',
129127
})
130128

131-
// Using your own inference endpoint: https://hf.co/docs/inference-endpoints/
129+
// Using your own dedicated inference endpoint: https://hf.co/docs/inference-endpoints/
132130
const gpt2 = inference.endpoint('https://xyz.eu-west-1.aws.endpoints.huggingface.cloud/gpt2');
133131
const { generated_text } = await gpt2.textGeneration({inputs: 'The answer to the universe is'});
134132
```

docs/_toctree.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
isExpanded: true
55
sections:
66
- local: inference/README
7-
title: Use the Inference API
7+
title: Use Inference Endpoints
88
- local: inference/modules
9-
title: API Reference
9+
title: API reference
1010
- title: "@huggingface/hub"
1111
isExpanded: true
1212
sections:

packages/agents/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 🤗 Hugging Face Agents.js
22

3-
A way to call Hugging Face models and inference APIs from natural language, using an LLM.
3+
A way to call Hugging Face models and Inference Endpoints from natural language, using an LLM.
44

55
## Install
66

@@ -25,7 +25,7 @@ Check out the [full documentation](https://huggingface.co/docs/huggingface.js/ag
2525

2626
## Usage
2727

28-
Agents.js leverages LLMs hosted as Inference APIs on HF, so you need to create an account and generate an [access token](https://huggingface.co/settings/tokens).
28+
Agents.js leverages LLMs hosted as Inference Endpoints on HF, so you need to create an account and generate an [access token](https://huggingface.co/settings/tokens).
2929

3030
```ts
3131
import { HfAgent } from "@huggingface/agents";

packages/inference/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# 🤗 Hugging Face Inference API
1+
# 🤗 Hugging Face Inference Endpoints
22

3-
A Typescript powered wrapper for the Hugging Face Inference API. Learn more about the Inference API at [Hugging Face](https://huggingface.co/docs/api-inference/index). It also works with [Inference Endpoints](https://huggingface.co/docs/inference-endpoints/index).
3+
A Typescript powered wrapper for the Hugging Face Inference Endpoints API. Learn more about Inference Endpoints at [Hugging Face](https://huggingface.co/inference-endpoints).
4+
It works with both [serverless](https://huggingface.co/docs/api-inference/index) and [dedicated](https://huggingface.co/docs/inference-endpoints/index) Endpoints.
45

56
Check out the [full documentation](https://huggingface.co/docs/huggingface.js/inference/README).
67

7-
You can also try out a live [interactive notebook](https://observablehq.com/@huggingface/hello-huggingface-js-inference), see some demos on [hf.co/huggingfacejs](https://huggingface.co/huggingfacejs), or watch a [Scrimba tutorial that explains how the Inference API works](https://scrimba.com/scrim/cod8248f5adfd6e129582c523).
8+
You can also try out a live [interactive notebook](https://observablehq.com/@huggingface/hello-huggingface-js-inference), see some demos on [hf.co/huggingfacejs](https://huggingface.co/huggingfacejs), or watch a [Scrimba tutorial that explains how Inference Endpoints works](https://scrimba.com/scrim/cod8248f5adfd6e129582c523).
89

910
## Getting Started
1011

packages/inference/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"packageManager": "[email protected]",
55
"license": "MIT",
66
"author": "Tim Mikeladze <[email protected]>",
7-
"description": "Typescript wrapper for the Hugging Face Inference API",
7+
"description": "Typescript wrapper for the Hugging Face Inference Endpoints API",
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/huggingface/huggingface.js.git"

packages/inference/src/lib/getDefaultTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { isUrl } from "./isUrl";
22

33
/**
44
* We want to make calls to the huggingface hub the least possible, eg if
5-
* someone is calling the inference API 1000 times per second, we don't want
5+
* someone is calling Inference Endpoints 1000 times per second, we don't want
66
* to make 1000 calls to the hub to get the task name.
77
*/
88
const taskCache = new Map<string, { task: string; date: Date }>();

packages/inference/src/tasks/custom/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { InferenceTask, Options, RequestArgs } from "../../types";
22
import { makeRequestOptions } from "../../lib/makeRequestOptions";
33

44
/**
5-
* Primitive to make custom calls to the inference API
5+
* Primitive to make custom calls to Inference Endpoints
66
*/
77
export async function request<T>(
88
args: RequestArgs,

packages/inference/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface Options {
66
*/
77
retry_on_error?: boolean;
88
/**
9-
* (Default: true). Boolean. There is a cache layer on the inference API to speedup requests we have already seen. Most models can use those results as is as models are deterministic (meaning the results will be the same anyway). However if you use a non deterministic model, you can set this parameter to prevent the caching mechanism from being used resulting in a real new query.
9+
* (Default: true). Boolean. There is a cache layer on Inference Endpoints (serverless) to speedup requests we have already seen. Most models can use those results as is as models are deterministic (meaning the results will be the same anyway). However if you use a non deterministic model, you can set this parameter to prevent the caching mechanism from being used resulting in a real new query.
1010
*/
1111
use_cache?: boolean;
1212
/**
@@ -47,7 +47,7 @@ export interface BaseArgs {
4747
*/
4848
accessToken?: string;
4949
/**
50-
* The model to use. Can be a full URL for HF inference endpoints.
50+
* The model to use. Can be a full URL for a dedicated inference endpoint.
5151
*
5252
* If not specified, will call huggingface.co/api/tasks to get the default model for the task.
5353
*/

packages/tasks/src/library-to-tasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { PipelineType } from "./pipelines";
33

44
/**
55
* Mapping from library name (excluding Transformers) to its supported tasks.
6-
* Inference API should be disabled for all other (library, task) pairs beyond this mapping.
6+
* Inference Endpoints (serverless) should be disabled for all other (library, task) pairs beyond this mapping.
77
* As an exception, we assume Transformers supports all inference tasks.
88
* This mapping is generated automatically by "python-api-export-tasks" action in huggingface/api-inference-community repo upon merge.
99
* Ref: https://github.com/huggingface/api-inference-community/pull/158

packages/tasks/src/model-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export interface ModelData {
7878
*/
7979
widgetData?: WidgetExample[] | undefined;
8080
/**
81-
* Parameters that will be used by the widget when calling Inference API
81+
* Parameters that will be used by the widget when calling Inference Endpoints (serverless)
8282
* https://huggingface.co/docs/api-inference/detailed_parameters
8383
*
8484
* can be set in the model card metadata (under `inference/parameters`)

0 commit comments

Comments
 (0)