Skip to content

Add HuggingFace auth routing (HuggingFaceAuth) #188

@Kamilbenkirane

Description

@Kamilbenkirane

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions