fix(huggingface): complete the Inference Providers router migration

Replace the retired api-inference.huggingface.co host with the Inference
Providers router (router.huggingface.co): imageConfig.modelMap resolves
Hub ids to provider-resolved ids, image-to-image models receive the
source image in inputs with the prompt under parameters.prompt, and a
new sttConfig wires the hf-inference ASR route. The image catalog grows
to 23 models, dead whisper-small is replaced by whisper-large-v3-turbo,
the unusable "language" param is dropped, and edit models declare the
edit capability so the dashboard offers a source image. Adds unit and
end-to-end coverage plus a model-id guard on custom endpoints.
This commit is contained in:
kimono381
2026-09-19 10:44:13 +07:00
committed by decolua
parent 822aa958d1
commit cf663f5300
6 changed files with 659 additions and 8 deletions

View File

@@ -36,6 +36,13 @@ import { DEFAULT_RETRY_CONFIG, FETCH_CONNECT_TIMEOUT_MS } from "../config/runtim
* MediaConfig: { serviceKinds:[...], ttsConfig, sttConfig, embeddingConfig, imageConfig,
* searchViaChat:{defaultModel,pricingUrl}, hiddenKinds } — each *Config: {baseUrl,authType,authHeader,
* format,defaultModel,models:[{id,name,dimensions?}]}.
*
* imageConfig.modelMap (optional): maps a client-facing model id to a provider-resolved id when
* those differ — e.g. the HuggingFace Inference Providers router, where a Hub id like
* `black-forest-labs/FLUX.1-schnell` is addressed as `fal-ai/fal-ai/flux/schnell`. A value is
* either the provider path, or `{path, task}` when the request shape differs per task
* (HuggingFace uses task:"image-to-image" to move the prompt under `parameters.prompt`).
* Ignored by providers whose model ids are sent verbatim.
*/
// Shared transport defaults — provider only overrides fields that differ.