Sub-issue of #148
Implement auth=HuggingFaceAuth() to reroute compatible providers through HuggingFace's router (router.huggingface.co) using HF_TOKEN — exactly like auth=GoogleADC() reroutes providers through Vertex AI today.
This enables providers like Together, nscale, fal-ai, Replicate etc. to be accessed via HF billing, without needing separate API keys per provider.
Assumes target providers already exist as their own Provider.* entries. This issue covers the auth routing layer only.
See #166 for architecture decision and URL rewriting details.
Done when: a user can pass auth=HuggingFaceAuth() to a supported provider and requests are transparently routed through router.huggingface.co with HF_TOKEN as the credential.
@LeoLejeune
Sub-issue of #148
Implement
auth=HuggingFaceAuth()to reroute compatible providers through HuggingFace's router (router.huggingface.co) usingHF_TOKEN— exactly likeauth=GoogleADC()reroutes providers through Vertex AI today.This enables providers like Together, nscale, fal-ai, Replicate etc. to be accessed via HF billing, without needing separate API keys per provider.
Assumes target providers already exist as their own
Provider.*entries. This issue covers the auth routing layer only.See #166 for architecture decision and URL rewriting details.
Done when: a user can pass
auth=HuggingFaceAuth()to a supported provider and requests are transparently routed throughrouter.huggingface.cowithHF_TOKENas the credential.@LeoLejeune