Skip to content

fix(huggingface): point Inference API endpoint to router.huggingface.co/hf-inference - #1464

Open
torrresagus wants to merge 1 commit into
SciSharp:masterfrom
tiltmeter-dev:fix/huggingface-router
Open

torrresagus wants to merge 1 commit into
SciSharp:masterfrom
tiltmeter-dev:fix/huggingface-router

Conversation

@torrresagus

Copy link
Copy Markdown

What changed in the API

Notice huggingface-serverless-inference-api-retired about huggingface.co's API describes this change, published 2025-07-01. It is not signed by huggingface.co: it was read from a file the person running Tiltmeter trusts.

The notice's summary:

The serverless Inference API at api-inference.huggingface.co is gone: its domain no longer resolves
(checked October 27, 2026), so requests fail before they reach Hugging Face. Its successor, HF
Inference, answers at router.huggingface.co/hf-inference with the same requests and responses per
task, and the OpenAI-compatible chat API moved to router.huggingface.co/v1. Sources:
huggingface.co/docs/inference-providers and the huggingface_hub client.

POST https://api-inference.huggingface.co/models/{model}

Severity Change Path Before After
breaking endpoint_removed $ — (gone), moved to POST https://router.huggingface.co/hf-inference/models/{model}

POST https://api-inference.huggingface.co/v1/chat/completions

Severity Change Path Before After
breaking endpoint_removed $ — (gone), moved to POST https://router.huggingface.co/v1/chat/completions

The notice's notes:

POST /models/{model}: Same request body and response for the model's task. HF Inference needs a
token (Bearer hf_...) with the Inference Providers permission, and since July 2025 it serves mostly
CPU models such as embeddings and classifiers; large chat models are served through
router.huggingface.co/v1/chat/completions.
POST /v1/chat/completions: Same OpenAI-compatible body and response. An OpenAI client's base URL
becomes https://router.huggingface.co/v1.

What this pull request changes

The serverless Inference API host api-inference.huggingface.co no longer exists. I changed the HuggingFace Endpoint from https://api-inference.huggingface.co to https://router.huggingface.co/hf-inference in the three appsettings.json files. The plugin's Refit route /models/{space}/{model} is added to this base address, so requests now go to the HF Inference successor, which takes the same body and returns the same response. Nothing in the repo calls the removed api-inference.huggingface.co/v1/chat/completions endpoint, so there was nothing to change for that one.

  • dockerfiles/appsettings.json
  • src/WebStarter/appsettings.json
  • tests/BotSharp.LLM.Tests/appsettings.json

Left for a human

  • The endpoint comes from configuration (HuggingFace:Endpoint). Deployments with their own appsettings or environment overrides still pointing at api-inference.huggingface.co must update them by hand.
  • HF Inference now serves mostly CPU models. The default model in these configs, tiiuae/falcon-180B-chat, used with the text-generation call, is likely no longer served there; large chat models are served through router.huggingface.co/v1/chat/completions. Moving the plugin to that OpenAI-compatible API would mean a different request and response shape, so it is not done here.
  • HF Inference needs a token (Bearer hf_...) with the Inference Providers permission. Existing tokens may need that permission added.

This pull request was generated automatically by Tiltmeter from the unsigned notice huggingface-serverless-inference-api-retired about huggingface.co's API. An AI agent (Claude Code with claude-opus-5-5) wrote these edits; review them like any other change.

…co/hf-inference

The serverless Inference API host api-inference.huggingface.co no longer exists. I changed the HuggingFace `Endpoint` from `https://api-inference.huggingface.co` to `https://router.huggingface.co/hf-inference` in the three appsettings.json files. The plugin's Refit route `/models/{space}/{model}` is added to this base address, so requests now go to the HF Inference successor, which takes the same body and returns the same response. Nothing in the repo calls the removed `api-inference.huggingface.co/v1/chat/completions` endpoint, so there was nothing to change for that one.

Notice huggingface-serverless-inference-api-retired about huggingface.co's API describes the change. It was read from a file and is not signed by the provider.
@qodo-code-review

qodo-code-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Point Hugging Face inference defaults to the HF Inference router

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Replace the retired Hugging Face Inference API host in application, Docker, and test defaults.
• Keep the existing model route and request format; deployments with endpoint overrides need
 separate updates.
Diagram

graph TD
  Apps["Application defaults"] --> Plugin["Plugin registration"] --> Client["Refit client"] --> Router(["HF Inference router"])
  Tests["Test defaults"] --> Plugin
Loading
High-Level Assessment

Changing the three existing configuration defaults is the narrowest way to redirect this configurable integration without changing its request contract. Hard-coding the new host in the client would remove deployment flexibility; independently configured deployments still need to update their overrides.

Files changed (3) +3 / -3

Bug fix (2) +2 / -2
appsettings.jsonRedirect the Docker Hugging Face default endpoint +1/-1

Redirect the Docker Hugging Face default endpoint

• Sets HuggingFace:Endpoint to https://router.huggingface.co/hf-inference instead of the retired API host. The model and token settings are unchanged.

dockerfiles/appsettings.json

appsettings.jsonRedirect the WebStarter Hugging Face default endpoint +1/-1

Redirect the WebStarter Hugging Face default endpoint

• Sets the WebStarter HuggingFace:Endpoint default to the HF Inference router. Other Hugging Face settings are unchanged.

src/WebStarter/appsettings.json

Other (1) +1 / -1
appsettings.jsonAlign the LLM test endpoint default with the router +1/-1

Align the LLM test endpoint default with the router

• Replaces the retired Hugging Face host with the HF Inference router in test configuration. No test cases or assertions change.

tests/BotSharp.LLM.Tests/appsettings.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant