Skip to content

Wire hf_token into HFCache httpx requests #4

@electron-rare

Description

@electron-rare

Files: apps/api/src/kiki_cockpit/config.py:24, apps/api/src/kiki_cockpit/services/hf_cache.py:51-54

settings.hf_token is defined but HFCache.refresh()'s httpx client never sends Authorization: Bearer {token}. Private/gated HF models can't be fetched. Currently dead code.

Fix: pass token to HFCache.__init__ and conditionally add the Authorization header in refresh():

headers = {}
if self.hf_token:
    headers["Authorization"] = f"Bearer {self.hf_token}"
async with httpx.AsyncClient(**kwargs, headers=headers) as client:
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    importantShould fix before next sprintpost-reviewSurfaced by 2026-05-04 cross-sprint review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions