cloudflare / cloudflare/cloudflare-docs
Technical Report: Deprecated HuggingFace API Endpoint in Cloudflare AI Gateway
- Dominant language
- MDX
- Stars
- 5.2k
- Forks
- 16.7k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 337
Description
### Example URL(s)
- https://developers.cloudflare.com/ai-gateway/usage/providers/huggingface/
- Error logs from Cloudflare AI Gateway dashboard showing: `{"error": "https://api-inference.huggingface.co is no longer supported. Please use https://router.huggingface.co instead."}`
### Actual Behavior
The Cloudflare AI Gateway documentation for HuggingFace providers appears to be outdated. The documentation does not reflect that HuggingFace has deprecated `api-inference.huggingface.co` in favor of `router.huggingface.co`. As a result, users attempting to use HuggingFace models through the AI Gateway encounter errors indicating the old endpoint is no longer supported, even though the gateway URL format (`https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/huggingface/{model}`) remains unchanged.
### Expected Behavior
The documentation should be updated to:
1. Clearly state that the AI Gateway now routes to HuggingFace's updated `router.huggingface.co` endpoint internally.
2. Remove any references to the deprecated `api-inference.huggingface.co` endpoint.
3. Include a note about the transition and potential temporary errors during the migration period.
4. Provide updated examples or confirm that existing gateway URLs continue to work without user-side changes.
### Additional information
Contributor guide
Assessment
This issue has not been assessed yet.